internal server error #8768

Closed
opened 2026-02-21 18:27:30 -05:00 by yindo · 4 comments
Owner

Originally created by @ywf on GitHub (Feb 28, 2025).

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

0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I'm deploying Dify using Docker Compose. I executed the command docker compose up -d. After the images were successfully downloaded, when I ran docker ps, I found that the plugin_daemon was constantly restarting. When I entered 127.0.0.1/install in the browser, it showed an "Internal Server Error".

✔️ Expected Behavior

I hope to solve this problem.

Actual Behavior

After checking the logs with docker logs, the error information is as follows:
2025/02/28 12:17:39 /app/internal/db/init.go:17
[error] failed to initialize database, got error failed to connect to `host=db user=postgres database=postgres`: server error (FATAL: no pg_hba.conf entry for host "172.18.0.5", user "postgres", database "postgres", no encryption (SQLSTATE 28000))
2025/02/28 12:17:39 init.go:103: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: server error (FATAL: no pg_hba.conf entry for host "172.18.0.5", user "postgres", database "postgres", no encryption (SQLSTATE 28000))
panic: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: server error (FATAL: no pg_hba.conf entry for host "172.18.0.5", user "postgres", database "postgres", no encryption (SQLSTATE 28000))%!(EXTRA *pgconn.ConnectError=failed to connect to `host=db user=postgres database=postgres`: server error (FATAL: no pg_hba.conf entry for host "172.18.0.5", user "postgres", database "postgres", no encryption (SQLSTATE 28000)))

goroutine 1 [running]:
github.com/langgenius/dify-plugin-daemon/internal/utils/log.writeLog({0x15cf074, 0x5}, {0x15fc583?, 0x2?}, 0x1, {0xc00063fd00, 0x1, 0x1})
        /app/internal/utils/log/log.go:40 +0x326
github.com/langgenius/dify-plugin-daemon/internal/utils/log.Panic(...)
        /app/internal/utils/log/log.go:66
github.com/langgenius/dify-plugin-daemon/internal/db.Init(0x2710?)
        /app/internal/db/init.go:103 +0xbb
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).Run(0xc00032a0d8, 0xc0005ab8c8)
        /app/internal/server/server.go:55 +0xd2
main.main()
        /app/cmd/server/main.go:28 +0xff
