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

workload discovery logs. #529

Closed
mrpackethead opened this issue Jun 19, 2024 · 13 comments
Closed

workload discovery logs. #529

mrpackethead opened this issue Jun 19, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@mrpackethead
Copy link

I'm Getting this error in my /ecs/workload-discovery logs. I'm not seeing any accounts being Imported. I'm running in an organisations mode.

{
"msg": "Cannot read properties of undefined (reading 'AllAwsRegions')",
"stack": "TypeError: Cannot read properties of undefined (reading 'AllAwsRegions')\n at /code/src/lib/apiClient/index.js:143:56\n at Array.map ()\n at getOrgAccounts (/code/src/lib/apiClient/index.js:134:10)\n at async Object.getAccounts (/code/src/lib/utils.js:174:24)\n at async Promise.all (index 0)\n at async discoverResources (/code/src/lib/index.js:19:69)\n at async discover (/code/src/index.js:14:3)",
"level": "error",
"message": "Error in Discovery process.",
"timestamp": "2024-06-19T06:46:23.317Z"
}

@aws folks.. case number 171874402100195

@mrpackethead mrpackethead added the bug Something isn't working label Jun 19, 2024
@svozza
Copy link
Contributor

svozza commented Jun 19, 2024

Looks like a problem with getting information about the Config aggregator. When you deployed, did you provide the name of an existing aggregator at deployment? Can you run the following CLI command: aws configservice describe-configuration-aggregators --configuration-aggregator-names <your-aggregator-name> and paste the output here?

@mrpackethead
Copy link
Author

[cloudshell-user@ip-10-132-68-168 ~]$ aws configservice describe-configuration-aggregators --configuration-aggregator-names name
{
"ConfigurationAggregators": [
{
"ConfigurationAggregatorName": "name",
"ConfigurationAggregatorArn": "arn:aws:config:ap-southeast-2:9xxxxxx0:config-aggregator/config-aggregator-utxgcwgw",
"AccountAggregationSources": [
{
"AccountIds": [
"xxxxx"
],
"AllAwsRegions": false,
"AwsRegions": [
"ap-southeast-2"
]
}
],
"CreationTime": "2024-06-18T00:27:07.889000+00:00",
"LastUpdatedTime": "2024-06-18T00:27:07.890000+00:00"
}
]
}
[cloudshell-user@ip-10-132-68-168 ~]$

@mrpackethead
Copy link
Author

I replaed 'name' for aggreagator name, and can confirm it was ok. ( just to obfiscate real accounts )
lookign at the order of how i deployed things, it may be possible that the config aggregator was not operational before the solution was deployed.

@svozza
Copy link
Contributor

svozza commented Jun 19, 2024

As soon as the aggregator became operational the discovery process should have picked it up on its next run. Can you go the discovery process logs and search for a line in the logs with the following string: Organization source info and paste that line in here. The steps to find the ECS logs are:

To retrieve the logs for the discovery component:

  1. Sign in to the AWS Management Console in the account you deployed Workload Discovery on AWS in.
  2. Choose Services.
  3. From the collection of services, choose CloudWatch.
  4. Under the Log section, select Log Groups.
  5. Search for the log group /ecs/workload-discovery-task.
  6. Select the latest Log Stream tab.

@mrpackethead
Copy link
Author

{
"level": "info",
"message": "Organization source info.",
"timestamp": "2024-06-19T10:46:28.081Z"
}

@mrpackethead
Copy link
Author

Its crashing out on this code.

regions: OrganizationAggregationSource.AllAwsRegions

@svozza
Copy link
Contributor

svozza commented Jun 19, 2024

It looks like the aggregator you've created is not an an organization-wide aggregator. Either create a new aggregator of the required type or the just set the ConfigAggregatorName CFN paramter in the WD template to be blank and one will be created for you.

@mrpackethead
Copy link
Author

ok, i've created a new one, that is an org-wide aggreagtor and its not erroring now. Just have to see how the collection is going.

@mrpackethead
Copy link
Author

Seems to be doing the job. Thanks for your help.

@svozza
Copy link
Contributor

svozza commented Jun 19, 2024

Nice! I think we can make the error message here better, it shouldn't fail silently if that field is missing so I've added that to the backlog.

@svozza
Copy link
Contributor

svozza commented Jun 19, 2024

I'm going to leave this open until I've released the the change to the error message

@mrpackethead
Copy link
Author

Yes, helpful error messages really help..

@svozza
Copy link
Contributor

svozza commented Jun 25, 2024

This has been fixed in v2.1.9 that was released yesterday.

@svozza svozza closed this as completed Jun 25, 2024
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
Development

No branches or pull requests

2 participants