Unable to login to oauth after some time. #3264

Closed
opened 2026-02-05 08:07:32 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @DanTulovsky on GitHub (May 25, 2024).

The bug

I have oauth working properly, it goes via cloudflare (which uses google accounts). No issues. Every once in a while, on a new computer where I need to login, it doesn't work.

I get the login screen, I click the button to try to login, and it eventually times out. The server logs show:

[Nest] 6  - 05/24/2024, 9:41:40 PM   ERROR [ImmichServer] [AuthService] Error in OAuth discovery: RPError: outgoing request timed out after 30000ms
[Nest] 6  - 05/24/2024, 9:41:40 PM   ERROR [ImmichServer] [AuthService] RPError: outgoing request timed out after 30000ms
    at /usr/src/app/node_modules/openid-client/lib/helpers/request.js:140:13
    at async Issuer.discover (/usr/src/app/node_modules/openid-client/lib/issuer.js:143:22)
    at async AuthService.getOAuthClient (/usr/src/app/dist/services/auth.service.js:245:28)
    at async AuthService.authorize (/usr/src/app/dist/services/auth.service.js:144:24)
[Nest] 6  - 05/24/2024, 9:41:45 PM     LOG [ImmichServer] [EventRepository] Websocket Connect:    iMU3QKmyUzdT3sKVAACR
[Nest] 6  - 05/24/2024, 9:41:58 PM     LOG [ImmichServer] [EventRepository] Websocket Disconnect: iMU3QKmyUzdT3sKVAACR

If I restart immich (I use docker compose) then I can immediately login again. I use a cloudflare tunnel to access the server (on a raspberry pi) remotely. I suspect something is running out of some resource, but I am not sure where to look. Next time this happens, what would be useful debug information to provide you with?

Thank you
Dan

The OS that Immich Server is running on

Debian 12 (piOS)

Version of Immich Server

v1.105.1

Version of Immich Mobile App

v1.105.1

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich


services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: ['start.sh', 'immich']
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
      - ${EXTERNAL_PATH}:/usr/src/app/external
    env_file:
      - .env
    ports:
      - 2283:3001
      - 8081:8081
    depends_on:
      - redis
      - database
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    command: ['start.sh', 'microservices']
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
      - ${EXTERNAL_PATH}:/usr/src/app/external
    env_file:
      - .env
    ports:
      - 8082:8081
    depends_on:
      - redis
      - database
    restart: always
    deploy:
      resources:
        limits:
          # Number of CPU threads
          cpus: '1.00'
          # Gigabytes of memory
          # memory: '1G'

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always
    deploy:
      resources:
        limits:
          # Number of CPU threads
          cpus: '1.00'
          # Gigabytes of memory
          # memory: '1G'

  redis:
    container_name: immich_redis
    image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:51d6c56749a4243096327e3fb964a48ed92254357108449cb6e23999c37773c5
    restart: always

  database:
    container_name: immich_postgres
    image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always
    ports:
      - 5432:5432

volumes:
  pgdata:
  model-cache:

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=./library

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=v1.105.1

# Connection secret for postgres. You should change it to a random password
DB_PASSWORD=postgres

EXTERNAL_PATH=/home/dant/dropbox/Photos/

IMMICH_METRICS=true

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis

Reproduction steps

I cannot trigger it reliably.

Relevant log output

[Nest] 6  - 05/24/2024, 9:41:40 PM   ERROR [ImmichServer] [AuthService] Error in OAuth discovery: RPError: outgoing request timed out after 30000ms
[Nest] 6  - 05/24/2024, 9:41:40 PM   ERROR [ImmichServer] [AuthService] RPError: outgoing request timed out after 30000ms
    at /usr/src/app/node_modules/openid-client/lib/helpers/request.js:140:13
    at async Issuer.discover (/usr/src/app/node_modules/openid-client/lib/issuer.js:143:22)
    at async AuthService.getOAuthClient (/usr/src/app/dist/services/auth.service.js:245:28)
    at async AuthService.authorize (/usr/src/app/dist/services/auth.service.js:144:24)
[Nest] 6  - 05/24/2024, 9:41:45 PM     LOG [ImmichServer] [EventRepository] Websocket Connect:    iMU3QKmyUzdT3sKVAACR
[Nest] 6  - 05/24/2024, 9:41:58 PM     LOG [ImmichServer] [EventRepository] Websocket Disconnect: iMU3QKmyUzdT3sKVAACR


### Additional information

