authentik icon indicating copy to clipboard operation
authentik copied to clipboard

Upgrade 2025.8.2 No workers connected

Open Tealk opened this issue 1 year ago • 36 comments

Describe the bug After the update, I get a message saying that no workers are connected.

To Reproduce Steps to reproduce the behavior:

  1. Update docker version
  2. Execute docker compose up -d

Screenshots Image

Logs Output of docker-compose logs or kubectl logs respectively

Additional context After rolling back to 2025.8.1, there is once again 1 worker available.

Tealk avatar Sep 15 '25 16:09 Tealk

Get the following from worker container after updating:

PermissionError: [Errno 13] Permission denied: '/dev/shm//authentik_prometheus_tmp/counter_7.db'

Probably related: https://github.com/goauthentik/authentik/pull/16401/files

michalkida avatar Sep 15 '25 16:09 michalkida

actually that would be #16735

rissson avatar Sep 15 '25 16:09 rissson

@Tealk is your worker running?

rissson avatar Sep 15 '25 17:09 rissson

ATM im back on 8.1 how can i test the fixes?

Tealk avatar Sep 15 '25 17:09 Tealk

@Tealk is your worker running?

I have the same issue, and mine instantly crash. Here are the logs if needed https://pastebin.com/q16nkCXm

Nonolanlan1007 avatar Sep 15 '25 17:09 Nonolanlan1007

Got the same issue, even the same error log

lightumcc avatar Sep 15 '25 17:09 lightumcc

I have the same issue. Running using docker compose: {"domain_url": null, "event": "releasing database lock", "level": "info", "logger": "lifecycle.migrate", "pid": 7, "schema_name": "public", "timestamp": "2025-09-15T17:05:02.008545"} Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/manage.py", line 24, in run_migrations() ~~~~~~~~~~~~~~^^ File "/lifecycle/migrate.py", line 115, in run_migrations execute_from_command_line(["", "migrate_schemas"]) ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ak-root/.venv/lib/python3.13/site-packages/django/core/management/init.py", line 442, in execute_from_command_line utility.execute() ~~~~~~~~~~~~~~~^^ File "/ak-root/.venv/lib/python3.13/site-packages/django/core/management/init.py", line 436, in execute self.fetch_command(subcommand).run_from_argv(self.argv) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^ File "/ak-root/.venv/lib/python3.13/site-packages/django/core/management/base.py", line 413, in run_from_argv self.execute(*args, **cmd_options) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^ File "/ak-root/.venv/lib/python3.13/site-packages/django/core/management/base.py", line 459, in execute output = self.handle(*args, **options) File "/ak-root/.venv/lib/python3.13/site-packages/django_tenants/management/commands/migrate_schemas.py", line 66, in handle executor.run_migrations(tenants=[self.PUBLIC_SCHEMA_NAME]) ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ak-root/.venv/lib/python3.13/site-packages/django_tenants/migration_executors/standard.py", line 11, in run_migrations run_migrations(self.args, self.options, self.codename, self.PUBLIC_SCHEMA_NAME) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ak-root/.venv/lib/python3.13/site-packages/django_tenants/migration_executors/base.py", line 51, in run_migrations migration_recorder.ensure_schema() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/ak-root/.venv/lib/python3.13/site-packages/django/db/migrations/recorder.py", line 73, in ensure_schema if self.has_table(): ~~~~~~~~~~~~~~^^ File "/ak-root/.venv/lib/python3.13/site-packages/django/db/migrations/recorder.py", line 63, in has_table with self.connection.cursor() as cursor: ~~~~~~~~~~~~~~~~~~~~~~^^ File "/ak-root/.venv/lib/python3.13/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/ak-root/.venv/lib/python3.13/site-packages/django/db/backends/base/base.py", line 319, in cursor return self._cursor() ~~~~~~~~~~~~^^ File "/ak-root/.venv/lib/python3.13/site-packages/django_tenants/postgresql_backend/base.py", line 144, in _cursor cursor = super()._cursor() File "/ak-root/.venv/lib/python3.13/site-packages/django/db/backends/base/base.py", line 295, in _cursor self.ensure_connection() ~~~~~~~~~~~~~~~~~~~~~~^^ File "/ak-root/.venv/lib/python3.13/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/ak-root/.venv/lib/python3.13/site-packages/django/db/backends/base/base.py", line 278, in ensure_connection self.connect() ~~~~~~~~~~~~^^ File "/ak-root/.venv/lib/python3.13/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/ak-root/.venv/lib/python3.13/site-packages/django/db/backends/base/base.py", line 255, in connect self.connection = self.get_new_connection(conn_params) ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^ File "/ak-root/.venv/lib/python3.13/site-packages/django_prometheus/db/backends/postgresql/base.py", line 9, in get_new_connection conn = super().get_new_connection(*args, **kwargs) File "/ak-root/.venv/lib/python3.13/site-packages/django_prometheus/db/common.py", line 43, in get_new_connection connections_total.labels(self.alias, self.vendor).inc() ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ak-root/.venv/lib/python3.13/site-packages/prometheus_client/metrics.py", line 179, in labels self._metrics[labelvalues] = self.class( ~~~~~~~~~~~~~~^ self._name, ^^^^^^^^^^^ ...<4 lines>... **self._kwargs ^^^^^^^^^^^^^^ ) ^ File "/ak-root/.venv/lib/python3.13/site-packages/prometheus_client/metrics.py", line 127, in init self._metric_init() ~~~~~~~~~~~~~~~~~^^ File "/ak-root/.venv/lib/python3.13/site-packages/prometheus_client/metrics.py", line 282, in _metric_init self._value = values.ValueClass(self._type, self._name, self._name + '_total', self._labelnames, ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ self._labelvalues, self._documentation) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/ak-root/.venv/lib/python3.13/site-packages/prometheus_client/values.py", line 68, in init self.__reset() ~~~~~~~~~~~~^^ File "/ak-root/.venv/lib/python3.13/site-packages/prometheus_client/values.py", line 82, in __reset files[file_prefix] = MmapedDict(filename) ~~~~~~~~~~^^^^^^^^^^ File "/ak-root/.venv/lib/python3.13/site-packages/prometheus_client/mmap_dict.py", line 64, in init self._f = open(filename, 'rb' if read_mode else 'a+b') ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied: '/dev/shm//authentik_prometheus_tmp/counter_7.db'

Have currently rolled back to version 8.1

hardiktrivedi0612 avatar Sep 15 '25 17:09 hardiktrivedi0612

I'm a little worried about the rollback approach, he might break some database migrations

lightumcc avatar Sep 15 '25 17:09 lightumcc

I can confirm the very same error on my instances.

Fly7113 avatar Sep 15 '25 17:09 Fly7113

Same error rolled back to 8.1 also and worker now running.

yarafie avatar Sep 15 '25 17:09 yarafie

I can confirm that a rollback from 2025.8.2 to 2025.8.1 is working, no issues so far.

net47 avatar Sep 15 '25 17:09 net47

Same error on my side.

slewantoski avatar Sep 15 '25 18:09 slewantoski

I've downgraded to 2025.8.1 and waiting for 2025.8.3

krom avatar Sep 15 '25 18:09 krom

should be fixable by running as non-root; to do so:

  1. do the permission fix that lifecycle/ak normally does:
sudo chown -R 1000:1000 certs custom-templates media
  1. in the compose file swap out
-    user: root
+    user: "1000:1000"

ember-ana avatar Sep 15 '25 18:09 ember-ana

Came here for the same error with workers, restored instance to previous snapshot of 8.1 (prior to 8.2 upgrade), worker(s) function again.

FDrebin avatar Sep 15 '25 18:09 FDrebin

should be fixable by running as non-root; to do so:

  1. do the permission fix that lifecycle/ak normally does:

sudo chown -R 1000:1000 certs custom-templates media 2. in the compose file swap out

  • user: root
  • user: "1000:1000"

Fixed for me also, running 8.2, couldn't start the worker with root, but 1000 works

StevenMcElligott avatar Sep 15 '25 18:09 StevenMcElligott

should be fixable by running as non-root; to do so:

  1. do the permission fix that lifecycle/ak normally does:

sudo chown -R 1000:1000 certs custom-templates media 2. in the compose file swap out

  • user: root
  • user: "1000:1000"

I think it just makes worker work again, but there's still some problem,s such asthe outspot controller with docker socket

