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

Failed DB migration #14545

Open
5 tasks done
damadorPL opened this issue Feb 28, 2025 · 2 comments
Open
5 tasks done

Failed DB migration #14545

damadorPL opened this issue Feb 28, 2025 · 2 comments
Labels
🐞 bug Something isn't working

Comments

@damadorPL
Copy link

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

git pull and docker compose up-d

✔️ Expected Behavior

No response

❌ Actual Behavior

Running migrations
2025-02-28 09:10:48.893 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 6 threads.
2025-02-28 09:10:51.758 INFO [MainThread] [_client.py:1038] - HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"
Preparing database migration...
Starting database migration.
ERROR [root] Failed to execute database migration
Traceback (most recent call last):
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 146, in init
self._dbapi_connection = engine.raw_connection()
^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 3302, in raw_connection
return self.pool.connect()
^^^^^^^^^^^^^^^^^^^

seems that it cant connect to DB -

as iam running another postgress container i had to set in .env

DB_PORT=5632
PGVECTOR_PORT=5632
EXPOSE_DB_PORT=5632

@dosubot dosubot bot added the 🐞 bug Something isn't working label Feb 28, 2025
Copy link

dosubot bot commented Feb 28, 2025

I found a similar closed issue that might help resolve your problem. The issue was related to port conflicts when running multiple PostgreSQL containers. The solution involved ensuring that the docker-compose.yaml file correctly maps the host port to the container's port. Here's what you can do:

  1. Update the docker-compose.yaml file: Make sure it maps the correct port. For example, if you set DB_PORT=5632 in your .env file, ensure the docker-compose.yaml file has:

    ports:
      - '5632:5432'
  2. Set Environment Variables: Ensure both DB_PORT=5632 and EXPOSE_DB_PORT=5632 are set in your .env file.

  3. Restart Docker Containers: After making these changes, restart your Docker containers to apply the new configuration. You can do this by running:

    docker compose down
    docker compose up -d

These steps should help resolve the connection issue by ensuring the correct port mapping and environment variable settings [1].

To continue talking to Dosu, mention @dosu.


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

@damadorPL
Copy link
Author

port from containers are exposed correctly - unfortunatelly API cant connect and still get these errors

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
None yet
Development

No branches or pull requests

1 participant