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

location service: dial tcp: lookup geo.us-east-1.amazonaws.com: no such host #1506

Closed
3 tasks done
jaanauati opened this issue Nov 19, 2021 · 10 comments · Fixed by #1518
Closed
3 tasks done

location service: dial tcp: lookup geo.us-east-1.amazonaws.com: no such host #1506

jaanauati opened this issue Nov 19, 2021 · 10 comments · Fixed by #1518
Labels
bug This issue is a bug.

Comments

@jaanauati
Copy link

jaanauati commented Nov 19, 2021

Documentation

Describe the bug

Looks like the geo endpoints are wrongly configured to point to geo.{region}.amazonws.com, which leads to the following error:

operation error Location: DescribePlaceIndex, exceeded maximum number of attempts, 3, https response error StatusCode: 0, RequestID: , request send failed, Get "https://geo.us-east-1.amazonaws.com/places/v0/indexes/my-place-index": dial tcp: lookup geo.us-east-1.amazonaws.com: no such host

After spending some time poking with aws cli (using --debug flag) I found that the actual endpoint for this case should be:
https://places.geo.us-east-1.amazonaws.com (or maps.geo.{region}.amazonaws.com for the case of maps).

https://github.com/aws/aws-sdk-go-v2/blob/main/service/location/internal/endpoints/endpoints.go#L130

Btw, In case that someone else runs into this same issue, I'm currently using the following workaround, which seems to work well:

	configureUrlResolver := func(options *location.Options) {
		resolver := location.EndpointResolverFromURL("https://places.geo.us-east-1.amazonaws.com")
		options.EndpointResolver = resolver
	}
	location_client := location.NewFromConfig(cfg, configureUrlResolver)

Expected behavior

CreatePlaceIndexInput, DescribePlaceIndex, UpdatePlaceIndexInput, and DeletePlaceIndex functions should be able to create, describe, update and delete place index resources.

Current behavior

CreatePlaceIndexInput, DescribePlaceIndex, UpdatePlaceIndexInput, and DeletePlaceIndex functions return the following error:

operation error Location: DescribePlaceIndex, exceeded maximum number of attempts, 3, https response error StatusCode: 0, RequestID: , request send failed, Get "https://geo.us-east-1.amazonaws.com/places/v0/indexes/my-place-index": dial tcp: lookup geo.us-east-1.amazonaws.com: no such host

Steps to Reproduce

	ctx := context.TODO()
	cfg, err := config.LoadDefaultConfig(ctx)
	if err != nil {
		log.Fatal(err)
		return err
	}
	location_client := location.NewFromConfig(cfg)
        indexName := "my-awesome-index"
	details, err := location_client.DescribePlaceIndex(ctx, &location.DescribePlaceIndexInput{IndexName: &indexName})

Possible Solution

maybe including some additional endpoints or adding support for an additional param like: "{resourceType}."geo.{region}.amazonaws.com"

https://github.com/aws/aws-sdk-go-v2/blob/main/service/location/internal/endpoints/endpoints.go#L130

AWS Go SDK version used

v1.11.0

Compiler and Version used

go version go1.16.3 darwin/amd64

Operating System and version

macos 11.4

@jaanauati jaanauati added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 19, 2021
@skmcgrail
Copy link
Member

Thanks for raising this issue @jaanauati, this appears to be a code-generation bug in our operation serializer. The host prefixes like places., tracking., etc. are to be sourced from the model to augment the resolved endpoint. We will need to investigate why our current code-generation logic is not handling this correctly.

@skmcgrail skmcgrail removed the needs-triage This issue or PR still needs to be triaged. label Nov 22, 2021
@karl-dau
Copy link

karl-dau commented Nov 25, 2021

I am facing the same problem, but can't get the workaround to work:

ctx := context.TODO()
cfg, err := config.LoadDefaultConfig(ctx)
if err != nil {
	panic(err)
}

configureUrlResolver := func(options *location.Options) {
    options.EndpointResolver = location.EndpointResolverFromURL("https://tracking.geo.eu-central-1.amazonaws.com")
}
locserv := location.NewFromConfig(cfg, configureUrlResolver)
trackerName := "MyFirstTracker"
out, err := locserv.DescribeTracker(ctx, &location.DescribeTrackerInput{
	TrackerName: &trackerName,
})
if err != nil {
	panic(err)
}

Panics with:

operation error Location: DescribeTracker, https response error StatusCode: 403, RequestID: <redacted>, api error MissingAuthenticationTokenException: Missing Authentication Token

Credentials seems fine (aws cli location works) and I wrote a basic Python program that does the same using boto3 and it works fine.

@jaanauati
Copy link
Author

jaanauati commented Nov 25, 2021 via email

@skmcgrail
Copy link
Member

skmcgrail commented Dec 2, 2021

I have a root cause for this and have a fix that should make it into our next release. We appreciate this bug report, as this issue impacted a few other service clients. Additionally the root cause also uncovered another situation where idempotency token auto-fill behavior was not configured for some service clients.

@skmcgrail
Copy link
Member

The missing SigV4 signing middleware is missing due to a modeling issue that we will work with the service team to get corrected. Until then I have put in a customization that will ensure that the signing middleware is attached to fix that issue.

It looks like that issue in particular is limited to just 6 of the service's operations.

@jaanauati
Copy link
Author

@skmcgrail thank you!, regarding the signature issues please see #1500.

@github-actions
Copy link

github-actions bot commented Dec 3, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or 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.

@skmcgrail
Copy link
Member

Holding this issue open until our next tagged release, but the fix is now merged into main.

@skmcgrail
Copy link
Member

skmcgrail commented Dec 6, 2021

Closing this issue, as the changes have been released. You can now go get github.com/aws/aws-sdk-go-v2/service/[email protected] to resolve this issue.

@github-actions
Copy link

github-actions bot commented Dec 6, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or 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.

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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants