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

Unable to register scalable target #25

Open
rddefauw opened this issue Feb 4, 2020 · 9 comments
Open

Unable to register scalable target #25

rddefauw opened this issue Feb 4, 2020 · 9 comments

Comments

@rddefauw
Copy link

rddefauw commented Feb 4, 2020

I've followed the instructions and created the CFN stack. I tested my API manually. I'm now trying to register the scalable target on the CLI:

aws application-autoscaling register-scalable-target \
    --service-namespace custom-resource \
    --scalable-dimension custom-resource:ResourceType:Property \
    --resource-id file://~/tmp/custom-resource-id.txt \
    --min-capacity 1 --max-capacity 15 \
    --region us-east-1

However, I get this error:

An error occurred (ValidationException) when calling the RegisterScalableTarget operation: User is missing the following permissions: execute-api:Invoke:PATCH, execute-api:Invoke:GET

My IAM user has full admin access in the account, and just to be sure, I added an online policy to my user that grants the specific permissions on the API.

I am not sure how to get past this permission problem.

@Nayanish
Copy link
Contributor

Nayanish commented Feb 4, 2020 via email

@rddefauw
Copy link
Author

rddefauw commented Feb 4, 2020

I've made some progress in debugging this. I switched to using boto3 and started getting a different error:

Reason: Scalable resource not found

Checking the API Gateway logs, I saw this:

Execution failed due to configuration error: Invalid permissions on Lambda function

And I solved that by deleting and recreating my CloudFormation stack; I think that the API was caching an old version of the Lambda function ID.

In summary, things are working with boto3, but still not with the CLI. My API uses Lambda functions in proxy mode with IAM authentication.

@Reneehi
Copy link
Contributor

Reneehi commented Feb 11, 2020

We might need to get some more information from you to troubleshoot further. Are you able to post this to the AWS discussion forum at https://forums.aws.amazon.com/forum.jspa?forumID=291?

@rddefauw
Copy link
Author

Looks like user error: I had a newline marker at the end of the custom resource txt file.

Generally the error messages for custom resources are not as helpful as they could be. For example:

  • Newline in the resource file yields a misleading permission error message. Shouldn't it just tell me that it can't find the API endpoint?
  • A malformed JSON response from the API yields a generic 'Error reading entity from input stream' message, which is probably coming from a low level JSON or HTTP library.

@yujin19
Copy link

yujin19 commented Jun 10, 2021

I hit error below

An error occurred (ValidationException) when calling the RegisterScalableTarget operation: Unsupported service namespace, resource type or scalable dimension

I created my own apidateway on api gateway console, I can get response 200, but this url cannot be used to register the ScalableTarget.
If I use the api created from the template here, https://github.com/aws-samples/aws-application-auto-scaling-kinesis/blob/master/cloudformation/custom-application-autoscaling-kinesis.yaml, I can register successfully, is there any restrictions when config the api?

@Reneehi
Copy link
Contributor

Reneehi commented Jun 11, 2021

Hi, Can you check whether you have a service-linked role for Application Auto Scaling in your account? I noticed that the example Kinesis template you shared deploys an alternative IAM role configuration. If this is the issue, then you can fix it by adding the service-linked role for custom resources to your account.
https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-service-linked-roles.html

@yujin19
Copy link

yujin19 commented Jun 15, 2021

Anyone hit this error:

Validation failed for resource,  scalable dimension: custom-resource:ResourceType:Property. Reason: java.net.SocketTimeoutException: Read timed out (Service: AWSApplicationAutoScaling; Status Code: 400; Error Code: ValidationException

@pprandive
Copy link

I hit error below

An error occurred (ValidationException) when calling the RegisterScalableTarget operation: Unsupported service namespace, resource type or scalable dimension

I created my own apidateway on api gateway console, I can get response 200, but this url cannot be used to register the ScalableTarget.
If I use the api created from the template here, https://github.com/aws-samples/aws-application-auto-scaling-kinesis/blob/master/cloudformation/custom-application-autoscaling-kinesis.yaml, I can register successfully, is there any restrictions when config the api?

Were you able to resolve it? I am also facing the same issue. Could you please let me know if you had any success.
Thanks!
-Prafulla

@cheelim1
Copy link

cheelim1 commented Oct 8, 2024

I'm facing the similar error as well, however it's Reason: Error reading entity from input stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants