Unable to load AWS credentials from any provider in the chain
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- aws, java
- Lĩnh vực
- authentication, cloud
Hướng nghiên cứu
Bắt đầu với các đoạn mã Java sử dụng DefaultAWSCredentialsProviderChain.getCredentials(), trình dựng DynamoDB và các thiết lập proxy của ClientConfiguration. Tái hiện lỗi của chuỗi thông tin xác thực trên EC2 và xác định xem hành vi còn thiếu nằm ở quyền truy cập instance-role, cấu hình proxy hay thiết lập client; hoàn tất có nghĩa là đã ghi lại nguyên nhân được xác nhận và cách khắc phục có thể tái hiện.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I have my application running on EC2. Trying to access dynamoDB from my Java application. But for every operation, I get "Unable to load AWS credentials from any provider in the chain".
- I have added dynamoDB permissions in the IAM role that gets attached to EC2 instance
- And also configured EC2 to assume that role in trust relationship.
Code:
AWSCredentialsProvider provider = new DefaultAWSCredentialsProviderChain();
AWSCredentials credentials = provider.getCredentials();
if(credentials != null) {
LOG.info("Credentials Key: " + credentials.getAWSAccessKeyId());
LOG.info("Credentials secret: " + credentials.getAWSSecretKey());
}
} catch (Exception e) {
LOG.info("Exception in credentials cause:" + e.getCause() +";message: " + e.getMessage() +";stack: " +e.getStackTrace());
}
The getCredentials() line itself throws an Exception with message: "Unable to load AWS credentials from any provider in the chain".
If I do not try to get credentials here and pass it to the DynamoDB client:
.withClientConfiguration(clientConfig)
.build();```
Then it throws the same exception when I try to do any operation.
I tried setting up the proxy too:
```ClientConfiguration clientConfig = new ClientConfiguration();
clientConfig.setProxyHost("yyy");
clientConfig.setProxyPort(port);
clientConfig.setNonProxyHosts("xxx");
clientConfig.setProtocol(Protocol.HTTP);```
and then passing it while creating the client:
``` dynamoDBClient = builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(url, region.getName()))
.withCredentials(credentialProvider())
.withClientConfiguration(clientConfig)
.build();
But no success.
Can someone @here guide me what am I missing here?
- Ngôn ngữ chính
- Java
- Star
- 241
- Fork
- 345
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws-samples/aws-java-sample
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
-
Build Error Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Build Failure Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
aws-samples/aws-java-sample#25 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
aws-samples/aws-java-sample#24 · 1 bình luận · 1 reaction ·
-
The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
aws-samples/aws-java-sample#19 · 1 bình luận ·
Tất cả issue của aws-samples/aws-java-sample
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
opensearch-project/k-NN#3597 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100