crossbario / crossbar

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

ZipArchiveResource: misleading error message in network failure scenarios #1700

Open oberstet opened 4 years ago

oberstet commented 4 years ago

at least sometimes, network connection errors when trying to (the first time) download an archive file hosted as a crossbar webservice of type archive fails with a misleading error message ("fingerprint mismatch"):

2020-02-10T13:01:44+0100 [Router      20041] Site starting on 8080
2020-02-10T13:01:44+0100 [Controller  20030] Ok, Router worker001 has started Transport transport001
2020-02-10T13:01:44+0100 [Controller  20030] Order Transport transport001 to start Web Service webservice001
2020-02-10T13:01:44+0100 [Router      20041] Starting "archive" Web service on path "autobahn" of transport "transport001" <crossbar.worker.router.RouterController.start_web_transport_service>
2020-02-10T13:01:44+0100 [Router      20041] ZipArchiveResource: downloading from "https://github.com/crossbario/autobahn-js-browser/archive/v20.1.1.zip"
2020-02-10T13:01:54+0100 [Router      20041] ZipArchiveResource: file downloaded and cached locally [/home/oberstet/scm/crossbario/xbr-www/test/.crossbar/autobahn-v20.1.1.zip]
2020-02-10T13:01:54+0100 [Router      20041] ExtRouterController.onUserError(): "Exception: archive "/home/oberstet/scm/crossbario/xbr-www/test/.crossbar/autobahn-v20.1.1.zip" does not match any of configured SHA256 fingerprints ['a7e898a6a506c8bffe9a09d7e29b86a8adb90a15859024835df99cc7be82274a']"
Traceback (most recent call last):
  File "/home/oberstet/cpy381_3/lib/python3.8/site-packages/twisted/internet/defer.py", line 501, in errback
    self._startRunCallbacks(fail)
  File "/home/oberstet/cpy381_3/lib/python3.8/site-packages/twisted/internet/defer.py", line 568, in _startRunCallbacks
    self._runCallbacks()
  File "/home/oberstet/cpy381_3/lib/python3.8/site-packages/twisted/internet/defer.py", line 654, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/home/oberstet/cpy381_3/lib/python3.8/site-packages/twisted/internet/defer.py", line 1475, in gotResult
    _inlineCallbacks(r, g, status)
