Bedrock Claude not working on Dify #7959

Closed
opened 2026-02-21 18:23:14 -05:00 by yindo · 3 comments
Owner

Originally created by @hyojunada on GitHub (Feb 3, 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.13.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I am trying to use Bedrock, but I get this error:
[bedrock] Error: Error when retrieving credentials from iam-role: Credential refresh failed, response did not contain: access_key, secret_key, token, expiry_time

I am hosting Dify on my company's internal server.
I was able to connect to Bedrock service when the EC2 was using IMDSv1 but when we switched to IMDSv2 it doesn't work anymore

Image

✔️ Expected Behavior

Bedrock to work.

Actual Behavior

[bedrock] Error: Error when retrieving credentials from iam-role: Credential refresh failed, response did not contain: access_key, secret_key, token, expiry_time

Originally created by @hyojunada on GitHub (Feb 3, 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.13.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I am trying to use Bedrock, but I get this error: [bedrock] Error: Error when retrieving credentials from iam-role: Credential refresh failed, response did not contain: access_key, secret_key, token, expiry_time I am hosting Dify on my company's internal server. I was able to connect to Bedrock service when the EC2 was using IMDSv1 but when we switched to IMDSv2 it doesn't work anymore <img width="959" alt="Image" src="https://github.com/user-attachments/assets/ff7294a1-f5b5-4e8c-a367-72d27a8fed94" /> ### ✔️ Expected Behavior Bedrock to work. ### ❌ Actual Behavior [bedrock] Error: Error when retrieving credentials from iam-role: Credential refresh failed, response did not contain: access_key, secret_key, token, expiry_time
yindo added the 🐞 bugoutdated labels 2026-02-21 18:23:14 -05:00
yindo closed this issue 2026-02-21 18:23:14 -05:00
Author
Owner

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

I found a similar issue that was previously reported and resolved. The issue was related to using IAM Role instead of access keys for accessing AWS Bedrock. It was closed by a pull request that modified the get_bedrock_client function to support IAM Role by default when access keys are not provided [1].

The error you're encountering seems related to the transition from IMDSv1 to IMDSv2. Unfortunately, I couldn't find specific information on how Dify handles credential retrieval for AWS services when using IMDSv2. It might be worth checking if there are any specific configurations or updates needed for IMDSv2 compatibility in your setup.

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Feb 3, 2025): <!-- Answer --> I found a similar issue that was previously reported and resolved. The issue was related to using IAM Role instead of access keys for accessing AWS Bedrock. It was closed by a pull request that modified the `get_bedrock_client` function to support IAM Role by default when access keys are not provided <sup>[[1]](https://github.com/langgenius/dify/issues/3471)</sup>. The error you're encountering seems related to the transition from IMDSv1 to IMDSv2. Unfortunately, I couldn't find specific information on how Dify handles credential retrieval for AWS services when using IMDSv2. It might be worth checking if there are any specific configurations or updates needed for IMDSv2 compatibility in your setup. <!-- 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/f73b9447-96a0-4c3c-95bd-81fdf5da9f11?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/f73b9447-96a0-4c3c-95bd-81fdf5da9f11?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/f73b9447-96a0-4c3c-95bd-81fdf5da9f11?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/f73b9447-96a0-4c3c-95bd-81fdf5da9f11?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/f73b9447-96a0-4c3c-95bd-81fdf5da9f11?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/f73b9447-96a0-4c3c-95bd-81fdf5da9f11?feedback_type=other)</sup>
Author
Owner

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

Please upgrade to v0.15.2

@crazywoola commented on GitHub (Feb 3, 2025): Please upgrade to v0.15.2
Author
Owner

@hyojunada commented on GitHub (Feb 5, 2025):

I updated dify to 0.15.2 and having same problem.

@hyojunada commented on GitHub (Feb 5, 2025): I updated dify to 0.15.2 and having same problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7959