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

cloudformation.WaitUntilStackCreateComplete waits forever #92

Closed
michaeleekk opened this issue Jan 12, 2018 · 7 comments · Fixed by #102
Closed

cloudformation.WaitUntilStackCreateComplete waits forever #92

michaeleekk opened this issue Jan 12, 2018 · 7 comments · Fixed by #102
Labels
bug This issue is a bug.

Comments

@michaeleekk
Copy link

Version of AWS SDK for Go?

{
	"checksumSHA1": "VsyHSneU5fMUAaQDQ1BAqZcvrG0=",
	"path": "github.com/aws/aws-sdk-go-v2",
	"revision": "01b01bc24609090862fbae454a86704b75a0f3b3",
	"revisionTime": "2018-01-11T17:45:17Z"
},

Version of Go (go version)?

1.9.2

What issue did you see?

I was just tried to upgrade from v1 to v2. I'm using cloudformation API. I could successfully created a stack with CreateStackRequest and got the stack id. But then when I used WaitUntilStackCreateComplete, it never returned.

Steps to reproduce

	// create stack
	req := client.CreateStackRequest(&input)
	output, err := req.Send()
	if err != nil {
		return
	}
	fmt.Println(output)

	// wait the stack to be created
	describeInput := cf.DescribeStacksInput{
		StackName: output.StackId,
	}
	fmt.Printf("Waiting until the stack is created...")
	if err = client.WaitUntilStackCreateComplete(&describeInput); err != nil {
		fmt.Println(err)
		deleteStack(stackId)
		return
	}
	fmt.Println("Done.")

This is a snippet of my code. I never saw the Done printing out.

If you have have an runnable example, please include it.

@Doug-AWS
Copy link

I just wrote an example for the developer guide, but don't have the text for the topic written yet. I tested it against the template S3_Website_Bucket_With_Retain_On_Delete.template, which I found at https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/sample-templates-services-us-west-2.html#w2ab2c23c48c13c33.

https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/go/example_code/cloudformation/CfnCreateStack.go

@jasdel
Copy link
Contributor

jasdel commented Jan 12, 2018

Thanks for letting us know about this @michaeleekk. Do you know if this waiting method works correctly with the v1 sdk?

Also if you could enable logging by setting LogLevel in the service client or Config before the client is created. To aws.LogDebugWithHTTPBody. it will print the request and response to stdout. This will help debugging this issue a lot.

@michaeleekk
Copy link
Author

Thanks @Doug-AWS, but sadly I think that’s what I did.

@jasdel I can confirm that the exact same program works for v1. But the log level check, I think I could only do it next Monday. Will get back to this issue when I have more info.

@jasdel jasdel added dependencies This issue is a problem in a dependency. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed dependencies This issue is a problem in a dependency. labels Jan 12, 2018
@robertojrojas
Copy link

robertojrojas commented Jan 17, 2018

I'm running into a similar issue with the method ec2Svc.WaitUntilInstanceStatusOk(...). It works well on v1, but on v2 waits until it the error ResourceNotReady: exceeded wait attempts is returned.

Here is a sample code to reproduce the issue.

main-v2.go.txt

Here is a sample log

aws-sdk-go-v2-issue-92.txt

@jasdel
Copy link
Contributor

jasdel commented Jan 17, 2018

Thanks for the sample code and log. I think i've identified the issue with the waiters. The Waiters are failing because of the typed enumerations adding are causing the reflection based type comparison to fail because a typed aliased string does not DeepEqual with a regular string.

@jasdel jasdel added bug This issue is a bug. and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Jan 17, 2018
jasdel added a commit to jasdel/aws-sdk-go-v2 that referenced this issue Jan 18, 2018
…o string

Fixes the SDK's internal DeepEqual function to consider string aliase
values the same as strings, and string pointers. This resolves the
conflict of SDK's waiter models not being typed values.

Fix aws#92
@jasdel
Copy link
Contributor

jasdel commented Jan 18, 2018

I've put out PR #102 which corrects the SDK's behavior and no longer waits until a waiter expires.

