[GH-ISSUE #487] error: https://next-auth.js.org/errors#no_secret Please define a secret in production. r [MissingSecretError]: Please define a secret in production. #315

Closed
opened 2026-03-02 11:48:44 +03:00 by kerem · 5 comments
Owner

Originally created by @ljq29 on GitHub (Oct 5, 2024).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/487

Docker build,docker compose here:

version: "3.8"
services:
  web:
    # image: ghcr.io/hoarder-app/hoarder-web:${HOARDER_VERSION:-release}
    image: ghcr.nju.edu.cn/hoarder-app/hoarder-web:release
    restart: unless-stopped
    volumes:
      - /volume1/Docker/hoarder/data:/data
    # ports:
    #   - 3000:3000 #修改成自己想要的端口
    expose:
      - 3000
    environment:
      REDIS_HOST: redis
      MEILI_ADDR: http://meilisearch:7700
      DATA_DIR: /data
    networks:
      - network-bridge
      - traefik
    labels:
      # 初始化 traefik
      - "traefik.enable=true"
      - "traefik.docker.network=traefik"
      - "traefik.http.services.${AppName}-backend.loadbalancer.server.scheme=http"
      - "traefik.http.services.${AppName}-backend.loadbalancer.server.port=3000"
      - "traefik.http.routers.${AppName}-ssl.tls.certresolver=le"
      # 设置中间件
      # - "traefik.http.middlewares.gzip.compress=true"
      - "traefik.http.middlewares.${AppName}-redir-https.redirectscheme.scheme=https"
      - "traefik.http.middlewares.${AppName}-redir-https.redirectscheme.permanent=false"

      # http80
      - "traefik.http.routers.${AppName}-web.entrypoints=http"
      - "traefik.http.routers.${AppName}-web.rule=Host(`${DOMAIN}`)"
      - "traefik.http.routers.${AppName}-web.middlewares=${AppName}-redir-https, gzip"

      # https443
      - "traefik.http.routers.${AppName}-ssl.entrypoints=https"
      - "traefik.http.routers.${AppName}-ssl.tls=true"
      - "traefik.http.routers.${AppName}-ssl.rule=Host(`${DOMAIN}`)"
      - "traefik.http.routers.${AppName}-ssl.middlewares=gzip"

      # https8443
      - "traefik.http.routers.${AppName}-ssl8443.entrypoints=https8443"
      - "traefik.http.routers.${AppName}-ssl8443.tls=true"
      - "traefik.http.routers.${AppName}-ssl8443.rule=Host(`${DOMAIN}`)"
      - "traefik.http.routers.${AppName}-ssl8443.middlewares=gzip"
  redis:
    image: redis:7.2-alpine
    restart: unless-stopped
    volumes:
      - redis:/data
    networks:
      - network-bridge
  chrome:
    image: gcr.nju.edu.cn/zenika-hub/alpine-chrome:123
    restart: unless-stopped
    command:
      - --no-sandbox
      - --disable-gpu
      - --disable-dev-shm-usage
      - --remote-debugging-address=0.0.0.0
      - --remote-debugging-port=9222
      - --hide-scrollbars
    networks:
      - network-bridge
  meilisearch:
    # image: getmeili/meilisearch:v1.6
    image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/getmeili/meilisearch:v1.10
    restart: unless-stopped
    environment:
      MEILI_NO_ANALYTICS: "true"
    volumes:
      - meilisearch:/meili_data
    networks:
      - network-bridge
  workers:
    # image: ghcr.io/hoarder-app/hoarder-workers:${HOARDER_VERSION:-release}
    image: ghcr.nju.edu.cn/hoarder-app/hoarder-workers:release
    restart: unless-stopped
    volumes:
      - /volume1/Docker/hoarder/data:/data
    environment:
      REDIS_HOST: redis
      MEILI_ADDR: http://meilisearch:7700
      BROWSER_WEB_URL: http://chrome:9222
      DATA_DIR: /data
      # OPENAI_API_KEY: ...
    networks:
      - network-bridge
    depends_on:
      web:
        condition: service_started

volumes:
  redis:
  meilisearch:

networks:
  network-bridge:
    driver: bridge
  traefik:
    external: true

.env

HOARDER_VERSION=release
NEXTAUTH_SECRET=vQNPMiKQ4cVHM3EjGQm8YN0rG+hIY4erC4rGRuZTiiY=
MEILI_MASTER_KEY=vQNPMiKQ4cVHM3EjGQm8YN0rG+hIY4erC4rGRuZTiiY=
NEXTAUTH_URL=http://localhost:3000

error in web
image

error in logs

https://next-auth.js.org/errors#no_secret Please define a `secret` in production. r [MissingSecretError]: Please define a `secret` in production.

    at t.assertConfig (/app/apps/web/.next/server/chunks/8109.js:1:51161)

    at m (/app/apps/web/.next/server/chunks/8109.js:1:44525)

    at async o (/app/apps/web/.next/server/chunks/8109.js:25:20595)

    at async g (/app/apps/web/.next/server/chunks/4685.js:1:8184) {

  code: 'NO_SECRET'

}

Error: There is a problem with the server configuration. Check the server logs for more information.

    at o (/app/apps/web/.next/server/chunks/8109.js:25:20843)

    at async i (/app/apps/web/.next/server/app/page.js:1:2845) {

  digest: '2936418077'

}

Error: There is a problem with the server configuration. Check the server logs for more information.

    at o (/app/apps/web/.next/server/chunks/8109.js:25:20843)

    at async g (/app/apps/web/.next/server/chunks/4685.js:1:8184) {

  digest: '3467703528'

}

Error: There is a problem with the server configuration. Check the server logs for more information.

    at o (/app/apps/web/.next/server/chunks/8109.js:25:20843)

    at async g (/app/apps/web/.next/server/chunks/4685.js:1:8184) {

  digest: '3467703528'

}
Originally created by @ljq29 on GitHub (Oct 5, 2024). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/487 Docker build,docker compose here: ``` version: "3.8" services: web: # image: ghcr.io/hoarder-app/hoarder-web:${HOARDER_VERSION:-release} image: ghcr.nju.edu.cn/hoarder-app/hoarder-web:release restart: unless-stopped volumes: - /volume1/Docker/hoarder/data:/data # ports: # - 3000:3000 #修改成自己想要的端口 expose: - 3000 environment: REDIS_HOST: redis MEILI_ADDR: http://meilisearch:7700 DATA_DIR: /data networks: - network-bridge - traefik labels: # 初始化 traefik - "traefik.enable=true" - "traefik.docker.network=traefik" - "traefik.http.services.${AppName}-backend.loadbalancer.server.scheme=http" - "traefik.http.services.${AppName}-backend.loadbalancer.server.port=3000" - "traefik.http.routers.${AppName}-ssl.tls.certresolver=le" # 设置中间件 # - "traefik.http.middlewares.gzip.compress=true" - "traefik.http.middlewares.${AppName}-redir-https.redirectscheme.scheme=https" - "traefik.http.middlewares.${AppName}-redir-https.redirectscheme.permanent=false" # http80 - "traefik.http.routers.${AppName}-web.entrypoints=http" - "traefik.http.routers.${AppName}-web.rule=Host(`${DOMAIN}`)" - "traefik.http.routers.${AppName}-web.middlewares=${AppName}-redir-https, gzip" # https443 - "traefik.http.routers.${AppName}-ssl.entrypoints=https" - "traefik.http.routers.${AppName}-ssl.tls=true" - "traefik.http.routers.${AppName}-ssl.rule=Host(`${DOMAIN}`)" - "traefik.http.routers.${AppName}-ssl.middlewares=gzip" # https8443 - "traefik.http.routers.${AppName}-ssl8443.entrypoints=https8443" - "traefik.http.routers.${AppName}-ssl8443.tls=true" - "traefik.http.routers.${AppName}-ssl8443.rule=Host(`${DOMAIN}`)" - "traefik.http.routers.${AppName}-ssl8443.middlewares=gzip" redis: image: redis:7.2-alpine restart: unless-stopped volumes: - redis:/data networks: - network-bridge chrome: image: gcr.nju.edu.cn/zenika-hub/alpine-chrome:123 restart: unless-stopped command: - --no-sandbox - --disable-gpu - --disable-dev-shm-usage - --remote-debugging-address=0.0.0.0 - --remote-debugging-port=9222 - --hide-scrollbars networks: - network-bridge meilisearch: # image: getmeili/meilisearch:v1.6 image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/getmeili/meilisearch:v1.10 restart: unless-stopped environment: MEILI_NO_ANALYTICS: "true" volumes: - meilisearch:/meili_data networks: - network-bridge workers: # image: ghcr.io/hoarder-app/hoarder-workers:${HOARDER_VERSION:-release} image: ghcr.nju.edu.cn/hoarder-app/hoarder-workers:release restart: unless-stopped volumes: - /volume1/Docker/hoarder/data:/data environment: REDIS_HOST: redis MEILI_ADDR: http://meilisearch:7700 BROWSER_WEB_URL: http://chrome:9222 DATA_DIR: /data # OPENAI_API_KEY: ... networks: - network-bridge depends_on: web: condition: service_started volumes: redis: meilisearch: networks: network-bridge: driver: bridge traefik: external: true ``` .env ``` HOARDER_VERSION=release NEXTAUTH_SECRET=vQNPMiKQ4cVHM3EjGQm8YN0rG+hIY4erC4rGRuZTiiY= MEILI_MASTER_KEY=vQNPMiKQ4cVHM3EjGQm8YN0rG+hIY4erC4rGRuZTiiY= NEXTAUTH_URL=http://localhost:3000 ``` error in web ![image](https://github.com/user-attachments/assets/535b829f-9091-4ca2-8ccf-46249b409d0f) error in logs ``` https://next-auth.js.org/errors#no_secret Please define a `secret` in production. r [MissingSecretError]: Please define a `secret` in production. at t.assertConfig (/app/apps/web/.next/server/chunks/8109.js:1:51161) at m (/app/apps/web/.next/server/chunks/8109.js:1:44525) at async o (/app/apps/web/.next/server/chunks/8109.js:25:20595) at async g (/app/apps/web/.next/server/chunks/4685.js:1:8184) { code: 'NO_SECRET' } Error: There is a problem with the server configuration. Check the server logs for more information. at o (/app/apps/web/.next/server/chunks/8109.js:25:20843) at async i (/app/apps/web/.next/server/app/page.js:1:2845) { digest: '2936418077' } Error: There is a problem with the server configuration. Check the server logs for more information. at o (/app/apps/web/.next/server/chunks/8109.js:25:20843) at async g (/app/apps/web/.next/server/chunks/4685.js:1:8184) { digest: '3467703528' } Error: There is a problem with the server configuration. Check the server logs for more information. at o (/app/apps/web/.next/server/chunks/8109.js:25:20843) at async g (/app/apps/web/.next/server/chunks/4685.js:1:8184) { digest: '3467703528' } ```
kerem 2026-03-02 11:48:44 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@MohamedBassem commented on GitHub (Oct 5, 2024):

You seem to have removed the env_file attributes from the docker compose, is that intentional?

<!-- gh-comment-id:2395124316 --> @MohamedBassem commented on GitHub (Oct 5, 2024): You seem to have removed the `env_file` attributes from the docker compose, is that intentional?
Author
Owner

@ljq29 commented on GitHub (Oct 5, 2024):

I am using portainer, So I put the environment in the web Instead of env file.

---Original---
From: "Mohamed @.>
Date: Sun, Oct 6, 2024 01:24 AM
To: @.
>;
Cc: @.@.>;
Subject: Re: [hoarder-app/hoarder] error:https://next-auth.js.org/errors#no_secret Please define a secret inproduction. r [MissingSecretError]: Please define a secret in production.(Issue #487)

You seem to have removed the env_file attributes from the docker compose, is that intentional?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>

<!-- gh-comment-id:2395124731 --> @ljq29 commented on GitHub (Oct 5, 2024): I am using portainer, So I put the environment in the web Instead of env file. ---Original--- From: "Mohamed ***@***.***&gt; Date: Sun, Oct 6, 2024 01:24 AM To: ***@***.***&gt;; Cc: ***@***.******@***.***&gt;; Subject: Re: [hoarder-app/hoarder] error:https://next-auth.js.org/errors#no_secret Please define a `secret` inproduction. r [MissingSecretError]: Please define a `secret` in production.(Issue #487) You seem to have removed the env_file attributes from the docker compose, is that intentional? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: ***@***.***&gt;
Author
Owner

@MohamedBassem commented on GitHub (Oct 5, 2024):

I think with portainer, after you put the env in the web, you still need to add env_file as stack.env.

<!-- gh-comment-id:2395125007 --> @MohamedBassem commented on GitHub (Oct 5, 2024): I think with portainer, after you put the env in the web, you still need to add env_file as `stack.env`.
Author
Owner

@ljq29 commented on GitHub (Oct 5, 2024):

I used to use my way and its work.
But in this case it seems failled.

Anyway, I will try your method.

---Original---
From: "Mohamed @.>
Date: Sun, Oct 6, 2024 01:27 AM
To: @.
>;
Cc: @.@.>;
Subject: Re: [hoarder-app/hoarder] error:https://next-auth.js.org/errors#no_secret Please define a secret inproduction. r [MissingSecretError]: Please define a secret in production.(Issue #487)

I think with portainer, after you put the env in the web, you still need to add env_file as stack.env.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>

<!-- gh-comment-id:2395125458 --> @ljq29 commented on GitHub (Oct 5, 2024): I used to use my way and its work. But in this case it seems failled. Anyway, I will try your method. ---Original--- From: "Mohamed ***@***.***&gt; Date: Sun, Oct 6, 2024 01:27 AM To: ***@***.***&gt;; Cc: ***@***.******@***.***&gt;; Subject: Re: [hoarder-app/hoarder] error:https://next-auth.js.org/errors#no_secret Please define a `secret` inproduction. r [MissingSecretError]: Please define a `secret` in production.(Issue #487) I think with portainer, after you put the env in the web, you still need to add env_file as stack.env. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: ***@***.***&gt;
Author
Owner

@ljq29 commented on GitHub (Oct 6, 2024):

I think with portainer, after you put the env in the web, you still need to add env_file as stack.env.

I finally put like this to resolve problem, instead of define NEXTAUTH_SECRET env in web.

services:
web:
# image: ghcr.io/hoarder-app/hoarder-web:${HOARDER_VERSION:-release}
image: ghcr.nju.edu.cn/hoarder-app/hoarder-web:release
restart: unless-stopped
volumes:
- /volume1/Docker/hoarder/data:/data
# ports:
# - 3000:3000 #修改成自己想要的端口
expose:
- 3000
environment:
REDIS_HOST: redis
MEILI_ADDR: http://meilisearch:7700
DATA_DIR: /data
NEXTAUTH_SECRET: "vQNPMiKQ4cVHM3EjGQm8YN0rG+hIY4erC4rGRuZTiiY="
networks:
- network-bridge
- traefik

<!-- gh-comment-id:2395261271 --> @ljq29 commented on GitHub (Oct 6, 2024): > I think with portainer, after you put the env in the web, you still need to add env_file as `stack.env`. I finally put like this to resolve problem, instead of define NEXTAUTH_SECRET env in web. services: web: # image: ghcr.io/hoarder-app/hoarder-web:${HOARDER_VERSION:-release} image: ghcr.nju.edu.cn/hoarder-app/hoarder-web:release restart: unless-stopped volumes: - /volume1/Docker/hoarder/data:/data # ports: # - 3000:3000 #修改成自己想要的端口 expose: - 3000 environment: REDIS_HOST: redis MEILI_ADDR: http://meilisearch:7700 DATA_DIR: /data NEXTAUTH_SECRET: "vQNPMiKQ4cVHM3EjGQm8YN0rG+hIY4erC4rGRuZTiiY=" networks: - network-bridge - traefik
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#315
No description provided.