_No response_
Originally created by @DanTulovsky on GitHub (May 25, 2024). ### The bug I have oauth working properly, it goes via cloudflare (which uses google accounts). No issues. Every once in a while, on a new computer where I need to login, it doesn't work. I get the login screen, I click the button to try to login, and it eventually times out. The server logs show: ``` [Nest] 6 - 05/24/2024, 9:41:40 PM ERROR [ImmichServer] [AuthService] Error in OAuth discovery: RPError: outgoing request timed out after 30000ms [Nest] 6 - 05/24/2024, 9:41:40 PM ERROR [ImmichServer] [AuthService] RPError: outgoing request timed out after 30000ms at /usr/src/app/node_modules/openid-client/lib/helpers/request.js:140:13 at async Issuer.discover (/usr/src/app/node_modules/openid-client/lib/issuer.js:143:22) at async AuthService.getOAuthClient (/usr/src/app/dist/services/auth.service.js:245:28) at async AuthService.authorize (/usr/src/app/dist/services/auth.service.js:144:24) [Nest] 6 - 05/24/2024, 9:41:45 PM LOG [ImmichServer] [EventRepository] Websocket Connect: iMU3QKmyUzdT3sKVAACR [Nest] 6 - 05/24/2024, 9:41:58 PM LOG [ImmichServer] [EventRepository] Websocket Disconnect: iMU3QKmyUzdT3sKVAACR ``` If I restart immich (I use docker compose) then I can immediately login again. I use a cloudflare tunnel to access the server (on a raspberry pi) remotely. I suspect something is running out of some resource, but I am not sure where to look. Next time this happens, what would be useful debug information to provide you with? Thank you Dan ### The OS that Immich Server is running on Debian 12 (piOS) ### Version of Immich Server v1.105.1 ### Version of Immich Mobile App v1.105.1 ### Platform with the issue - [ ] Server - [X] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML # # WARNING: Make sure to use the docker-compose.yml of the current release: # # https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml # # The compose file on main may not be compatible with the latest release. # name: immich services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} command: ['start.sh', 'immich'] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro - ${EXTERNAL_PATH}:/usr/src/app/external env_file: - .env ports: - 2283:3001 - 8081:8081 depends_on: - redis - database restart: always immich-microservices: container_name: immich_microservices image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding # file: hwaccel.transcoding.yml # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding command: ['start.sh', 'microservices'] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro - ${EXTERNAL_PATH}:/usr/src/app/external env_file: - .env ports: - 8082:8081 depends_on: - redis - database restart: always deploy: resources: limits: # Number of CPU threads cpus: '1.00' # Gigabytes of memory # memory: '1G' immich-machine-learning: container_name: immich_machine_learning # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag. # Example tag: ${IMMICH_VERSION:-release}-cuda image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration # file: hwaccel.ml.yml # service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable volumes: - model-cache:/cache env_file: - .env restart: always deploy: resources: limits: # Number of CPU threads cpus: '1.00' # Gigabytes of memory # memory: '1G' redis: container_name: immich_redis image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:51d6c56749a4243096327e3fb964a48ed92254357108449cb6e23999c37773c5 restart: always database: container_name: immich_postgres image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - pgdata:/var/lib/postgresql/data restart: always ports: - 5432:5432 volumes: pgdata: model-cache: ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=./library # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=v1.105.1 # Connection secret for postgres. You should change it to a random password DB_PASSWORD=postgres EXTERNAL_PATH=/home/dant/dropbox/Photos/ IMMICH_METRICS=true # The values below this line do not need to be changed ################################################################################### DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich_redis ``` ### Reproduction steps ```bash I cannot trigger it reliably. ``` ### Relevant log output ```shell [Nest] 6 - 05/24/2024, 9:41:40 PM ERROR [ImmichServer] [AuthService] Error in OAuth discovery: RPError: outgoing request timed out after 30000ms [Nest] 6 - 05/24/2024, 9:41:40 PM ERROR [ImmichServer] [AuthService] RPError: outgoing request timed out after 30000ms at /usr/src/app/node_modules/openid-client/lib/helpers/request.js:140:13 at async Issuer.discover (/usr/src/app/node_modules/openid-client/lib/issuer.js:143:22) at async AuthService.getOAuthClient (/usr/src/app/dist/services/auth.service.js:245:28) at async AuthService.authorize (/usr/src/app/dist/services/auth.service.js:144:24) [Nest] 6 - 05/24/2024, 9:41:45 PM LOG [ImmichServer] [EventRepository] Websocket Connect: iMU3QKmyUzdT3sKVAACR [Nest] 6 - 05/24/2024, 9:41:58 PM LOG [ImmichServer] [EventRepository] Websocket Disconnect: iMU3QKmyUzdT3sKVAACR ``` ``` ### Additional information _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#3264