vicalloy / outline-docker-compose

Install a self-hosted Outline wiki instance in a couple of minutes
BSD 3-Clause "New" or "Revised" License
738 stars 120 forks source link

Error authenticating using OIDC #45

Closed 50bbx closed 1 year ago

50bbx commented 1 year ago

Hello,

I managed to start this docker-compose project once, but then it stopped working. I was able to start all the containers (even if the depends_on feature is not respected, as PG takes quite some time to spin, but the container wk-outline is already running by then) but I have an issue when logging a user using OIDC.

I am running docker-compose locally.

I can have a hint of the problem by looking at the wk-outline Docker image logs:

{
   "error":"Failed to obtain access token",
   "stack":"InternalOAuthError: Failed to obtain access token\n    at OAuth2Strategy._createOAuthError (/opt/outline/node_modules/passport-oauth2/lib/strategy.js:423:17)\n    at /opt/outline/node_modules/passport-oauth2/lib/strategy.js:177:45\n    at /opt/outline/node_modules/oauth/lib/oauth2.js:191:18\n    at passBackControl (/opt/outline/node_modules/oauth/lib/oauth2.js:132:9)\n    at IncomingMessage.<anonymous> (/opt/outline/node_modules/oauth/lib/oauth2.js:157:7)\n    at IncomingMessage.emit (node:events:538:35)\n    at IncomingMessage.emit (node:domain:475:12)\n    at endReadableNT (node:internal/streams/readable:1345:12)\n    at processTicksAndRejections (node:internal/process/task_queues:83:21)",
   "level":"error",
   "message":"Error during authentication"
}

This happens after creating a root user with a mycompany.com email and with ALLOWED_DOMAINS=mycompany.com inside config.sh

My custom config is pretty straighforward, I didn't chage a thing:

# The url used to vist this web site.
URL=http://127.0.0.1:8888
# The default interface language. See translate.getoutline.com for a list of
# available language codes and their rough percentage translated.
DEFAULT_LANGUAGE=en_US
# https://docs.djangoproject.com/en/2.2/ref/settings/#language-code
LANGUAGE_CODE=en-us
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TIME_ZONE=UTC
FORCE_HTTPS=false
# The domain in you email.
# Comma separated list of domains to be allowed (optional).
# If not set, the first user's domain is allowed by default.
ALLOWED_DOMAINS=mycompany.com

# Docker image version
OUTLINE_VERSION=0.66.3
POSTGRES_VERSION=14.4-alpine3.16

# Nginx
# The nginx bind ip and port.
# If you use ip address to access outline, this ip and port should be same as the URL.
# If this server behind a proxy(nginx), you can bind to `127.0.0.1`.
HTTP_IP=127.0.0.1
HTTP_PORT_IP=8888

# Docker
# If you server behind a proxy(nginx), and the proxy created by docker. You can use the proxy's network. Set the `NETWORKS` to proxy's network name, and set `NETWORKS_EXTERNAL` to `true` .
# The sample config for host nginx can be find in `config/sample/nginx_outline.conf`.
NETWORKS=outlinewiki
NETWORKS_EXTERNAL=false

# Secret keys, update by script.
# You shouldn't edit it.
MINIO_ACCESS_KEY=XXXX
MINIO_SECRET_KEY=XXXX
OIDC_CLIENT_SECRET=XXXX
OUTLINE_SECRET_KEY=XXXX
OUTLINE_UTILS_SECRET=XXXX
DJANGO_SECRET_KEY=XXXX

Has anyone the same issue?

50bbx commented 1 year ago

I solved my issue. I observed that most of the issues are caused by race conditions: a docker container is not running when another one needs it. In these case, during the make install phase, this error appeared:

Something goes wrong: no such table: oidc_provider_rsakey

I aborted the install and run make install again, this time with every docker container already on.