trustlines-protocol / relay

MIT License
8 stars 7 forks source link

Fix relay crash due to wrong logger arguments #583

Closed compojoom closed 3 years ago

compojoom commented 3 years ago

--- Logging error --- Traceback (most recent call last): File "/opt/relay/lib/python3.8/site-packages/flask_sockets.py", line 40, in call handler, values = adapter.match() File "/opt/relay/lib/python3.8/site-packages/werkzeug/routing.py", line 1799, in match raise NotFound() werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.8/logging/init.py", line 1081, in emit msg = self.format(record) File "/usr/lib/python3.8/logging/init.py", line 925, in format return fmt.format(record) File "/usr/lib/python3.8/logging/init.py", line 664, in format record.message = record.getMessage() File "/usr/lib/python3.8/logging/init.py", line 369, in getMessage msg = msg % self.args TypeError: not enough arguments for format string Call stack: File "/opt/relay/lib/python3.8/site-packages/gevent/baseserver.py", line 34, in _handle_and_close_when_done return handle(args_tuple) File "/opt/relay/lib/python3.8/site-packages/gevent/pywsgi.py", line 1577, in handle handler.handle() File "/opt/relay/lib/python3.8/site-packages/gevent/pywsgi.py", line 464, in handle result = self.handle_one_request() File "/opt/relay/lib/python3.8/site-packages/gevent/pywsgi.py", line 694, in handle_one_request self.handle_one_response() File "/opt/relay/lib/python3.8/site-packages/gevent/pywsgi.py", line 999, in handle_one_response self.run_application() File "/opt/relay/lib/python3.8/site-packages/geventwebsocket/handler.py", line 87, in run_application return super(WebSocketHandler, self).run_application() File "/opt/relay/lib/python3.8/site-packages/gevent/pywsgi.py", line 945, in run_application self.result = self.application(self.environ, self.start_response) File "/opt/relay/lib/python3.8/site-packages/sentry_sdk/integrations/flask.py", line 89, in sentry_patched_wsgi_app return SentryWsgiMiddleware(lambda a, kw: old_app(self, *a, *kw))( File "/opt/relay/lib/python3.8/site-packages/sentry_sdk/integrations/wsgi.py", line 122, in call rv = self.app( File "/opt/relay/lib/python3.8/site-packages/sentry_sdk/integrations/flask.py", line 89, in return SentryWsgiMiddleware(lambda a, kw: old_app(self, a, kw))( File "/opt/relay/lib/python3.8/site-packages/flask/app.py", line 2463, in call return self.wsgi_app(environ, start_response) File "/opt/relay/lib/python3.8/site-packages/flask_sockets.py", line 48, in call return self.wsgi_app(environ, start_response) File "/opt/relay/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/opt/relay/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/opt/relay/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functions[rule.endpoint](req.view_args) File "/opt/relay/lib/python3.8/site-packages/flask_restful/init.py", line 468, in wrapper resp = resource(args, kwargs) File "/opt/relay/lib/python3.8/site-packages/flask/views.py", line 89, in view return self.dispatch_request(*args, *kwargs) File "/opt/relay/lib/python3.8/site-packages/flask_restful/init.py", line 583, in dispatch_request resp = meth(args, kwargs) File "/opt/relay/lib/python3.8/site-packages/webargs/core.py", line 459, in wrapper return func(*new_args, *kwargs) File "/opt/relay/lib/python3.8/site-packages/relay/api/resources.py", line 89, in dump_result return schema.dump(wrapped(args, kwargs)) File "/opt/relay/lib/python3.8/site-packages/relay/api/resources.py", line 434, in get return self.trustlines.get_network_events( File "/opt/relay/lib/python3.8/site-packages/relay/relay.py", line 622, in get_network_events events = ethindex_db.get_all_events(from_block=from_block) File "/opt/relay/lib/python3.8/site-packages/relay/ethindex_db/ethindex_db.py", line 400, in get_all_events logger.debug( File "/usr/lib/python3.8/logging/init.py", line 1430, in debug self._log(DEBUG, msg, args, kwargs) File "/opt/relay/lib/python3.8/site-packages/relay/boot.py", line 28, in _log super()._log(level, msg, args, exc_info, extra) File "/usr/lib/python3.8/logging/init.py", line 1585, in _log self.handle(record) File "/usr/lib/python3.8/logging/init.py", line 1595, in handle self.callHandlers(record) File "/opt/relay/lib/python3.8/site-packages/sentry_sdk/integrations/logging.py", line 77, in sentry_patched_callhandlers return old_callhandlers(self, record) Message: 'get_all_events(%s, %s, %s) -> %s rows' Arguments: (0, '0x35c2D7Ec13af15D6ED7a3eb1e5b911E419D9636d', 759) --- Logging error --- Traceback (most recent call last): File "/opt/relay/lib/python3.8/site-packages/flask_sockets.py", line 40, in call handler, values = adapter.match() File "/opt/relay/lib/python3.8/site-packages/werkzeug/routing.py", line 1799, in match raise NotFound() werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.8/logging/init.py", line 1081, in emit msg = self.format(record) File "/usr/lib/python3.8/logging/init.py", line 925, in format return fmt.format(record) File "/usr/lib/python3.8/logging/init.py", line 664, in format record.message = record.getMessage() File "/usr/lib/python3.8/logging/init.py", line 369, in getMessage msg = msg % self.args TypeError: not enough arguments for format string Call stack: File "/opt/relay/lib/python3.8/site-packages/gevent/baseserver.py", line 34, in _handle_and_close_when_done return handle(args_tuple) File "/opt/relay/lib/python3.8/site-packages/gevent/pywsgi.py", line 1577, in handle handler.handle() File "/opt/relay/lib/python3.8/site-packages/gevent/pywsgi.py", line 464, in handle result = self.handle_one_request() File "/opt/relay/lib/python3.8/site-packages/gevent/pywsgi.py", line 694, in handle_one_request self.handle_one_response() File "/opt/relay/lib/python3.8/site-packages/gevent/pywsgi.py", line 999, in handle_one_response self.run_application() File "/opt/relay/lib/python3.8/site-packages/geventwebsocket/handler.py", line 87, in run_application return super(WebSocketHandler, self).run_application() File "/opt/relay/lib/python3.8/site-packages/gevent/pywsgi.py", line 945, in run_application self.result = self.application(self.environ, self.start_response) File "/opt/relay/lib/python3.8/site-packages/sentry_sdk/integrations/flask.py", line 89, in sentry_patched_wsgi_app return SentryWsgiMiddleware(lambda a, kw: old_app(self, *a, *kw))( File "/opt/relay/lib/python3.8/site-packages/sentry_sdk/integrations/wsgi.py", line 122, in call rv = self.app( File "/opt/relay/lib/python3.8/site-packages/sentry_sdk/integrations/flask.py", line 89, in return SentryWsgiMiddleware(lambda a, kw: old_app(self, a, kw))( File "/opt/relay/lib/python3.8/site-packages/flask/app.py", line 2463, in call return self.wsgi_app(environ, start_response) File "/opt/relay/lib/python3.8/site-packages/flask_sockets.py", line 48, in call return self.wsgi_app(environ, start_response) File "/opt/relay/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/opt/relay/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/opt/relay/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functions[rule.endpoint](req.view_args) File "/opt/relay/lib/python3.8/site-packages/flask_restful/init.py", line 468, in wrapper resp = resource(args, **kwargs)

codecov[bot] commented 3 years ago

Codecov Report

Merging #583 (0d18df1) into master (2a807de) will increase coverage by 0.29%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #583      +/-   ##
==========================================
+ Coverage   85.70%   85.99%   +0.29%     
==========================================
  Files          56       56              
  Lines        4799     4799              
==========================================
+ Hits         4113     4127      +14     
+ Misses        686      672      -14     
Impacted Files Coverage Δ
src/relay/ethindex_db/ethindex_db.py 85.65% <ø> (ø)
src/relay/api/tokens/resources.py 81.25% <0.00%> (-4.17%) :arrow_down:
src/relay/api/resources.py 88.22% <0.00%> (+0.44%) :arrow_up:
src/relay/blockchain/delegate.py 90.74% <0.00%> (+0.92%) :arrow_up:
src/relay/relay.py 77.01% <0.00%> (+2.62%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2a807de...0d18df1. Read the comment docs.