-
Notifications
You must be signed in to change notification settings - Fork 800
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
Access Denied with aws-sdk-java:2.21.6. Worked with aws-sdk-java:2.20.162 #4647
Comments
Hi @oplohmann, Thank you for reporting the issue. Unfortunately, I am unable to reproduce it. Below is the code sample that I used (aws-sdk-java:2.21.6) public class Sample {
public static void main(String[] args) {
AwsCredentialsProvider creds = StaticCredentialsProvider.create(AwsBasicCredentials.create("accessKeyId", "secretAcessKey"));
Region region = Region.US_EAST_1;
ConnectClient connectClient = ConnectClient.builder()
.credentialsProvider(creds)
.region(region)
.build();
listAllInstances(connectClient);
}
public static void listAllInstances(ConnectClient connectClient) {
try {
ListInstancesRequest instancesRequest = ListInstancesRequest.builder()
.maxResults(10)
.build() ;
ListInstancesResponse response = connectClient.listInstances(instancesRequest);
List<InstanceSummary> instances = response.instanceSummaryList();
for (InstanceSummary instance: instances) {
System.out.println("The ARN of the instance is "+instance.arn());
}
} catch (ConnectException e) {
System.out.println(e.getLocalizedMessage());
System.exit(1);
}
}
} Can you please provide the code snippet, using which I can reproduce the issue? And also kindly share the full stacktrace of the error you are receiving. Thank you. Regards, |
Oh no, I made a blunder ... There is no bug. Hence closed the ticket. Sorry for the trouble caused. The exception is an Access Denied Error, because my logging does not have write permissions for that bucket being written to. In a testcase I write to a simulated bucket to fill up the simulated bucket with test data. The settings were not set to use the simulated bucket when I upgraded from aws-sdk-java:2.20.162 to aws-sdk-java:2.21.6 and then ran our test casess to see whether things still work after the upgrade. Reading from the real bucket works with the upgraded version aws-sdk-java:2.21.6. Just having upgraded to aws-sdk-java:2.21.6 seeing an exception I thought it must have been caused by the upgrade to aws-sdk-java:2.21.6 and didn't even have a look at the exception message. My bad ... |
|
Oh no, I made a blunder ... There is no bug. Hence closed the ticket. Sorry for the trouble caused. The exception is an Access Denied Error, because my logging does not have write permissions for that bucket being written to. In a testcase I write to a simulated bucket to fill up the simulated bucket with test data. The settings were not set to use the simulated bucket when I upgraded from aws-sdk-java:2.20.162 to aws-sdk-java:2.21.6 and then ran our test casess to see whether things still work after the upgrade. Reading from the real bucket works with the upgraded version aws-sdk-java:2.21.6. Just having upgraded to aws-sdk-java:2.21.6 seeing an exception I thought it must have been caused by the upgrade to aws-sdk-java:2.21.6 and didn't even have a look at the exception message. My bad ... |
Describe the bug
Login data is provided with accessKey and secretKey
Expected Behavior
Login should still work as with aws-sdk-java:2.20.162
Current Behavior
Access Denied - although connect worked with aws-sdk-java:2.20.162
Reproduction Steps
Do login using accessKey and secretKey using aws-sdk-java:2.21.6. This should fail. Compare with doing connect same way using aws-sdk-java:2.20.162
Possible Solution
No response
Additional Information/Context
No response
AWS Java SDK version used
aws-sdk-java:2.21.6
JDK version used
JDK 17.0.6 (Amazon.com Inc. 17.0.6+10-LTS)
Operating System and version
Windows 10
The text was updated successfully, but these errors were encountered: