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

When bedrock's AKSK is left blank ( AWS environment configuration is automatically called), an error will be reported when using the rerank model #11494

Closed
5 tasks done
FelixFeli opened this issue Dec 9, 2024 · 3 comments · Fixed by #11506
Labels
🐞 bug Something isn't working

Comments

@FelixFeli
Copy link

FelixFeli commented Dec 9, 2024

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.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Deploy Dify on AWS EC2 and select Amazon Bedrock in Model Provider, Access Key and Secret Access Key Leave blank. At this time, the credentials owned by EC2 will be used by default to call bedrock. In the new version, when calling the newly added bedrock rerank model, an error will be reported without AKSK.
image

✔️ Expected Behavior

Successfully called bedrock rerank model

❌ Actual Behavior

[bedrock] Error: Partial credentials foundin explicit, missing: aws_secret_access_key

Copy link

dosubot bot commented Dec 9, 2024

@FelixFeli Hello there! I'm here to assist you with any bugs, questions, or contributions you might have. If you need help with anything, feel free to ask!

To resolve the error "Partial credentials found, missing: aws_secret_access_key" when using the Bedrock rerank model with AKSK left blank in a self-hosted Dify deployment on AWS EC2, ensure that the aws_secret_access_key is provided in the credentials dictionary. This error occurs because the aws_secret_access_key is missing when initializing the boto3 client in the _invoke method of the BedrockRerankModel class.

Make sure that the credentials dictionary includes both aws_access_key_id and aws_secret_access_key. If these fields are left blank, you need to provide valid AWS credentials. Alternatively, ensure that your AWS environment is configured to provide these credentials automatically, such as through an IAM role attached to your EC2 instance with the necessary permissions.

Additionally, validate the credentials using the validate_provider_credentials method from the BedrockProvider class. Ensure that the environment variables AWS_REGION, AWS_ACCESS_KEY, and AWS_SECRET_ACCESS_KEY are set correctly. If using environment-based credentials, confirm that your EC2 instance has the appropriate IAM role attached [1][2].

To continue talking to Dosu, mention @dosu.


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

@dosubot dosubot bot added the 🐞 bug Something isn't working label Dec 9, 2024
@FelixFeli FelixFeli changed the title When bedrock's AKSK is left blank (system configuration is automatically called), an error will be reported when using the rerank model When bedrock's AKSK is left blank ( AWS environment configuration is automatically called), an error will be reported when using the rerank model Dec 9, 2024
@warren830
Copy link
Contributor

@FelixFeli hi, I feel so confused how can you set bedrock without aksk? Can you provide some screenshots.

@FelixFeli
Copy link
Author

@FelixFeli hi, I feel so confused how can you set bedrock without aksk? Can you provide some screenshots.

image

Just leave it blank, AKSK is not required. If not filled in, it will be read from the system environment

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

Successfully merging a pull request may close this issue.

2 participants