event=Failed to process message authentik.outposts.tasks.outpost_service_connection_monitor(UUID('73504c83-e0b0-42d3-9db2-b2a8b9e932e6')) with unhandled exception. exception=[{"exc_notes":[],"exc_type":"DockerException","exc_value":"Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))","exceptions":[],"frames":[{"filename":"/ak-root/.venv/lib/python3.13/site-packages/dramatiq/worker.py","lineno":487,"name":"process_message"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/dramatiq/actor.py","lineno":185,"name":"__call__"},{"filename":"/authentik/outposts/tasks.py","lineno":100,"name":"outpost_service_connection_monitor"},{"filename":"/authentik/outposts/controllers/docker.py","lineno":43,"name":"__init__"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/client.py","lineno":45,"name":"__init__"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/api/client.py","lineno":207,"name":"__init__"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/api/client.py","lineno":230,"name":"_retrieve_server_version"}],"is_cause":false,"is_group":false,"syntax_error":null},{"exc_notes":[],"exc_type":"ConnectionError","exc_value":"('Connection aborted.', PermissionError(13, 'Permission denied'))","exceptions":[],"frames":[{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/api/client.py","lineno":223,"name":"_retrieve_server_version"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/api/daemon.py","lineno":181,"name":"version"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/utils/decorators.py","lineno":44,"name":"inner"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/api/client.py","lineno":246,"name":"_get"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/requests/sessions.py","lineno":602,"name":"get"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/requests/sessions.py","lineno":589,"name":"request"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/requests/sessions.py","lineno":703,"name":"send"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/requests/adapters.py","lineno":682,"name":"send"}],"is_cause":true,"is_group":false,"syntax_error":null},{"exc_notes":[],"exc_type":"ProtocolError","exc_value":"('Connection aborted.', PermissionError(13, 'Permission denied'))","exceptions":[],"frames":[{"filename":"/ak-root/.venv/lib/python3.13/site-packages/requests/adapters.py","lineno":667,"name":"send"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/connectionpool.py","lineno":841,"name":"urlopen"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/util/retry.py","lineno":474,"name":"increment"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/util/util.py","lineno":38,"name":"reraise"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/connectionpool.py","lineno":787,"name":"urlopen"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/connectionpool.py","lineno":493,"name":"_make_request"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/connection.py","lineno":494,"name":"request"},{"filename":"/usr/local/lib/python3.13/http/client.py","lineno":1333,"name":"endheaders"},{"filename":"/usr/local/lib/python3.13/http/client.py","lineno":1093,"name":"_send_output"},{"filename":"/usr/local/lib/python3.13/http/client.py","lineno":1037,"name":"send"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/transport/unixconn.py","lineno":26,"name":"connect"}],"is_cause":false,"is_group":false,"syntax_error":null},{"exc_notes":[],"exc_type":"PermissionError","exc_value":"[Errno 13] Permission denied","exceptions":[],"frames":[{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/connectionpool.py","lineno":787,"name":"urlopen"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/connectionpool.py","lineno":493,"name":"_make_request"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/connection.py","lineno":494,"name":"request"},{"filename":"/usr/local/lib/python3.13/http/client.py","lineno":1333,"name":"endheaders"},{"filename":"/usr/local/lib/python3.13/http/client.py","lineno":1093,"name":"_send_output"},{"filename":"/usr/local/lib/python3.13/http/client.py","lineno":1037,"name":"send"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/transport/unixconn.py","lineno":26,"name":"connect"}],"is_cause":false,"is_group":false,"syntax_error":null}] logger=dramatiq.worker.WorkerThread timestamp=2025-09-15T19:07:24.121633

lightumcc avatar Sep 15 '25 19:09 lightumcc

Hi,

Impacted as well.

I confirm it works with user 1000 on my deployment.

I think it just makes worker work again, but there's still some problem,s such asthe outspot controller with docker socket

event=..."exc_value":"Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))",

With docker integration, not running root implies the outposts cannot be upgraded, it must be done manually. That's what I observed.

Wr0ngName avatar Sep 15 '25 19:09 Wr0ngName

Hi,

Impacted as well.

I confirm it works with user 1000 on my deployment.

I think it just makes worker work again, but there's still some problem,s such asthe outspot controller with docker socket

event=..."exc_value":"Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))",

With docker integration, not running root implies the outposts cannot be upgraded, it must be done manually. That's what I observed.

That's true, hopefully this issue could be fixed in the upcoming version.

lightumcc avatar Sep 15 '25 19:09 lightumcc

should be fixable by running as non-root; to do so:

  1. do the permission fix that lifecycle/ak normally does:

sudo chown -R 1000:1000 certs custom-templates media 2. in the compose file swap out

  • user: root

  • user: "1000:1000"

I think it just makes worker work again, but there's still some problem,s such asthe outspot controller with docker socket

event=Failed to process message authentik.outposts.tasks.outpost_service_connection_monitor(UUID('73504c83-e0b0-42d3-9db2-b2a8b9e932e6')) with unhandled exception. exception=[{"exc_notes":[],"exc_type":"DockerException","exc_value":"Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))","exceptions":[],"frames":[{"filename":"/ak-root/.venv/lib/python3.13/site-packages/dramatiq/worker.py","lineno":487,"name":"process_message"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/dramatiq/actor.py","lineno":185,"name":"__call__"},{"filename":"/authentik/outposts/tasks.py","lineno":100,"name":"outpost_service_connection_monitor"},{"filename":"/authentik/outposts/controllers/docker.py","lineno":43,"name":"__init__"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/client.py","lineno":45,"name":"__init__"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/api/client.py","lineno":207,"name":"__init__"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/api/client.py","lineno":230,"name":"_retrieve_server_version"}],"is_cause":false,"is_group":false,"syntax_error":null},{"exc_notes":[],"exc_type":"ConnectionError","exc_value":"('Connection aborted.', PermissionError(13, 'Permission denied'))","exceptions":[],"frames":[{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/api/client.py","lineno":223,"name":"_retrieve_server_version"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/api/daemon.py","lineno":181,"name":"version"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/utils/decorators.py","lineno":44,"name":"inner"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/api/client.py","lineno":246,"name":"_get"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/requests/sessions.py","lineno":602,"name":"get"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/requests/sessions.py","lineno":589,"name":"request"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/requests/sessions.py","lineno":703,"name":"send"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/requests/adapters.py","lineno":682,"name":"send"}],"is_cause":true,"is_group":false,"syntax_error":null},{"exc_notes":[],"exc_type":"ProtocolError","exc_value":"('Connection aborted.', PermissionError(13, 'Permission denied'))","exceptions":[],"frames":[{"filename":"/ak-root/.venv/lib/python3.13/site-packages/requests/adapters.py","lineno":667,"name":"send"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/connectionpool.py","lineno":841,"name":"urlopen"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/util/retry.py","lineno":474,"name":"increment"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/util/util.py","lineno":38,"name":"reraise"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/connectionpool.py","lineno":787,"name":"urlopen"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/connectionpool.py","lineno":493,"name":"_make_request"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/connection.py","lineno":494,"name":"request"},{"filename":"/usr/local/lib/python3.13/http/client.py","lineno":1333,"name":"endheaders"},{"filename":"/usr/local/lib/python3.13/http/client.py","lineno":1093,"name":"_send_output"},{"filename":"/usr/local/lib/python3.13/http/client.py","lineno":1037,"name":"send"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/transport/unixconn.py","lineno":26,"name":"connect"}],"is_cause":false,"is_group":false,"syntax_error":null},{"exc_notes":[],"exc_type":"PermissionError","exc_value":"[Errno 13] Permission denied","exceptions":[],"frames":[{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/connectionpool.py","lineno":787,"name":"urlopen"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/connectionpool.py","lineno":493,"name":"_make_request"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/urllib3/connection.py","lineno":494,"name":"request"},{"filename":"/usr/local/lib/python3.13/http/client.py","lineno":1333,"name":"endheaders"},{"filename":"/usr/local/lib/python3.13/http/client.py","lineno":1093,"name":"_send_output"},{"filename":"/usr/local/lib/python3.13/http/client.py","lineno":1037,"name":"send"},{"filename":"/ak-root/.venv/lib/python3.13/site-packages/docker/transport/unixconn.py","lineno":26,"name":"connect"}],"is_cause":false,"is_group":false,"syntax_error":null}] logger=dramatiq.worker.WorkerThread timestamp=2025-09-15T19:07:24.121633

I encountered this issue as well after updating to 2025.8.2. In addition to removing user: root, can you also try adding

group_add:
  - "989" #depending on your docker group id

to the docker compose for worker and see if it fixes the issue? The docker group id can be checked by typing id in terminal and adjust it accordingly.

winstonstwn avatar Sep 15 '25 20:09 winstonstwn