Page MenuHomeSoftware Heritage

workers with multiple loaders do not send their report to sentry (high priority, future add-forge-now workers...)
Closed, MigratedEdits Locked

Description

A naive setup had been made to forward to the project highpriority in sentry the issues.
But it's not working [1] because swh.loader.highpriority is actually not a python module.

We need to change our sentry management code to actually route issues per loader type.
That's a need which is valid for highpriority messages (save code now) and for the future add forge now
messages (which should work in similar way)

[1]

Sep 08 11:17:38 worker01 python3[2165714]: Traceback (most recent call last):
Sep 08 11:17:38 worker01 python3[2165714]:   File "/usr/lib/python3/dist-packages/swh/scheduler/celery_backend/config.py", line 53, in newf
Sep 08 11:17:38 worker01 python3[2165714]:     return f(*args, **kwargs)
Sep 08 11:17:38 worker01 python3[2165714]:   File "/usr/lib/python3/dist-packages/swh/scheduler/celery_backend/config.py", line 167, in on_worker_init
Sep 08 11:17:38 worker01 python3[2165714]:     init_sentry(sentry_dsn, integrations=integrations)
Sep 08 11:17:38 worker01 python3[2165714]:   File "/usr/lib/python3/dist-packages/swh/core/sentry.py", line 88, in init_sentry
Sep 08 11:17:38 worker01 python3[2165714]:     release=get_sentry_release(),
Sep 08 11:17:38 worker01 python3[2165714]:   File "/usr/lib/python3/dist-packages/swh/core/sentry.py", line 18, in get_sentry_release
Sep 08 11:17:38 worker01 python3[2165714]:     version = pkg_resources.get_distribution(main_package).version
Sep 08 11:17:38 worker01 python3[2165714]:   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 466, in get_distribution
Sep 08 11:17:38 worker01 python3[2165714]:     dist = get_provider(dist)
Sep 08 11:17:38 worker01 python3[2165714]:   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 342, in get_provider
Sep 08 11:17:38 worker01 python3[2165714]:     return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
Sep 08 11:17:38 worker01 python3[2165714]:   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 886, in require
Sep 08 11:17:38 worker01 python3[2165714]:     needed = self.resolve(parse_requirements(requirements))
Sep 08 11:17:38 worker01 python3[2165714]:   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 772, in resolve
Sep 08 11:17:38 worker01 python3[2165714]:     raise DistributionNotFound(req, requirers)
Sep 08 11:17:38 worker01 python3[2165714]: pkg_resources.DistributionNotFound: The 'swh.loader.highpriority' distribution was not found and is required by the application