[Bug] Docker Compose部署无法使用 #4539
Replies: 3 comments 1 reply
-
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. |
Beta Was this translation helpful? Give feedback.
-
@DaLiWan666 你好!我是Dosu,我是一个可以帮你解决bug、回答问题并成为贡献者的机器人。我可以帮你解决问题,等待人类维护者的过程中,我会一直在这里帮助你。 It seems like you're encountering an "UNAUTHORIZED" error when deploying LobeChat using Docker Compose. Here are some steps and considerations that might help resolve the issue:
If these steps do not resolve the issue, consider checking similar issues or discussions for additional insights. For example, there was a similar issue related to |
Beta Was this translation helpful? Give feedback.
-
📦 Environment
Docker
📌 Version
v1.26.4
💻 Operating System
Ubuntu
🌐 Browser
Edge
🐛 Bug Description
使用 Docker Compose 部署 LobeChat 服务端数据库版本,按照教程使用bash <(curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/setup.sh) -f -l zh_CN脚本部署,修改配置文件ip,启动项目,点击登录显示
文件页面显示
配置文件均为脚本自动生成,且Casdoor内已经加上
。
日志显示next auth: undefined
{"level":30,"time":1730187543364,"pid":28,"hostname":"446a5be8e4b6","msg":"Error in tRPC handler (lambda) on path: knowledgeBase.getKnowledgeBases, type: query"}
a [TRPCError]: UNAUTHORIZED
at /app/.next/server/chunks/83972.js:1:1900
at c (/app/.next/server/chunks/9553.js:4:74)
at r (/app/.next/server/chunks/9553.js:1:5658)
at /app/.next/server/chunks/67058.js:1:7640
at Array.map ()
at g (/app/.next/server/chunks/67058.js:1:7155)
at async n (/app/.next/server/app/(backend)/trpc/lambda/[trpc]/route.js:1:3791)
at async /app/node_modules/.pnpm/next@14.2.8_@babel+core@7.23.6_@opentelemetry[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:36932
at async eC.execute (/app/node_modules/.pnpm/next@14.2.8_@babel+core@7.23.6_@opentelemetry[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:27548)
at async eC.handle (/app/node_modules/.pnpm/next@14.2.8_@babel+core@7.23.6_@opentelemetry[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:38186) {
code: 'UNAUTHORIZED',
[cause]: undefined
其中.evn文件【# Proxy, if you need it
HTTP_PROXY=http://localhost:7890
HTTPS_PROXY=http://localhost:7890
Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.
OPENAI_API_KEY=sk-xxxx
OPENAI_PROXY_URL=https://api.openai.com/v1
OPENAI_MODEL_LIST=...
===========================
====== Preset config ======
===========================
if no special requirements, no need to change
LOBE_PORT=3210
CASDOOR_PORT=8000
MINIO_PORT=9000
Postgres related, which are the necessary environment variables for DB
LOBE_DB_NAME=lobechat
POSTGRES_PASSWORD=uWNZugjBqixf8dxC
Casdoor secret
AUTH_CASDOOR_ID=a387a4892ee19b1a2249
AUTH_CASDOOR_SECRET=dbf205949d704de81b0b5b3603174e23fbecc354
MinIO S3 configuration
MINIO_ROOT_USER=YOUR_MINIO_USER
MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD
Configure the bucket information of MinIO
MINIO_LOBE_BUCKET=lobe
S3_ACCESS_KEY_ID=soaucnP8Bip0TDdUjxng
S3_SECRET_ACCESS_KEY=ZPUzvY34umfcfxvWKSv0P00vczVMB6YmgJS5J9eO】
docker-compose.yml文件默认的不行,手动添加对应变量也不行【name: lobe-chat-database
services:
network-service:
image: alpine
container_name: lobe-network
ports:
- '${MINIO_PORT}:${MINIO_PORT}' # MinIO API
- '9001:9001' # MinIO Console
- '${CASDOOR_PORT}:${CASDOOR_PORT}' # Casdoor
- '${LOBE_PORT}:3210' # LobeChat
command: tail -f /dev/null
networks:
- lobe-network
postgresql:
image: pgvector/pgvector:pg16
container_name: lobe-postgres
ports:
- '5432:5432'
volumes:
- './data:/var/lib/postgresql/data'
environment:
- 'POSTGRES_DB=${LOBE_DB_NAME}'
- 'POSTGRES_PASSWORD=${POSTGRES_PASSWORD}'
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 5s
timeout: 5s
retries: 5
restart: always
networks:
- lobe-network
minio:
image: minio/minio
container_name: lobe-minio
network_mode: 'service:network-service'
volumes:
- './s3_data:/etc/minio/data'
environment:
- 'MINIO_ROOT_USER=${MINIO_ROOT_USER}'
- 'MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}'
- 'MINIO_API_CORS_ALLOW_ORIGIN=http://192.168.8.245:${LOBE_PORT}'
restart: always
command: >
server /etc/minio/data --address ":${MINIO_PORT}" --console-address ":9001"
casdoor:
image: casbin/casdoor
container_name: lobe-casdoor
entrypoint: /bin/sh -c './server --createDatabase=true'
network_mode: 'service:network-service'
depends_on:
postgresql:
condition: service_healthy
environment:
RUNNING_IN_DOCKER: 'true'
driverName: 'postgres'
dataSourceName: 'user=postgres password=${POSTGRES_PASSWORD} host=postgresql port=5432 sslmode=disable dbname=casdoor'
origin: 'http://192.168.8.245:${CASDOOR_PORT}'
runmode: 'dev'
volumes:
- ./init_data.json:/init_data.json
lobe:
image: lobehub/lobe-chat-database
container_name: lobe-chat
network_mode: 'service:network-service'
depends_on:
postgresql:
condition: service_healthy
network-service:
condition: service_started
minio:
condition: service_started
casdoor:
condition: service_started
volumes:
data:
driver: local
s3_data:
driver: local
networks:
lobe-network:
driver: bridge
】
其中Casdoor内密钥和均对应。
📷 Recurrence Steps
依照此教程
🚦 Expected Behavior
预期正常使用
📝 Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions