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

Tags cannot be fetched for aws_ecs_service table #2388

Closed
thomasklemm opened this issue Jan 30, 2025 · 8 comments · Fixed by #2410
Closed

Tags cannot be fetched for aws_ecs_service table #2388

thomasklemm opened this issue Jan 30, 2025 · 8 comments · Fixed by #2410
Assignees
Labels
bug Something isn't working

Comments

@thomasklemm
Copy link
Contributor

thomasklemm commented Jan 30, 2025

Describe the bug

ERROR: rpc error: code = Unknown desc = my_aws_account: operation error ECS: ListTagsForResource, https response error StatusCode: 400, RequestID: c5b155da-7eb3-42d7-a94b-d7f3cf2e32d7, InvalidParameterException: Long arn format must be used for tagging operations

ERROR: rpc error: code = Unknown desc = my_aws_account: table 'aws_ecs_service' column 'tags' requires hydrate data from getEcsServiceTags, which failed with error operation error ECS: ListTagsForResource, https response error StatusCode: 400, RequestID: 076ed52f-8f0e-43b9-af89-3728995bb52b, InvalidParameterException: Long arn format must be used for tagging operations.

Steampipe version (steampipe -v)
Steampipe v1.0.2

Plugin version (steampipe plugin list)
hub.steampipe.io/plugins/turbot/aws@latest | 1.5.0

To reproduce

select 
  account_id,
  region,
  arn,
  tags -- Fetching tags causes the issue
from
  aws_ecs_service;

Expected behavior
Tags for aws_ecs_service should get returned like for other tables.

Additional context
None

@thomasklemm thomasklemm added the bug Something isn't working label Jan 30, 2025
@ParthaI ParthaI self-assigned this Jan 30, 2025
@ParthaI
Copy link
Contributor

ParthaI commented Feb 7, 2025

Hello @thomasklemm,

I attempted to replicate the issue in our environment but was unable to reproduce the error. Every time I ran the query, I successfully retrieved the expected results.

Query Output:

> select service_name, tags_src, tags from aws_ecs_service;
+-----------------+-------------------------------------------------------------+-----------------------------+
| service_name    | tags_src                                                    | tags                        |
+-----------------+-------------------------------------------------------------+-----------------------------+
| test-53-service | [{"Key":"help","Value":"me"},{"Key":"foo1","Value":"bar1"}] | {"foo1":"bar1","help":"me"} |
+-----------------+-------------------------------------------------------------+-----------------------------+

Time: 2.0s. Rows returned: 0. Rows fetched: 1. Hydrate calls: 1.

Scans:
  1) aws_ecs_service.aws: Time: 0.9s. Fetched: 1. Hydrates: 1.

Could you please provide more details on the reproduction steps so I can better investigate the issue?

  • Does this occur for a specific cluster type/service (e.g., AWS Fargate (serverless) or Amazon EC2 instances)?
  • Are there any specific conditions under which the issue occurs?

Looking forward to your insights! 🚀

@kaushikkishore
Copy link
Contributor

@ParthaI This is happening for older version of ecs. which could be approx 2019 or older. so it was using the long version of arns
which is indicated in the errors.
InvalidParameterException: Long arn format must be used for tagging operations.

@ParthaI
Copy link
Contributor

ParthaI commented Feb 11, 2025

Hey @kaushikkishore,

Could you please share the ARN format used in the older version of ECS? Isn't it the same as:
arn:aws:ecs:<region>:<account_id>:service/<cluster_name>/<service_name>?

Also, does AWS support multiple ARN formats for ECS services? Would love to get clarity on this. Thanks!

@kaushikkishore
Copy link
Contributor

Adding the documents given by the amazon here for clarity. Here they have mentioned that what is current arn and what would be the new ARN.

Image

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids
https://aws.amazon.com/blogs/compute/migrating-your-amazon-ecs-deployment-to-the-new-arn-and-resource-id-format-2/

@ParthaI
Copy link
Contributor

ParthaI commented Feb 11, 2025

Oh, Thanks @kaushikkishore, for the clarification. Will push a fix by addressing this issue!

@ParthaI
Copy link
Contributor

ParthaI commented Feb 19, 2025

Hello @kaushikkishore / @thomasklemm,

I have pushed a fix in the PR branch issue-2388, addressing this issue. With this update, we will now retrieve tag details for older resources instead of encountering an error.

However, I could not test it as our environment does not have any older services. It would be greatly appreciated if you could test the changes in the PR branch and share your feedback.

Thank you for your time and support!

@thomasklemm
Copy link
Contributor Author

@ParthaI Great, would try it out! Is there a way build in to steampipe plugin install to use the plugin from the branch, or would cloning the repo and running make be the best approach (in the Dockerfile)?

@ParthaI
Copy link
Contributor

ParthaI commented Feb 19, 2025

To use the plugin from the branch, cloning the repository and running make would be the best approach for now.

Here are the steps to do so:

misraved pushed a commit that referenced this issue Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants