Open konradmoesch opened 4 months ago
I ran into this yesterday as well. I discussed with @BeryJu in Discord and we think there's a bug with how Authentik bootstraps the system & default Blueprints
The local database records all issues with system tasks in the authentik_events_systemtask
table, and I was able to pull out a few notable errors (attached below).
The most common error is [ErrorDetail(string='Invalid pk \"1476efb9-e3a0-4116-a0d6-f89167ab54a6\" - object does not exist.', code='does_not_exist')
which points me to an issue during Importer.apply()
🤔
akadmin
This is one of the many blueprints that failed to import. Error below is for the default-out-of-box-experience
flow
I have this problem as well, and have tracked down the commit that introduced it using git bisect
and a test case:
https://github.com/goauthentik/authentik/commit/a5467c6e1997e3d6bd4ee81748411cd4b870ce0e
We still haven't figured out why this particular commit caused it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
this is still occuring for me, so still relevant
I'm not really sure what could cause this, especially since this happens in development setups (sometimes), but also on compose setups (sometimes).
In development setups the initial suspicion was related to the commit @kensternberg-authentik mentioned above, and that a request gets mis-routed and hence the validation kicks in, but in development both primary and replica are the exact same postgres instance.
We’re experiencing the same issue. As part of my work, I’m supposed to develop a feature that requires the Authentic development environment. I followed the steps outlined in the documentation. After resolving a dependency issue, I was able to install everything according to the guide. I also connected directly to the database and observed that the relevant flows were not initialized, meaning, as previously suspected, that the bootstrapping doesn’t appear to be working correctly. I tried the whole process several times and always got the same result. When I start the server with ak server, everything appears to launch correctly, but I encounter the same 404 errors as others have mentioned above. Interestingly, this doesn’t happen with the docker-compose.yml in the main directory; it only occurs when I use the compose file found in the scripts folder.
Do you have any suggestions on how to handle this? Constantly rebuilding the container locally to develop doesn’t seem very efficient.
Applying blueprints manually might resolve that issue, but I'm not entirely sure. See ak apply_blueprint --help
if you want to try it
Same here. Additionaly, I can find only this error:
{
"error": "authentik starting",
"event": "failed to proxy to backend",
"level": "warning",
"logger": "authentik.router",
"timestamp": "2024-11-12T15:38:16Z"
}
this is my nginx config
map $http_upgrade $connection_upgrade_keepalive {
default upgrade;
'' '';
}
server {
listen 80;
server_name auth.local;
error_page 502 /502.html;
location /502.html {
root /opt/homebrew/etc/nginx/servers/html;
}
location / {
proxy_pass http://localhost:4005;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade_keepalive;
}
}
and docker compose
services:
authentik-dev:
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2024.10.1}
restart: unless-stopped
command: server
environment:
AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_REDIS__DB: 0
AUTHENTIK_POSTGRESQL__HOST: postgres
AUTHENTIK_POSTGRESQL__USER: postgres
AUTHENTIK_POSTGRESQL__NAME: auth
AUTHENTIK_POSTGRESQL__PASSWORD: postgres_password
volumes:
- ./.docker-data/media:/media
- ./.docker-data/custom-templates:/templates
env_file:
- .env
ports:
- "${COMPOSE_PORT_HTTP:-9000}:9000"
- "${COMPOSE_PORT_HTTPS:-9443}:9443"
networks:
- global
extra_hosts:
- "host.docker.internal:host-gateway"
authentik-worker-dev:
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2024.10.1}
restart: unless-stopped
command: worker
environment:
AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_REDIS__DB: 0
AUTHENTIK_POSTGRESQL__HOST: postgres
AUTHENTIK_POSTGRESQL__USER: postgres
AUTHENTIK_POSTGRESQL__NAME: postgres
AUTHENTIK_POSTGRESQL__PASSWORD: postgres_password
# `user: root` and the docker socket volume are optional.
# See more for the docker socket integration here:
# https://goauthentik.io/docs/outposts/integrations/docker
# Removing `user: root` also prevents the worker from fixing the permissions
# on the mounted folders, so when removing this make sure the folders have the correct UID/GID
# (1000:1000 by default)
user: root
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./.docker-data/media:/media
- ./.docker-data/certs:/certs
- ./.docker-data/custom-templates:/templates
env_file:
- .env
networks:
- global
networks:
global:
name: global
external: true
ak apply_blueprint --help
That did not help. But I fixed my issue. The reason why this happens...Don't really know. My blueprints/defaults files where overwritten and empty. What I did was resetting the main branch to remote, deleting all dev Docker Container I already had, deleted my poetry virtual env and started from the beginning to setup the dev env with the documentation. Now it works....don't ask me what went wrong.
Describe the bug I have set up a development environment of authentik as described in the docs (https://docs.goauthentik.io/developer-docs/setup/full-dev-environment). After pulling the
main
branch and following the instructions, I get various 404 errors:Page not found (404) No Flow matches the given query.
Request Method: GET Request URL: http://localhost:9000/flows/-/default/authentication/?next=/ raised by: authentik.flows.views.executor.ToDefaultFlow