jasdel added a commit that referenced this issue Jan 18, 2018
…o string (#102)

Fixes the SDK's internal DeepEqual function to consider string alias
values the same as strings, and string pointers. This resolves the
conflict of SDK's waiter models not being typed values.

Fix #92
@jasdel
Copy link
Contributor

jasdel commented Jan 18, 2018

Thanks for brining this issue to our attention. we've merged in #102 which corrects this issue. Let us know if you run into any additional issues, or have feedback.

jasdel added a commit to jasdel/aws-sdk-go-v2 that referenced this issue Mar 8, 2018
Services
---
* Synced the V2 SDK with latests AWS service API definitions.

Breaking Changes
---
* `private/mode/api`: Refactor service paginator helpers to iterator pattern ([aws#119](aws#119))
	* Refactors the generated service client paginators to be an iterator pattern. This pattern improves usability while removing the need for callbacks.
	* See the linked PR for an example.
* `private/model/api`: Removes setter helpers from service API types ([aws#101](aws#101))
	* Removes the setter helper methods from service API types. Removing clutter and noise from the API type's signature.
	* Based on feedback [aws#81][aws#81]
* `aws`: Rename CanceledErrorCode to ErrCodeRequestCanceled ([aws#131](aws#131))
	* Renames CanceledErrorCode to correct naming scheme.

SDK Bugs
---
* `internal/awsutil`: Fix DeepEqual to consider string alias type equal to string ([aws#102](aws#102))
	* Fixes SDK waiters not detecting the correct condition is met. [aws#92](aws#92)
* `aws/external`: Fix EnvConfig misspelled container endpoint path getter ([aws#106](aws#106))
	* This caused the type to not satisfy the ContainerCredentialsEndpointPathProvider interface.
	* Fixes [aws#105](aws#105)
* `service/s3/s3crypto`: Fix S3Crypto's handling of TagLen ([aws#107](aws#107))
	* Fixes the S3Crypto's handling of TagLen to only be set if present.
	* V2 Fix for [aws/aws-sdk-go#1742](aws/aws-sdk-go#1742)
* `private/model/api`: Update SDK service client initialization documentation ([aws#141](aws#141))
	* Updates the SDK's service initialization doc template to reflect the v2 SDK's configuration update change from v1.
	* Related to [aws#136](aws#136)

SDK Enhancements
---
* `aws`: Improve pagination unit tests ([aws#97](aws#97))
	* V2 port of [aws/aws-sdk-go#1733](aws/aws-sdk-go#1733)
* `aws/external`: Add example for shared config and static credential helper ([aws#109](aws#109))
	* Adds examples for the  config helpers; WithSharedConfigProfile, WithCredentialsValue, WithMFATokenFunc.
* `private/model/api`: Add validation to prevent collision of api defintions ([aws#112](aws#112))
	* V2 port of [aws/aws-sdk-go#1758](aws/aws-sdk-go#1758)
* `aws/ec2metadata`: Add support for AWS_EC2_METADATA_DISABLED env var ([aws#128](aws#128))
	* When this environment variable is set. The SDK's EC2 Metadata Client will not attempt to make requests. All requests made with the EC2 Metadata Client will fail.
	* V2 port of [aws/aws-sdk-go#1799](aws/aws-sdk-go#1799)
* Add code of conduct ([aws#138](aws#138))
* Update SDK README dep usage ([aws#140](aws#140))
jasdel added a commit to jasdel/aws-sdk-go-v2 that referenced this issue Mar 8, 2018
Services
---
* Synced the V2 SDK with latests AWS service API definitions.

Breaking Changes
---
* `private/mode/api`: Refactor service paginator helpers to iterator pattern (aws#119)
	* Refactors the generated service client paginators to be an iterator pattern. This pattern improves usability while removing the need for callbacks.
	* See the linked PR for an example.
* `private/model/api`: Removes setter helpers from service API types (aws#101)
	* Removes the setter helper methods from service API types. Removing clutter and noise from the API type's signature.
	* Based on feedback aws#81
* `aws`: Rename CanceledErrorCode to ErrCodeRequestCanceled (aws#131)
	* Renames CanceledErrorCode to correct naming scheme.

SDK Bugs
---
* `internal/awsutil`: Fix DeepEqual to consider string alias type equal to string (aws#102)
	* Fixes SDK waiters not detecting the correct condition is met. aws#92
* `aws/external`: Fix EnvConfig misspelled container endpoint path getter (aws#106)
	* This caused the type to not satisfy the ContainerCredentialsEndpointPathProvider interface.
	* Fixes aws#105
* `service/s3/s3crypto`: Fix S3Crypto's handling of TagLen (aws#107)
	* Fixes the S3Crypto's handling of TagLen to only be set if present.
	* V2 Fix for aws/aws-sdk-go#1742
* `private/model/api`: Update SDK service client initialization documentation (aws#141)
	* Updates the SDK's service initialization doc template to reflect the v2 SDK's configuration update change from v1.
	* Related to aws#136

SDK Enhancements
---
* `aws`: Improve pagination unit tests (aws#97)
	* V2 port of aws/aws-sdk-go#1733
* `aws/external`: Add example for shared config and static credential helper (aws#109)
	* Adds examples for the  config helpers; WithSharedConfigProfile, WithCredentialsValue, WithMFATokenFunc.
* `private/model/api`: Add validation to prevent collision of api defintions (aws#112)
	* V2 port of aws/aws-sdk-go#1758
* `aws/ec2metadata`: Add support for AWS_EC2_METADATA_DISABLED env var (aws#128)
	* When this environment variable is set. The SDK's EC2 Metadata Client will not attempt to make requests. All requests made with the EC2 Metadata Client will fail.
	* V2 port of aws/aws-sdk-go#1799
* Add code of conduct (aws#138)
* Update SDK README dep usage (aws#140)
jasdel added a commit to jasdel/aws-sdk-go-v2 that referenced this issue Mar 8, 2018
Services
---
* Synced the V2 SDK with latests AWS service API definitions.

Breaking Changes
---
* `private/mode/api`: Refactor service paginator helpers to iterator pattern (aws#119)
	* Refactors the generated service client paginators to be an iterator pattern. This pattern improves usability while removing the need for callbacks.
	* See the linked PR for an example.
* `private/model/api`: Removes setter helpers from service API types (aws#101)
	* Removes the setter helper methods from service API types. Removing clutter and noise from the API type's signature.
	* Based on feedback aws#81
* `aws`: Rename CanceledErrorCode to ErrCodeRequestCanceled (aws#131)
	* Renames CanceledErrorCode to correct naming scheme.

SDK Bugs
---
* `internal/awsutil`: Fix DeepEqual to consider string alias type equal to string (aws#102)
	* Fixes SDK waiters not detecting the correct condition is met. aws#92
* `aws/external`: Fix EnvConfig misspelled container endpoint path getter (aws#106)
	* This caused the type to not satisfy the ContainerCredentialsEndpointPathProvider interface.
	* Fixes aws#105
* `service/s3/s3crypto`: Fix S3Crypto's handling of TagLen (aws#107)
	* Fixes the S3Crypto's handling of TagLen to only be set if present.
	* V2 Fix for aws/aws-sdk-go#1742
* `private/model/api`: Update SDK service client initialization documentation (aws#141)
	* Updates the SDK's service initialization doc template to reflect the v2 SDK's configuration update change from v1.
	* Related to aws#136

SDK Enhancements
---
* `aws`: Improve pagination unit tests (aws#97)
	* V2 port of aws/aws-sdk-go#1733
* `aws/external`: Add example for shared config and static credential helper (aws#109)
	* Adds examples for the  config helpers; WithSharedConfigProfile, WithCredentialsValue, WithMFATokenFunc.
* `private/model/api`: Add validation to prevent collision of api defintions (aws#112)
	* V2 port of aws/aws-sdk-go#1758
* `aws/ec2metadata`: Add support for AWS_EC2_METADATA_DISABLED env var (aws#128)
	* When this environment variable is set. The SDK's EC2 Metadata Client will not attempt to make requests. All requests made with the EC2 Metadata Client will fail.
	* V2 port of aws/aws-sdk-go#1799
* Add code of conduct (aws#138)
* Update SDK README dep usage (aws#140)
jasdel added a commit that referenced this issue Mar 8, 2018
Services
---
* Synced the V2 SDK with latests AWS service API definitions.

Breaking Changes
---
* `private/mode/api`: Refactor service paginator helpers to iterator pattern (#119)
	* Refactors the generated service client paginators to be an iterator pattern. This pattern improves usability while removing the need for callbacks.
	* See the linked PR for an example.
* `private/model/api`: Removes setter helpers from service API types (#101)
	* Removes the setter helper methods from service API types. Removing clutter and noise from the API type's signature.
	* Based on feedback #81
* `aws`: Rename CanceledErrorCode to ErrCodeRequestCanceled (#131)
	* Renames CanceledErrorCode to correct naming scheme.

SDK Bugs
---
* `internal/awsutil`: Fix DeepEqual to consider string alias type equal to string (#102)
	* Fixes SDK waiters not detecting the correct condition is met. #92
* `aws/external`: Fix EnvConfig misspelled container endpoint path getter (#106)
	* This caused the type to not satisfy the ContainerCredentialsEndpointPathProvider interface.
	* Fixes #105
* `service/s3/s3crypto`: Fix S3Crypto's handling of TagLen (#107)
	* Fixes the S3Crypto's handling of TagLen to only be set if present.
	* V2 Fix for aws/aws-sdk-go#1742
* `private/model/api`: Update SDK service client initialization documentation (#141)
	* Updates the SDK's service initialization doc template to reflect the v2 SDK's configuration update change from v1.
	* Related to #136

SDK Enhancements
---
* `aws`: Improve pagination unit tests (#97)
	* V2 port of aws/aws-sdk-go#1733
* `aws/external`: Add example for shared config and static credential helper (#109)
	* Adds examples for the  config helpers; WithSharedConfigProfile, WithCredentialsValue, WithMFATokenFunc.
* `private/model/api`: Add validation to prevent collision of api defintions (#112)
	* V2 port of aws/aws-sdk-go#1758
* `aws/ec2metadata`: Add support for AWS_EC2_METADATA_DISABLED env var (#128)
	* When this environment variable is set. The SDK's EC2 Metadata Client will not attempt to make requests. All requests made with the EC2 Metadata Client will fail.
	* V2 port of aws/aws-sdk-go#1799
* Add code of conduct (#138)
* Update SDK README dep usage (#140)
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.

4 participants