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

Access Denied with aws-sdk-java:2.21.6. Worked with aws-sdk-java:2.20.162 #4647

Closed
oplohmann opened this issue Oct 31, 2023 · 4 comments
Closed
Assignees
Labels
bug This issue is a bug. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.

Comments

@oplohmann
Copy link

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

@oplohmann oplohmann added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 31, 2023
@bhoradc bhoradc self-assigned this Oct 31, 2023
@bhoradc bhoradc removed the needs-triage This issue or PR still needs to be triaged. label Oct 31, 2023
@bhoradc
Copy link

bhoradc commented Oct 31, 2023

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,
Chaitanya

@bhoradc bhoradc added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. label Oct 31, 2023
@oplohmann
Copy link
Author

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

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@oplohmann
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.
Projects
None yet
Development

No branches or pull requests

2 participants