Uploaded image for project: 'AMQ Interconnect'
  1. AMQ Interconnect
  2. ENTMQIC-2600

Policy config file 'vhost' parsing fails; diagnostic message is poor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • 1.9.0.GA
    • Qpid Dispatch Router
    • None
    • False
    • False
    • Undefined

    Description

      From https://issues.apache.org/jira/browse/DISPATCH-1836

      A simple and apparently correct config file

          policy {
              maxConnections: 10000
              enableVhostPolicy: true
              enableVhostNamePatterns: true
              defaultVhost: $default
          }
      
          vhost {
              hostname: *.com
              maxConnections: 10000
              maxConnectionsPerUser: 100
              maxConnectionsPerHost: 100
              allowUnknownUser: true
              groups:{
                  "developers":{
                      "users": "admin",
                      "remoteHosts": "*",
                      "sources": "queue1",
                      "targets": "queue1" },
                  "$default":{
                      "remoteHosts": "*",
                      "allowDynamicSource": true,
                      "allowAdminStatusUpdate": true,
                      "sources": "queue2",
                      "targets": "queue2"}}
          }
      

      fails

      > qdrouterd -c C.conf
      2020-11-13 14:53:56.522448 -0500 AGENT (warning) Configuration file: invalid entity nesting detected.
      2020-11-13 14:53:56.522683 -0500 AGENT (error) Contents of failed config file
      2020-11-13 14:53:56.522750 -0500 AGENT (error) Line 1 |[["policy", {
      2020-11-13 14:53:56.522786 -0500 AGENT (error) Line 2 |"maxConnections": "10000",
      2020-11-13 14:53:56.522818 -0500 AGENT (error) Line 3 |"enableVhostPolicy": "true",
      2020-11-13 14:53:56.522846 -0500 AGENT (error) Line 4 |"enableVhostNamePatterns": "true",
      2020-11-13 14:53:56.522875 -0500 AGENT (error) Line 5 |"defaultVhost": "$default"}],
      2020-11-13 14:53:56.522903 -0500 AGENT (error) Line 6 |
      2020-11-13 14:53:56.522929 -0500 AGENT (error) Line 7 |["vhost", {
      2020-11-13 14:53:56.522956 -0500 AGENT (error) Line 8 |"hostname": "*.com",
      2020-11-13 14:53:56.522982 -0500 AGENT (error) Line 9 |"maxConnections": "10000",
      2020-11-13 14:53:56.523007 -0500 AGENT (error) Line 10 |"maxConnectionsPerUser": "100",
      2020-11-13 14:53:56.523034 -0500 AGENT (error) Line 11 |"maxConnectionsPerHost": "100",
      2020-11-13 14:53:56.523062 -0500 AGENT (error) Line 12 |"allowUnknownUser": "true",
      2020-11-13 14:53:56.523089 -0500 AGENT (error) Line 13 |"groups": {
      2020-11-13 14:53:56.523116 -0500 AGENT (error) Line 14 |"developers":{
      2020-11-13 14:53:56.523146 -0500 AGENT (error) Line 15 |"users": "admin",
      2020-11-13 14:53:56.523174 -0500 AGENT (error) Line 16 |"remoteHosts": "*",
      2020-11-13 14:53:56.523201 -0500 AGENT (error) Line 17 |"sources": "queue1",
      2020-11-13 14:53:56.523228 -0500 AGENT (error) Line 18 |"targets": "queue1" },
      2020-11-13 14:53:56.523254 -0500 AGENT (error) Line 19 |"$default":{
      2020-11-13 14:53:56.523281 -0500 AGENT (error) Line 20 |"remoteHosts": "*",
      2020-11-13 14:53:56.523307 -0500 AGENT (error) Line 21 |"allowDynamicSource": true,
      2020-11-13 14:53:56.523333 -0500 AGENT (error) Line 22 |"allowAdminStatusUpdate": true,
      2020-11-13 14:53:56.523360 -0500 AGENT (error) Line 23 |"sources": "queue2",
      2020-11-13 14:53:56.523387 -0500 AGENT (error) Line 24 |"targets": "queue2"}}
      2020-11-13 14:53:56.523413 -0500 AGENT (error) Line 25 |}]
      2020-11-13 14:53:56.523447 -0500 ERROR (error) Python: Exception: Cannot load configuration file C.conf: Expecting ',' delimiter: line 25 column 3 (char 563)
      2020-11-13 14:53:56.523815 -0500 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 237, in load
          self.load(f, raw_json)
        File "/opt/local/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py", line 239, 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 203, 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 25 column 3 (char 563)
      
      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 279, 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 C.conf: Expecting ',' delimiter: line 25 column 3 (char 563)
      
      2020-11-13 14:53:56.523860 -0500 MAIN (critical) Router start-up failed: Python: Exception: Cannot load configuration file C.conf: Expecting ',' delimiter: line 25 column 3 (char 563)
      qdrouterd: Python: Exception: Cannot load configuration file C.conf: Expecting ',' delimiter: line 25 column 3 (char 563)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            crolke@redhat.com Chuck Rolke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: