crossbario / crossbar

Crossbar.io - WAMP application router
https://crossbar.io/
Other
2.05k stars 274 forks source link

master node fails to start while merging lists #1887

Closed om26er closed 2 years ago

om26er commented 3 years ago

Running the command crossbar master start fail with the below error. However if used with the exact config available here https://github.com/crossbario/crossbar/blob/master/crossbar/master/node/config.json it starts fine.

2021-08-03T03:35:45+0500 [Controller 238438] 
2021-08-03T03:35:45+0500 [Controller 238438]     :::::::::::::::::
2021-08-03T03:35:45+0500 [Controller 238438]           :::::          _____                 __              _____  __
2021-08-03T03:35:45+0500 [Controller 238438]     :::::   :   :::::   / ___/______  ___ ___ / /  ___ _____  / __/ |/_/
2021-08-03T03:35:45+0500 [Controller 238438]     :::::::   :::::::  / /__/ __/ _ \(_-<(_-</ _ \/ _ `/ __/ / _/_>  <
2021-08-03T03:35:45+0500 [Controller 238438]     :::::   :   :::::  \___/_/  \___/___/___/_.__/\_,_/_/   /_/ /_/|_|
2021-08-03T03:35:45+0500 [Controller 238438]           :::::
2021-08-03T03:35:45+0500 [Controller 238438]     :::::::::::::::::   Crossbar.io FX v21.6.1.dev1 [19000101-0000000]
2021-08-03T03:35:45+0500 [Controller 238438] 
2021-08-03T03:35:45+0500 [Controller 238438]     Copyright (c) 2013-2021 Crossbar.io Technologies GmbH. All rights reserved.
2021-08-03T03:35:45+0500 [Controller 238438] 
2021-08-03T03:35:45+0500 [Controller 238438] Booting master node .. <crossbar.node.main._run_command_start>
2021-08-03T03:35:45+0500 [Controller 238438] Node key files exist and are valid. Node public key is 0xf24b4e22f449e0ad14a17936ac58f53534ed5cb0427b9d1fc6e2a05797e9b982
2021-08-03T03:35:45+0500 [Controller 238438] Node key loaded from /home/om26er/scm/crossbario/markhor/online-services/.crossbar/key.priv
2021-08-03T03:35:45+0500 [Controller 238438] Expanding built-in node configuration from local file /home/om26er/scm/crossbario/markhor/online-services/.crossbar/config.json
2021-08-03T03:35:45+0500 [Controller 238438] Traceback (most recent call last):
2021-08-03T03:35:45+0500 [Controller 238438]   File "/home/om26er/scm/crossbario/crossbar/venv/bin/crossbar", line 33, in <module>
2021-08-03T03:35:45+0500 [Controller 238438]     sys.exit(load_entry_point('crossbar', 'console_scripts', 'crossbar')())
2021-08-03T03:35:45+0500 [Controller 238438]   File "/home/om26er/scm/crossbario/crossbar/crossbar/__init__.py", line 303, in run
2021-08-03T03:35:45+0500 [Controller 238438]     sys.exit(main(executable, args, reactor, personality))
2021-08-03T03:35:45+0500 [Controller 238438]   File "/home/om26er/scm/crossbario/crossbar/crossbar/node/main.py", line 1273, in main
2021-08-03T03:35:45+0500 [Controller 238438]     options.func(options, reactor=reactor, personality=personality)
2021-08-03T03:35:45+0500 [Controller 238438]   File "/home/om26er/scm/crossbario/crossbar/crossbar/node/main.py", line 804, in _run_command_start
2021-08-03T03:35:45+0500 [Controller 238438]     config_source, config_path = node.load_config(options.config)
2021-08-03T03:35:45+0500 [Controller 238438]   File "/home/om26er/scm/crossbario/crossbar/crossbar/master/node/node.py", line 524, in load_config
2021-08-03T03:35:45+0500 [Controller 238438]     config = merge_config(config, custom_config)
2021-08-03T03:35:45+0500 [Controller 238438]   File "/home/om26er/scm/crossbario/crossbar/crossbar/_util.py", line 416, in merge_config
2021-08-03T03:35:45+0500 [Controller 238438]     merged_config['workers'] = _deep_merge_list(base_config.get('workers', []), other_config['workers'])
2021-08-03T03:35:45+0500 [Controller 238438]   File "/home/om26er/scm/crossbario/crossbar/crossbar/_util.py", line 371, in _deep_merge_list
2021-08-03T03:35:45+0500 [Controller 238438]     new_list.append(_deep_merge_object(a[i], item))
2021-08-03T03:35:45+0500 [Controller 238438]   File "/home/om26er/scm/crossbario/crossbar/crossbar/_util.py", line 390, in _deep_merge_object
2021-08-03T03:35:45+0500 [Controller 238438]     return _deep_merge_map(a, b)
2021-08-03T03:35:45+0500 [Controller 238438]   File "/home/om26er/scm/crossbario/crossbar/crossbar/_util.py", line 330, in _deep_merge_map
2021-08-03T03:35:45+0500 [Controller 238438]     new_map[k] = _deep_merge_list(new_map[k], v)
2021-08-03T03:35:45+0500 [Controller 238438]   File "/home/om26er/scm/crossbario/crossbar/crossbar/_util.py", line 371, in _deep_merge_list
2021-08-03T03:35:45+0500 [Controller 238438]     new_list.append(_deep_merge_object(a[i], item))
2021-08-03T03:35:45+0500 [Controller 238438]   File "/home/om26er/scm/crossbario/crossbar/crossbar/_util.py", line 390, in _deep_merge_object
2021-08-03T03:35:45+0500 [Controller 238438]     return _deep_merge_map(a, b)
2021-08-03T03:35:45+0500 [Controller 238438]   File "/home/om26er/scm/crossbario/crossbar/crossbar/_util.py", line 330, in _deep_merge_map
2021-08-03T03:35:45+0500 [Controller 238438]     new_map[k] = _deep_merge_list(new_map[k], v)
2021-08-03T03:35:45+0500 [Controller 238438]   File "/home/om26er/scm/crossbario/crossbar/crossbar/_util.py", line 353, in _deep_merge_list
2021-08-03T03:35:45+0500 [Controller 238438]     assert len(b) >= len(a)
2021-08-03T03:35:45+0500 [Controller 238438] AssertionError
om26er commented 3 years ago

The error can be reproduced with this config (had pasted this config in the wrong issue)

{
    "version": 2,
    "controller": {
        "id": "center1"
    },
    "workers": [
        {
            "id": "cfrouter1",
            "type": "router",
            "options": {
                "expose_controller": true
            },
            "realms": [
                {
                    "name": "com.crossbario.fabric",
                    "roles": [
                        {
                            "name": "authenticator",
                            "permissions": [
                                {
                                    "uri": "com.crossbario.fabric.authenticate",
                                    "match": "exact",
                                    "allow": {
                                        "call": true,
                                        "register": true
                                    }
                                },
                                {
                                    "uri": "crossbarfabriccenter.node.",
                                    "match": "prefix",
                                    "allow": {
                                        "subscribe": true
                                    }
                                },
                                {
                                    "uri": "crossbarfabriccenter.mrealm.",
                                    "match": "prefix",
                                    "allow": {
                                        "subscribe": true
                                    }
                                }
                            ]
                        }
                    ]
                }
            ],
            "transports": [
                {
                    "type": "rawsocket",
                    "serializers": ["cbor"],
                    "endpoint": {
                        "type": "unix",
                        "path": "sock1"
                    },
                    "options": {
                        "max_message_size": 1048576
                    },
                    "auth": {
                        "anonymous": {
                            "type": "static",
                            "role": "trusted"
                        }
                    }
                },
                {
                    "type": "rawsocket",
                    "serializers": ["cbor"],
                    "endpoint": {
                        "type": "unix",
                        "path": "sock2"
                    },
                    "options": {
                        "max_message_size": 1048576
                    },
                    "auth": {
                        "anonymous": {
                            "type": "static",
                            "role": "user",
                            "authid": "superuser"
                        }
                    }
                },
                {
                    "type": "web",
                    "endpoint": {
                        "type": "tcp",
                        "port": 9000
                    },
                    "paths": {
                        "/": {
                            "type": "nodeinfo"
                        },
                        "ws": {
                            "type": "websocket",
                            "serializers": [
                                "cbor", "msgpack", "json"
                            ],
                            "auth": {
                                "anonymous": {
                                    "type": "static",
                                    "role": "public"
                                },
                                "cryptosign": {
                                    "type": "dynamic",
                                    "authenticator": "com.crossbario.fabric.authenticate",
                                    "authenticator-realm": "com.crossbario.fabric",
                                    "authenticator-role": "authenticator"
                                }
                           }
                        }
                    }
                }
            ],
            "components": [
                {
                    "type": "class",
                    "classname": "crossbar.master.node.authenticator.Authenticator",
                    "realm": "com.crossbario.fabric",
                    "role": "authenticator",
                    "extra": {
                        "mailgun": {
                            "submit_url": "https://api.mailgun.net/v3/mailing.crossbar.io/messages",
                            "access_key": null
                        }
                    }
                }
            ]
        },
        {
            "id": "cfrealmmanager1",
            "type": "container",
            "options": {
                "pythonpath": [".."],
                "expose_shared": true,
                "expose_controller": true,
                "restart": "restart-always",
                "shutdown": "shutdown-manual"
            },
            "components": [
                {
                    "type": "class",
                    "classname": "crossbar.master.node.DomainController",
                    "realm": "com.crossbario.fabric",
                    "transport": {
                        "type": "rawsocket",
                        "serializer": "cbor",
                        "endpoint": {
                           "type": "unix",
                           "path": "sock1"
                        },
                        "options": {
                            "max_message_size": 1048576
                        }
                    }
                }
            ]
        }
    ]
}
oberstet commented 2 years ago

duplicate of https://github.com/crossbario/crossbar/issues/1885