Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 我用FNOS的docker安装IP模式,其中{:8000}和{:5432}端口均被占用了,于是我修改了配置文件,但是lobe-casdoor一直报错。 #5700

Open
Chincherry93 opened this issue Feb 3, 2025 · 2 comments
Labels
🐛 Bug Something isn't working | 缺陷

Comments

@Chincherry93
Copy link

📦 Environment

Docker

📌 Version

latest

💻 Operating System

Other Linux

🌐 Browser

Other

🐛 Bug Description

##这是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}:8000' # Casdoor
- '${LOBE_PORT}:3210' # LobeChat
command: tail -f /dev/null
networks:
- lobe-network

postgresql:
image: pgvector/pgvector:pg16
container_name: lobe-postgres
ports:
- '5400: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: 30s
timeout: 30s
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.110.172:${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=5400 sslmode=disable dbname=casdoor'
origin: 'http://192.168.110.172:${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

environment:
  - 'APP_URL=http://192.168.110.172:3210'
  - 'NEXT_AUTH_SSO_PROVIDERS=casdoor'
  - 'KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ='
  - 'NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg'
  - 'AUTH_URL=http://192.168.110.172:${LOBE_PORT}/api/auth'
  - 'AUTH_CASDOOR_ISSUER=http://192.168.110.172:${CASDOOR_PORT}'
  - 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5400/${LOBE_DB_NAME}'
  - 'S3_ENDPOINT=http://192.168.110.172:${MINIO_PORT}'
  - 'S3_BUCKET=${MINIO_LOBE_BUCKET}'
  - 'S3_PUBLIC_DOMAIN=http://192.168.110.172:${MINIO_PORT}'
  - 'S3_ENABLE_PATH_STYLE=1'
  - 'LLM_VISION_IMAGE_USE_BASE64=1'
env_file:
  - .env
restart: always

volumes:
data:
driver: local
s3_data:
driver: local

networks:
lobe-network:
driver: bridge

##这是.env文件

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=8011
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=e1e7e9efd1ddf448ea5f742aa1f09c3d

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

📷 Recurrence Steps

##lobe-casdoor这是报错信息
panic: dial tcp 192.168.48.3:5400: connect: connection refused

goroutine 1 [running]:

github.com/casdoor/casdoor/object.InitAdapter()

    /go/src/casdoor/object/ormer.go:91 +0x246

main.main()

    /go/src/casdoor/main.go:35 +0x30

🚦 Expected Behavior

No response

📝 Additional Information

No response

@Chincherry93 Chincherry93 added the 🐛 Bug Something isn't working | 缺陷 label Feb 3, 2025
@github-project-automation github-project-automation bot moved this to Roadmap - Chat 1.x in Lobe Chat Routine Feb 3, 2025
@lobehubbot
Copy link
Member

👀 @Chincherry93

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

Copy link

dosubot bot commented Feb 3, 2025

@Chincherry93 你好!我是Dosu,一个可以帮助你解决bug、回答问题并成为贡献者的机器人。我会在人类维护者到来之前帮助你解决问题。

The "connection refused" error for the 'casdoor' service is likely due to the incorrect port configuration for the PostgreSQL service. In your Docker Compose file, the PostgreSQL service is exposed on port 5400, but the 'casdoor' service is trying to connect to it using the internal Docker network, which should use the default PostgreSQL port 5432.

To resolve this issue, update the dataSourceName in the 'casdoor' service's environment variables to use port 5432 instead of 5400:

dataSourceName: 'user=postgres password=${POSTGRES_PASSWORD} host=postgresql port=5432 sslmode=disable dbname=casdoor'

This change ensures that 'casdoor' connects to the PostgreSQL service using the correct internal port. The external port 5400 is only used for accessing PostgreSQL from outside the Docker network.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷
Projects
Status: Roadmap - Chat 1.x
Development

No branches or pull requests

2 participants