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

fatal error: all goroutines are asleep - deadlock! #6

Closed
01AutoMonkey opened this issue Nov 30, 2017 · 9 comments
Closed

fatal error: all goroutines are asleep - deadlock! #6

01AutoMonkey opened this issue Nov 30, 2017 · 9 comments

Comments

@01AutoMonkey
Copy link

When I try to deply, such as s3deploy -v -source=public/ -region=eu-west-2 -bucket=mybucketname.com -key=<mykey> -secret=<mysecret>, I just get:

s3deploy 1.1, commit deb2d965d340f5114b7a307a52f30cdb7a6aa596, built at 2017-08-28T12:04:39Z
fatal error: all goroutines are asleep - deadlock!

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc4200ea44c)
	/usr/local/go/src/runtime/sema.go:56 +0x39
sync.(*WaitGroup).Wait(0xc4200ea440)
	/usr/local/go/src/sync/waitgroup.go:131 +0x72
github.com/bep/s3deploy/lib.Deploy(0xc420118000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/go/src/github.com/bep/s3deploy/lib/deployer.go:206 +0x4c2
main.main()
	/go/src/github.com/bep/s3deploy/main.go:46 +0x1f7

goroutine 5 [chan receive]:
github.com/bep/s3deploy/lib.(*Deployer).worker(0xc4200ea440, 0xc420016180, 0xc4200ea460, 0xc42005e300, 0xc4200161e0)
	/go/src/github.com/bep/s3deploy/lib/deployer.go:383 +0xca
created by github.com/bep/s3deploy/lib.Deploy
	/go/src/github.com/bep/s3deploy/lib/deployer.go:198 +0x3c9

goroutine 6 [chan receive]:
github.com/bep/s3deploy/lib.(*Deployer).worker(0xc4200ea440, 0xc420016180, 0xc4200ea460, 0xc42005e300, 0xc4200161e0)
	/go/src/github.com/bep/s3deploy/lib/deployer.go:383 +0xca
created by github.com/bep/s3deploy/lib.Deploy
	/go/src/github.com/bep/s3deploy/lib/deployer.go:198 +0x3c9

goroutine 7 [chan receive]:
github.com/bep/s3deploy/lib.(*Deployer).worker(0xc4200ea440, 0xc420016180, 0xc4200ea460, 0xc42005e300, 0xc4200161e0)
	/go/src/github.com/bep/s3deploy/lib/deployer.go:383 +0xca
created by github.com/bep/s3deploy/lib.Deploy
	/go/src/github.com/bep/s3deploy/lib/deployer.go:198 +0x3c9

goroutine 8 [chan receive]:
github.com/bep/s3deploy/lib.(*Deployer).worker(0xc4200ea440, 0xc420016180, 0xc4200ea460, 0xc42005e300, 0xc4200161e0)
	/go/src/github.com/bep/s3deploy/lib/deployer.go:383 +0xca
created by github.com/bep/s3deploy/lib.Deploy
	/go/src/github.com/bep/s3deploy/lib/deployer.go:198 +0x3c9

goroutine 9 [chan receive]:
github.com/bep/s3deploy/lib.(*Deployer).worker(0xc4200ea440, 0xc420016180, 0xc4200ea460, 0xc42005e300, 0xc4200161e0)
	/go/src/github.com/bep/s3deploy/lib/deployer.go:383 +0xca
created by github.com/bep/s3deploy/lib.Deploy
	/go/src/github.com/bep/s3deploy/lib/deployer.go:198 +0x3c9

goroutine 10 [chan receive]:
github.com/bep/s3deploy/lib.(*Deployer).worker(0xc4200ea440, 0xc420016180, 0xc4200ea460, 0xc42005e300, 0xc4200161e0)
	/go/src/github.com/bep/s3deploy/lib/deployer.go:383 +0xca
created by github.com/bep/s3deploy/lib.Deploy
	/go/src/github.com/bep/s3deploy/lib/deployer.go:198 +0x3c9

goroutine 11 [chan receive]:
github.com/bep/s3deploy/lib.(*Deployer).worker(0xc4200ea440, 0xc420016180, 0xc4200ea460, 0xc42005e300, 0xc4200161e0)
	/go/src/github.com/bep/s3deploy/lib/deployer.go:383 +0xca
created by github.com/bep/s3deploy/lib.Deploy
	/go/src/github.com/bep/s3deploy/lib/deployer.go:198 +0x3c9

goroutine 12 [chan receive]:
github.com/bep/s3deploy/lib.(*Deployer).worker(0xc4200ea440, 0xc420016180, 0xc4200ea460, 0xc42005e300, 0xc4200161e0)
	/go/src/github.com/bep/s3deploy/lib/deployer.go:383 +0xca
created by github.com/bep/s3deploy/lib.Deploy
	/go/src/github.com/bep/s3deploy/lib/deployer.go:198 +0x3c9

Any ideas?

@bep bep closed this as completed in b93561f Nov 30, 2017
@bep
Copy link
Owner

bep commented Nov 30, 2017

I have pushed a fix that should fix the deadlock issue. Note that I suspect this situation only happens in error situations, so your problem is most likely not 100% fixed, but now it should be easier to debug.

@bep
Copy link
Owner

bep commented Nov 30, 2017

And please let me know if this helped -- if you don't see any error in the console, I may have to dig some more.

@01AutoMonkey
Copy link
Author

01AutoMonkey commented Dec 1, 2017

Using the latest version I get:

s3deploy 1.1.1, commit 06dd326d8838bbf4f62304af49f3a1803a99bed1, built at 2017-11-30T19:12:40Z
Deleted: 0 Uploaded: 0 Skipped: 0 (NaN% changed)

I just cd into my hugo site directory which contains a public/ and execute the command like so (excluding bucket name, key, and secret from example): s3deploy -v -source=public/ -region=eu-west-2 -bucket=<mybucketname> -key=<mykey> -secret=<mysecret>.

I've also set the IAM action permissions for my bucket, just a copy/paste from the README.md and inserted my actual bucket name.

I've tried it with and without a .s3deploy.yml file.

Forestry.io has been handling my deploys up until now, so it's not an empty bucket, but I've also tried deleting all objects in my bucket before executing the command.

@bep
Copy link
Owner

bep commented Dec 1, 2017

This is hard for me to debug with what you say. I have not experienced this, and I have used it a lot.

May be a path issue. Are you on Windows?

@bep
Copy link
Owner

bep commented Dec 1, 2017

@01AutoMonkey see #8 -- while it may not solve your issue, I notice that there are some errors that should be handled better -- I will fix that.

@01AutoMonkey
Copy link
Author

01AutoMonkey commented Dec 1, 2017

I'm on Ubuntu and I've tried all variations of the source path (absolute path, ~/... path, relative path).

Also, playing around with the code I notice d.FileCount() returns 0, which may explain the (NaN% changed).

@bep
Copy link
Owner

bep commented Dec 1, 2017

That is weird, I have several sites that deploys from CircleCI on LInux, e.g.:

https://github.com/bep/bego.io/blob/master/circle.yml

I will do more on the error handling on this in a day or two.

@01AutoMonkey
Copy link
Author

01AutoMonkey commented Dec 3, 2017

Adding print like so:

	// List all files in the remote bucket
	contents, err := destBucket.GetBucketContents()
	if err != nil {
		fmt.Println(err)
		return stats, err
	}

Results in:

s3deploy dev, commit none, built at unknown
Get /test.bucket.is/?delimiter=&marker=&max-keys=1000&prefix=: unsupported protocol scheme ""
Deleted: 0 Uploaded: 0 Skipped: 0 (0% changed)

Which lead me to realize that eu-west-2 isn't part of aws.Regions (maybe it's too new?), if I replace it with eu-west-1 (which is part of aws.Regions) I get a slightly different error:

s3deploy dev, commit none, built at unknown
Get https:/test.bucket.is/?delimiter=&marker=&max-keys=1000&prefix=: 301 response missing Location header
Deleted: 0 Uploaded: 0 Skipped: 0 (0% changed)

The URL is now a bit better but not quite (though it would be wrong anyway given my actual region is eu-west-2.

This is most likely the same error Alan_F got at: https://discourse.gohugo.io/t/howto-deploying-hugo-on-s3-and-cloudfront/2800/26

@bep
Copy link
Owner

bep commented Dec 3, 2017

The solution is probably in #3

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

2 participants