Originally created by @ywf on GitHub (Feb 28, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I'm deploying Dify using Docker Compose. I executed the command docker compose up -d. After the images were successfully downloaded, when I ran docker ps, I found that the plugin_daemon was constantly restarting. When I entered 127.0.0.1/install in the browser, it showed an "Internal Server Error". ### ✔️ Expected Behavior I hope to solve this problem. ### ❌ Actual Behavior ``` After checking the logs with docker logs, the error information is as follows: 2025/02/28 12:17:39 /app/internal/db/init.go:17 [error] failed to initialize database, got error failed to connect to `host=db user=postgres database=postgres`: server error (FATAL: no pg_hba.conf entry for host "172.18.0.5", user "postgres", database "postgres", no encryption (SQLSTATE 28000)) 2025/02/28 12:17:39 init.go:103: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: server error (FATAL: no pg_hba.conf entry for host "172.18.0.5", user "postgres", database "postgres", no encryption (SQLSTATE 28000)) panic: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: server error (FATAL: no pg_hba.conf entry for host "172.18.0.5", user "postgres", database "postgres", no encryption (SQLSTATE 28000))%!(EXTRA *pgconn.ConnectError=failed to connect to `host=db user=postgres database=postgres`: server error (FATAL: no pg_hba.conf entry for host "172.18.0.5", user "postgres", database "postgres", no encryption (SQLSTATE 28000))) goroutine 1 [running]: github.com/langgenius/dify-plugin-daemon/internal/utils/log.writeLog({0x15cf074, 0x5}, {0x15fc583?, 0x2?}, 0x1, {0xc00063fd00, 0x1, 0x1}) /app/internal/utils/log/log.go:40 +0x326 github.com/langgenius/dify-plugin-daemon/internal/utils/log.Panic(...) /app/internal/utils/log/log.go:66 github.com/langgenius/dify-plugin-daemon/internal/db.Init(0x2710?) /app/internal/db/init.go:103 +0xbb github.com/langgenius/dify-plugin-daemon/internal/server.(*App).Run(0xc00032a0d8, 0xc0005ab8c8) /app/internal/server/server.go:55 +0xd2 main.main() /app/cmd/server/main.go:28 +0xff ```
yindo closed this issue 2026-02-21 18:27:31 -05:00
Author
Owner

@pursuelu commented on GitHub (Feb 28, 2025):

me too

@pursuelu commented on GitHub (Feb 28, 2025): me too
Author
Owner

@dosubot[bot] commented on GitHub (Feb 28, 2025):

Hey there, @ywf! I'm here to assist you with any bugs, questions, or contributions you have for the Dify project. Let's work together to resolve this issue!

I found a similar open issue that might help you resolve the "Internal Server Error" you're encountering. The error message indicates a problem with the pg_hba.conf configuration, which is preventing the plugin_daemon from connecting to the PostgreSQL database.

To resolve this, you need to ensure that your pg_hba.conf file allows connections from the Docker network. You can add the following entry to your pg_hba.conf file:

host    all             all             172.18.0.0/16            md5

This entry allows all hosts in the 172.18.0.0/16 subnet to connect using MD5 authentication. After making this change, restart your Docker containers to apply the new configuration:

  1. Navigate to the Docker directory in the Dify source code:

    cd dify/docker
    
  2. Start the Docker containers:

    • If you have Docker Compose V2, use the following command:

      docker compose up -d
      
    • If you have Docker Compose V1, use the following command:

      docker-compose up -d
      

After executing these steps, check if the plugin_daemon service is running successfully. This should help resolve the connection issue and allow you to proceed with the installation [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

@dosubot[bot] commented on GitHub (Feb 28, 2025): <!-- Greeting --> Hey there, @ywf! I'm here to assist you with any bugs, questions, or contributions you have for the Dify project. Let's work together to resolve this issue! <!-- Answer --> I found a similar open issue that might help you resolve the "Internal Server Error" you're encountering. The error message indicates a problem with the `pg_hba.conf` configuration, which is preventing the `plugin_daemon` from connecting to the PostgreSQL database. To resolve this, you need to ensure that your `pg_hba.conf` file allows connections from the Docker network. You can add the following entry to your `pg_hba.conf` file: ``` host all all 172.18.0.0/16 md5 ``` This entry allows all hosts in the `172.18.0.0/16` subnet to connect using MD5 authentication. After making this change, restart your Docker containers to apply the new configuration: 1. Navigate to the Docker directory in the Dify source code: ```bash cd dify/docker ``` 2. Start the Docker containers: - If you have Docker Compose V2, use the following command: ```bash docker compose up -d ``` - If you have Docker Compose V1, use the following command: ```bash docker-compose up -d ``` After executing these steps, check if the `plugin_daemon` service is running successfully. This should help resolve the connection issue and allow you to proceed with the installation <sup>[[1]](https://github.com/langgenius/dify/issues/8147)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/9b7b9791-8bf3-4e23-9533-e6e6afacc300?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/9b7b9791-8bf3-4e23-9533-e6e6afacc300?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/9b7b9791-8bf3-4e23-9533-e6e6afacc300?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/9b7b9791-8bf3-4e23-9533-e6e6afacc300?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/9b7b9791-8bf3-4e23-9533-e6e6afacc300?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/9b7b9791-8bf3-4e23-9533-e6e6afacc300?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/9b7b9791-8bf3-4e23-9533-e6e6afacc300?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Feb 28, 2025):

  • Remove existing containers
  • Run git checkout 0.15.3
  • Run docker compose up -d

Should not see this in the 0.15.3 branch

panic: [PANIC]failed to init dify plugin db:
@crazywoola commented on GitHub (Feb 28, 2025): - Remove existing containers - Run `git checkout 0.15.3` - Run `docker compose up -d` Should not see this in the 0.15.3 branch ``` panic: [PANIC]failed to init dify plugin db: ```
Author
Owner

@ywf commented on GitHub (Mar 4, 2025):

Thank you. I've solved this problem. Previously, I started Dify in the CMD command window or PowerShell window. Later, I executed the startup command in the Git command window, and it worked fine.

@ywf commented on GitHub (Mar 4, 2025): Thank you. I've solved this problem. Previously, I started Dify in the CMD command window or PowerShell window. Later, I executed the startup command in the Git command window, and it worked fine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8768