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

ClusterNotFoundException is thrown when cluster exists in the account/region #3093

Closed
drullar opened this issue Feb 6, 2024 · 3 comments
Closed
Assignees
Labels
bug This issue is a bug. p3 This is a minor priority issue response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days.

Comments

@drullar
Copy link

drullar commented Feb 6, 2024

Describe the bug

When executing ECSClient.descriveServices(DescribeServicesRequest().withCluster(clusterArn).withServices(serviceArn))
a ClusterNotFoundException exception is thrown, even though the cluster is present and is visible after executing ECSClient.listClusters()

Note: The IAM user with which this method is executed has Full admin permissions.

Expected Behavior

Expected behavior would be to not get the exception when the cluster exists.

Current Behavior

Stack Trace:

Exception in thread "main" com.amazonaws.services.ecs.model.ClusterNotFoundException: Cluster not found. (Service: AmazonECS; Status Code: 400; Error Code: ClusterNotFoundException; Request ID: 1edf19d4-08f0-4b24-a042-1885798c0765; Proxy: null)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1879)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleServiceErrorResponse(AmazonHttpClient.java:1418)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1387)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1157)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:814)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:781)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:755)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:715)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:697)
	at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:561)
	at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:541)
	at com.amazonaws.services.ecs.AmazonECSClient.doInvoke(AmazonECSClient.java:4664)
	at com.amazonaws.services.ecs.AmazonECSClient.invoke(AmazonECSClient.java:4631)
	at com.amazonaws.services.ecs.AmazonECSClient.invoke(AmazonECSClient.java:4620)
	at com.amazonaws.services.ecs.AmazonECSClient.executeListTasks(AmazonECSClient.java:2676)
	at com.amazonaws.services.ecs.AmazonECSClient.listTasks(AmazonECSClient.java:2645)```

### Reproduction Steps

Prerequisites: Have an ecs cluster and ecs service created.

Replace the clusterArn and serviceArn in the below code snippet with the actual arns of your resources.

`ECSClient.descriveServices(DescribeServicesRequest().withCluster(clusterArn).withServices(serviceArn))`

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### AWS Java SDK version used

Any 1.12.X version, including latest

### JDK version used

openjdk 17.0.9 2023-10-17 LTS

### Operating System and version

macOS 13.4 
@drullar drullar added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 6, 2024
@debora-ito
Copy link
Member

@drullar clusters are region specific, make sure you're using the right region in the DescribeServices call.

If you'd like us to troubleshoot this further, please provide the verbose wirelogs of the listClusters and describeServices calls. Make sure to redact any sensitive information (like access keys). You can find instructions on how to enable wirelogs in our Dev Guide - https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-logging.html#sdk-net-logging-verbose

@debora-ito debora-ito added response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Feb 8, 2024
@debora-ito debora-ito self-assigned this Feb 8, 2024
@drullar
Copy link
Author

drullar commented Feb 16, 2024

Hi,

I had the correct region. I suppose that there was some temporary issue with my authentication tot he account and that was causing the weird behavior. Closing my issue.

@drullar drullar closed this as completed Feb 16, 2024
Copy link

This issue is now closed.

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.

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. p3 This is a minor priority issue response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days.
Projects
None yet
Development

No branches or pull requests

2 participants