cloudflare / Stout

A reliable static website deploy tool
MIT License
752 stars 29 forks source link

"deploy" trying to access non-existent file #12

Closed mmautner closed 9 years ago

mmautner commented 9 years ago

I came across an issue when trying to include a Bower component in my deploy directory:

$ stout deploy --bucket <XXX> --key <XXX> --secret <XXX>
panic: open bower_components/ng-imgur/example/js/vendor/angular/angular.js: no such file or directory

goroutine 16 [running]:
runtime.panic(0x373e00, 0xc20806c5d0)
    /Users/zackbloom/g/1.3.1/src/pkg/runtime/panic.c:279 +0xf5
main.must(0x3e5360, 0x0, 0x711850, 0xc20806c5d0, 0x0, 0x0)
    /Users/zackbloom/go/src/github.com/eagerio/stout/src/utils.go:84 +0x61
main.hashFile(0xc20803eb40, 0x3e, 0x0, 0x0, 0x0)
    /Users/zackbloom/go/src/github.com/eagerio/stout/src/deploy.go:48 +0x15a
main.hashFiles(0xc208040300, 0x9, 0x10, 0x0, 0x0)
    /Users/zackbloom/go/src/github.com/eagerio/stout/src/deploy.go:66 +0xfd
main.Deploy(0x3f5670, 0x1, 0x3f5db0, 0x2, 0x3f5db0, 0x2, 0x3f5050, 0x0, 0x3f5050, 0x0, ...)
    /Users/zackbloom/go/src/github.com/eagerio/stout/src/deploy.go:572 +0x1580
main.deployCmd()
    /Users/zackbloom/go/src/github.com/eagerio/stout/src/deploy.go:626 +0xfe
main.main()
    /Users/zackbloom/go/src/github.com/eagerio/stout/src/cli.go:39 +0x117

goroutine 19 [finalizer wait]:
runtime.park(0x226a0, 0x64c578, 0x64b009)
    /Users/zackbloom/g/1.3.1/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0x64c578, 0x64b009)
    /Users/zackbloom/g/1.3.1/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
    /Users/zackbloom/g/1.3.1/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
    /Users/zackbloom/g/1.3.1/src/pkg/runtime/proc.c:1445

Here's a gist that should allow you to reproduce the issue.

This prevents deployment--it appears to be failing when recursively identifying all the files for uploading as part of the deploy, having identified a non-existent file and trying to read the file.

My golang familiarity is not high, or I would look into the source myself!

zackbloom commented 9 years ago

Hi @mmautner. The issue you're referring almost always occurs when you have an HTML file which refers to a javascript or css file which does not actually exist. In your case, my guess is you are inadvertently uploading html files which are inside your bower_components folder. I would recommend you use the files option to ensure that only the .html files you intend are being deployed.

mmautner commented 9 years ago

Thanks! I misunderstood the purpose of the files option there