During the upgrade from 9.1.2 the snuba consumer pod on our Kubernetes Deployment (bare metal, converted docker-compose.yaml via ‘kompose’) keeps crashing after a few hours during the upgrade process:
2021-02-06 14:34:46,616 New partitions assigned: {Partition(topic=Topic(name='events'), index=0): 163127}
2021-02-06 14:34:46,863 Caught KeyError('received'), shutting down...
Traceback (most recent call last):
File "/usr/local/bin/snuba", line 33, in <module>
sys.exit(load_entry_point('snuba', 'console_scripts', 'snuba')())
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/src/snuba/snuba/cli/consumer.py", line 161, in consumer
consumer.run()
File "/usr/src/snuba/snuba/utils/streams/processing/processor.py", line 109, in run
self._run_once()
File "/usr/src/snuba/snuba/utils/streams/processing/processor.py", line 147, in _run_once
self.__processing_strategy.submit(self.__message)
File "/usr/src/snuba/snuba/utils/streams/processing/strategies/streaming/transform.py", line 64, in submit
self.__transform_function(message),
File "/usr/src/snuba/snuba/consumer.py", line 253, in process_message
result = processor.process_message(
File "/usr/src/snuba/snuba/datasets/events_processor_base.py", line 154, in process_message
row = self.process_insert(event, metadata)
File "/usr/src/snuba/snuba/datasets/events_processor_base.py", line 189, in process_insert
self.extract_common(processed, event, metadata)
File "/usr/src/snuba/snuba/datasets/events_processor_base.py", line 230, in extract_common
received = _collapse_uint32(int(data["received"]))
KeyError: 'received'
The upgrade finished after a few hours - so far succesfully, but the snuba consumer pod does’nt start up anymore - keeps crashing with the same error.
Sentry Version we are using is:
sentry, version 21.2.0.dev0 (718fa19bc161)
(had an issue with an unhandled exception during the upgrade - Error importing events during upgrade from 9.1.2 to 20.11 (and up) - #9 by BYK)