Some S3 envs of plugin_daemon default value type error #12707

Closed
opened 2026-02-21 19:08:40 -05:00 by yindo · 2 comments
Owner

Originally created by @ramuzes on GitHub (Apr 9, 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

1.2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. check out on tag v1.2.0
  2. repo status is clean, .env file works on v1.0.0
  3. envs about S3 are below:
# S3 Configuration
#
S3_ENDPOINT=
S3_REGION=us-east-1
S3_BUCKET_NAME=difyai
S3_ACCESS_KEY=
S3_SECRET_KEY=
# Whether to use AWS managed IAM roles for authenticating with the S3 service.
# If set to false, the access key and secret key must be provided.
S3_USE_AWS_MANAGED_IAM=false

✔️ Expected Behavior

all services running healthy

Actual Behavior

plugin_daemon failed with error

2025/04/10 01:24:30 main.go:19: [PANIC]Error processing environment variables: envconfig.Process: assigning S3_USE_AWS_MANAGED_IAM to S3UseAwsManagedIam: converting '' to type bool. details: strconv.ParseBool: parsing "": invalid syntax                                                                                                                                                                    panic: [PANIC]Error processing environment variables: envconfig.Process: assigning S3_USE_AWS_MANAGED_IAM to S3UseAwsManagedIam: converting '' to type bool. details: strconv.ParseBool: parsing "": invalid syntax

goroutine 1 [running]:
github.com/langgenius/dify-plugin-daemon/internal/utils/log.writeLog({0x1857285, 0x5}, {0x1896127?, 0xc000279008?}, 0x1, {0xc000127f28, 0x1, 0x1})                                                              /app/internal/utils/log/log.go:40 +0x305
github.com/langgenius/dify-plugin-daemon/internal/utils/log.Panic(...)
        /app/internal/utils/log/log.go:66                                                                                                                                                               main.main()
        /app/cmd/server/main.go:19 +0x9f

if I set the envs or default value at docker-compose.yaml, then works fine

Originally created by @ramuzes on GitHub (Apr 9, 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 1.2.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. check out on tag v1.2.0 2. repo status is clean, .env file works on v1.0.0 3. envs about S3 are below: ``` # S3 Configuration # S3_ENDPOINT= S3_REGION=us-east-1 S3_BUCKET_NAME=difyai S3_ACCESS_KEY= S3_SECRET_KEY= # Whether to use AWS managed IAM roles for authenticating with the S3 service. # If set to false, the access key and secret key must be provided. S3_USE_AWS_MANAGED_IAM=false ``` ### ✔️ Expected Behavior all services running healthy ### ❌ Actual Behavior plugin_daemon failed with error ``` 2025/04/10 01:24:30 main.go:19: [PANIC]Error processing environment variables: envconfig.Process: assigning S3_USE_AWS_MANAGED_IAM to S3UseAwsManagedIam: converting '' to type bool. details: strconv.ParseBool: parsing "": invalid syntax panic: [PANIC]Error processing environment variables: envconfig.Process: assigning S3_USE_AWS_MANAGED_IAM to S3UseAwsManagedIam: converting '' to type bool. details: strconv.ParseBool: parsing "": invalid syntax goroutine 1 [running]: github.com/langgenius/dify-plugin-daemon/internal/utils/log.writeLog({0x1857285, 0x5}, {0x1896127?, 0xc000279008?}, 0x1, {0xc000127f28, 0x1, 0x1}) /app/internal/utils/log/log.go:40 +0x305 github.com/langgenius/dify-plugin-daemon/internal/utils/log.Panic(...) /app/internal/utils/log/log.go:66 main.main() /app/cmd/server/main.go:19 +0x9f ``` if I set the envs or default value at docker-compose.yaml, then works fine
yindo closed this issue 2026-02-21 19:08:40 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 9, 2025):

Hello @ramuzes! I'm Dosu, a bot here to help you with bugs, answer questions, and assist you in becoming a contributor. I'm here while you wait for a human maintainer. Let's dive into your issue!

To resolve the type error related to the S3_USE_AWS_MANAGED_IAM environment variable in the plugin_daemon for your self-hosted Dify setup, you can modify your docker-compose.yaml file to include default values for the environment variables. Here's how you can do it:

plugin_daemon:
  environment:
    S3_USE_PATH_STYLE: ${PLUGIN_S3_USE_PATH_STYLE:-true}
    S3_USE_AWS_MANAGED_IAM: ${PLUGIN_S3_USE_AWS_MANAGED_IAM:-false}

Alternatively, you can set the environment variables directly in your .env file:

PLUGIN_S3_USE_AWS_MANAGED_IAM=false
PLUGIN_S3_USE_PATH_STYLE=false

These changes ensure that the environment variable is correctly parsed as a boolean, preventing the strconv.ParseBool failure [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 (Apr 9, 2025): <!-- Greeting --> Hello @ramuzes! I'm [Dosu](https://dosu.dev), a bot here to help you with bugs, answer questions, and assist you in becoming a contributor. I'm here while you wait for a human maintainer. Let's dive into your issue! <!-- Answer --> To resolve the type error related to the `S3_USE_AWS_MANAGED_IAM` environment variable in the `plugin_daemon` for your self-hosted Dify setup, you can modify your `docker-compose.yaml` file to include default values for the environment variables. Here's how you can do it: ```yaml plugin_daemon: environment: S3_USE_PATH_STYLE: ${PLUGIN_S3_USE_PATH_STYLE:-true} S3_USE_AWS_MANAGED_IAM: ${PLUGIN_S3_USE_AWS_MANAGED_IAM:-false} ``` Alternatively, you can set the environment variables directly in your `.env` file: ``` PLUGIN_S3_USE_AWS_MANAGED_IAM=false PLUGIN_S3_USE_PATH_STYLE=false ``` These changes ensure that the environment variable is correctly parsed as a boolean, preventing the `strconv.ParseBool` failure <sup>[[1]](https://github.com/langgenius/dify/issues/17703)</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/7dd34611-ab9e-4bcb-ba88-739a9df437a2?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/7dd34611-ab9e-4bcb-ba88-739a9df437a2?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/7dd34611-ab9e-4bcb-ba88-739a9df437a2?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/7dd34611-ab9e-4bcb-ba88-739a9df437a2?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7dd34611-ab9e-4bcb-ba88-739a9df437a2?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/7dd34611-ab9e-4bcb-ba88-739a9df437a2?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7dd34611-ab9e-4bcb-ba88-739a9df437a2?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Apr 9, 2025):

Fixed in fix: docker compose plugin s3 config default value (#17722)

@crazywoola commented on GitHub (Apr 9, 2025): Fixed in fix: docker compose plugin s3 config default value (#17722)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12707