You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Charles E. Rolke (Jira)" <ji...@apache.org> on 2020/08/04 18:54:00 UTC

[jira] [Assigned] (DISPATCH-1707) Policy config file fails with cryptic error if trailing brace on wrong line

     [ https://issues.apache.org/jira/browse/DISPATCH-1707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Charles E. Rolke reassigned DISPATCH-1707:
------------------------------------------

    Assignee: Charles E. Rolke

> Policy config file fails with cryptic error if trailing brace on wrong line
> ---------------------------------------------------------------------------
>
>                 Key: DISPATCH-1707
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-1707
>             Project: Qpid Dispatch
>          Issue Type: Bug
>          Components: Management Agent, Policy Engine
>    Affects Versions: 1.12.0
>            Reporter: Charles E. Rolke
>            Assignee: Charles E. Rolke
>            Priority: Major
>
> If a policy vhost in a config file is specified like this
> {code:java}
> vhost {
>     hostname: 0.0.0.0
>     allowUnknownUser: true
>     groups: {
>         "$default": {
>             "users": "*",
>             "remoteHosts": "*",
>             "allowDynamicSource": true,
>             "allowAnonymousSender": true,
>             "sources": "*",
>             "targets": "*"}
>     }
> }
> {code}
> then it works fine. Buf if the trailing brace after _targets_ is on a line by itself
> {code:java}
> vhost {
>     hostname: 0.0.0.0
>     allowUnknownUser: true
>     groups: {
>         "$default": {
>             "users": "*",
>             "remoteHosts": "*",
>             "allowDynamicSource": true,
>             "allowAnonymousSender": true,
>             "sources": "*",
>             "targets": "*"
>         }
>     }
> }
> {code}
>  
> then it fails with a confusing message that does not pinpoint what is wrong.
> {code:java}
> > qdrouterd -c permissive-info.conf
> 2020-07-08 11:18:36.907041 -0400 ERROR (error) Python: Exception: Cannot load configuration file permissive-info.conf: Expecting ',' delimiter: line 46 column 3 (char 723)
> 2020-07-08 11:18:36.907563 -0400 ERROR (error) Traceback (most recent call last):
>   File "/opt/local/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py", line 61, in __init__
>     self.load(filename, raw_json)
>   File "/opt/local/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py", line 221, in load
>     self.load(f, raw_json)
>   File "/opt/local/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py", line 223, in load
>     sections = self._parserawjson(source) if raw_json else self._parse(source)
>   File "/opt/local/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py", line 193, in _parse
>     sections = json.loads(js_text)
>   File "/usr/lib64/python3.7/json/__init__.py", line 348, in loads
>     return _default_decoder.decode(s)
>   File "/usr/lib64/python3.7/json/decoder.py", line 337, in decode
>     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
>   File "/usr/lib64/python3.7/json/decoder.py", line 353, in raw_decode
>     obj, end = self.scan_once(s, idx)
> json.decoder.JSONDecodeError: Expecting ',' delimiter: line 46 column 3 (char 723)
> During handling of the above exception, another exception occurred:
> Traceback (most recent call last):
>   File "/opt/local/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py", line 251, in configure_dispatch
>     config = Config(filename)
>   File "/opt/local/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py", line 64, in __init__
>     % (filename, e))
> Exception: Cannot load configuration file permissive-info.conf: Expecting ',' delimiter: line 46 column 3 (char 723)
> 2020-07-08 11:18:36.907599 -0400 MAIN (critical) Router start-up failed: Python: Exception: Cannot load configuration file permissive-info.conf: Expecting ',' delimiter: line 46 column 3 (char 723)
> qdrouterd: Python: Exception: Cannot load configuration file permissive-info.conf: Expecting ',' delimiter: line 46 column 3 (char 723)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org