--- <exception caught here> ---
  File "/home/oberstet/cpy381_3/lib/python3.8/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/home/oberstet/cpy381_3/lib/python3.8/site-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/home/oberstet/scm/crossbario/crossbar/crossbar/worker/router.py", line 931, in start_web_transport_service
    webservice = yield maybeDeferred(webservice_factory.create, transport, path, config)
  File "/home/oberstet/cpy381_3/lib/python3.8/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/home/oberstet/scm/crossbario/crossbar/crossbar/webservice/archive.py", line 335, in create
    raise Exception('archive "{}" does not match any of configured SHA256 fingerprints {}'.format(
builtins.Exception: archive "/home/oberstet/scm/crossbario/xbr-www/test/.crossbar/autobahn-v20.1.1.zip" does not match any of configured SHA256 fingerprints ['a7e898a6a506c8bffe9a09d7e29b86a8adb90a15859024835df99cc7be82274a']

2020-02-10T13:01:54+0100 [Controller  20030] Could not start node: Traceback (most recent call last):
--- <exception caught here> ---
  File "/home/oberstet/scm/crossbario/crossbar/crossbar/node/node.py", line 378, in start
    yield self.personality.Node.boot(self)
  File "/home/oberstet/scm/crossbario/crossbarfx/crossbarfx/edge/node/node.py", line 713, in boot
    yield self.boot_from_config(self._config)
  File "/home/oberstet/scm/crossbario/crossbar/crossbar/node/node.py", line 509, in boot_from_config
    yield d
  File "/home/oberstet/scm/crossbario/crossbar/crossbar/node/node.py", line 486, in configure_worker
    yield config_fn(worker_logname, worker_id, worker)
  File "/home/oberstet/scm/crossbario/crossbarfx/crossbarfx/edge/node/node.py", line 839, in _configure_native_worker_router
    yield node.Node._configure_native_worker_router(self, worker_logname, worker_id, worker)
  File "/home/oberstet/scm/crossbario/crossbar/crossbar/node/node.py", line 668, in _configure_native_worker_router
    yield self._controller.call('crossbar.worker.{}.start_web_transport_service'.format(worker_id),
autobahn.wamp.exception.ApplicationError: ApplicationError(error=<wamp.error.runtime_error>, args=['archive "/home/oberstet/scm/crossbario/xbr-www/test/.crossbar/autobahn-v20.1.1.zip" does not match any of configured SHA256 fingerprints [\'a7e898a6a506c8bffe9a09d7e29b86a8adb90a15859024835df99cc7be82274a\']'], kwargs={}, enc_algo=None, callee=None, callee_authid=None, callee_authrole=None, forward_for=None)

2020-02-10T13:01:54+0100 [Controller  20030] sending TERM to subprocess 20041
2020-02-10T13:01:54+0100 [Controller  20030] waiting for 20041 to exit...
2020-02-10T13:01:54+0100 [Router      20041] Native worker received SIGTERM - shutting down ..
2020-02-10T13:01:54+0100 [Router      20041] Shutdown of worker requested!
2020-02-10T13:01:54+0100 [Controller  20030] Router.detach(session=2589837375867615)
2020-02-10T13:01:54+0100 [Controller  20030] Router.detach(session=2589837375867615): detached sessions [2589837375867615] from router realm "crossbar"
2020-02-10T13:01:54+0100 [Router      20041] RouterApplicationSession.close(session=<xbrnetwork._backend.XbrAuthenticator object at 0x7f5049490d60>)
2020-02-10T13:01:54+0100 [Router      20041] stopped component: xbrnetwork._backend.XbrAuthenticator id=8796979441599602
2020-02-10T13:01:54+0100 [Router      20041] component 'component001' disconnected
2020-02-10T13:01:54+0100 [Router      20041] RouterApplicationSession.close(session=<xbrnetwork._backend.XbrAuthenticator object at 0x7f5049490d60>)
2020-02-10T13:01:54+0100 [Router      20041] RouterApplicationSession.close(session=<xbrnetwork._api.XbrNetworkApi object at 0x7f5031c11be0>)
2020-02-10T13:01:54+0100 [Router      20041] stopped component: xbrnetwork._api.XbrNetworkApi id=6963634508461108
2020-02-10T13:01:54+0100 [Router      20041] component 'component002' disconnected
2020-02-10T13:01:54+0100 [Router      20041] RouterApplicationSession.close(session=<xbrnetwork._api.XbrNetworkApi object at 0x7f5031c11be0>)
2020-02-10T13:01:54+0100 [Router      20041] Router.detach(session=8796979441599602)
2020-02-10T13:01:54+0100 [Router      20041] Router.detach(session=8796979441599602): detached sessions [8796979441599602] from router realm "xbr"
2020-02-10T13:01:54+0100 [Router      20041] Router.detach(session=8796979441599602)
2020-02-10T13:01:54+0100 [Router      20041] cannot detach session "8796979441599602": session not currently attached
2020-02-10T13:01:54+0100 [Router      20041] Router.detach(session=6963634508461108)
2020-02-10T13:01:54+0100 [Router      20041] Router.detach(session=6963634508461108): detached sessions [6963634508461108] from router realm "xbr"
2020-02-10T13:01:54+0100 [Router      20041] Router.detach(session=6963634508461108)
2020-02-10T13:01:54+0100 [Router      20041] cannot detach session "6963634508461108": session not currently attached
2020-02-10T13:01:54+0100 [Router      20041] Connection to node controller closed cleanly
2020-02-10T13:01:54+0100 [Router      20041] (TCP Port 8080 Closed)
2020-02-10T13:01:54+0100 [Controller  20030] Native worker connection closed cleanly.
2020-02-10T13:01:54+0100 [Controller  20030] Node worker worker001 ended successfully
2020-02-10T13:01:54+0100 [Controller  20030] Checking for node shutdown: worker_exit_success=True, shutdown_requested=False, node_shutdown_triggers=['shutdown_on_shutdown_requested']
2020-02-10T13:01:54+0100 [Controller  20030] Node will continue to run!
Makefile:182: recipe for target 'run_crossbar_host' failed
make: *** [run_crossbar_host] Error 1
(cpy381_3) oberstet@intel-nuci7:~/scm/crossbario/xbr-www$ 
(cpy381_3) oberstet@intel-nuci7:~/scm/crossbario/xbr-www$ wget https://github.com/crossbario/autobahn-js-browser/archive/v20.1.1.zip
--2020-02-10 13:02:58--  https://github.com/crossbario/autobahn-js-browser/archive/v20.1.1.zip
Auflösen des Hostnamens github.com (github.com) … fehlgeschlagen: Der Name oder der Dienst ist nicht bekannt.
wget: Host-Adresse »github.com« kann nicht aufgelöst werden
(cpy381_3) oberstet@intel-nuci7:~/scm/crossbario/xbr-www$ 
oberstet commented 4 years ago

after fixing network issues and restarting the node, the node will find the archive file with bogus file contents and bail out. after removing the archive file manually, the node will trs to download again - this time successfully.