tj / gobinaries

Golang binaries compiled on-demand for your system
https://gobinaries.com/
MIT License
809 stars 31 forks source link

Expose some errors #25

Open tj opened 4 years ago

tj commented 4 years ago

Right now v2+ fail just due to how Go modules work, but in any case it might be nice to expose some errors, otherwise it's just a silent 500 and people are probably wondering what's going on.

For example:

building: exit status 1: go: finding github.com/nats-io/nats-server v2.1.6
go: finding github.com/nats-io/nats-server v2.1.6
go: errors parsing go.mod: /home/go.mod:5: require github.com/nats-io/nats-server: version "v2.1.6" invalid: module contains a go.mod file,
so major version must be compatible: should be v0 or v1, not v2

I'm not sure what would be best here, typically not a great idea to expose internal issues.

wallyqs commented 4 years ago

Thanks for the update! I was wondering what was going on, just confirmed that the last NATS v1 series is able to be be installed without issues:

curl -sf https://gobinaries.com/nats-io/nats-server@v1.4.1 | sh
  ==> Downloading github.com/nats-io/nats-server@v1.4.1
  ==> Downloading binary for darwin amd64
  ==> Installing nats-server to /usr/local/bin
  ==> Installation complete
mblarsen commented 4 years ago

Yeah, I'm assuming https://github.com/caddyserver/caddy@2 is failing because of Go 1.14 requirement.

Do you have any concerns exposing something that shouldn't be exposed?

Also, I can imagine many 500 won't make much sense to the end user, but probably coupled with some random error token it could be useful for debugging an issue.

tj commented 4 years ago

@mblarsen yep same thing:

building: exit status 1: go: finding github.com/caddyserver/caddy v2.0.0
go: finding github.com/caddyserver/caddy v2.0.0
go: errors parsing go.mod:
/home/go.mod:5: require github.com/caddyserver/caddy: version "v2.0.0" invalid: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2
wallyqs commented 4 years ago

Hi @tj , just made a small PR to solve this issue here. Confirmed that works now for NATS builds: https://github.com/tj/gobinaries/pull/27

wallyqs commented 4 years ago

Btw for caddy support is going to be slightly trickier for v2, since the current approach needs the main to be at the root level of the repo and for caddy this is at cmd/main.go, so with v2 module support the path to install caddy v2 would have to be like this for go get

go get github.com/caddyserver/caddy/v2/cmd@v2.0.0
tj commented 4 years ago

Hmm maybe the @version should be optional in these cases, looks a bit awkward haha

wallyqs commented 4 years ago

Thanks again @tj. An update on this one, since this is fixed https://github.com/tj/gobinaries/pull/27 it should be possible for the server to build caddy, but still won't work right now (probably) because takes caddy takes longer than 100 seconds to be built.

tj commented 4 years ago

ahh darn, might not be a reasonable way around that since it's a Cloudflare limitation (without some enterprise package at least). #16 might be relevant since Caddy has binaries already, it could just serve/cache those

yujunz commented 4 years ago

It would be good to give an error on 100s timeout.

tj commented 4 years ago

@yujunz yeah we'd probably have to time out a bit earlier in Go to have a chance to respond, but SGTM

alvintangz commented 3 years ago

Getting a 500 error for Vaccine-Hunters-Canada/VaxFinder-admin-cli. It would be nice to have an error message provided somewhere in order to know how to proceed.

curl -sf https://gobinaries.com/Vaccine-Hunters-Canada/VaxFinder-admin-cli@v1.0.1 | sh

  ==> Downloading github.com/Vaccine-Hunters-Canada/VaxFinder-admin-cli@v1.0.1
  ==> Downloading binary for darwin amd64

  Error downloading, got 500 response from server

(since this post I've removed v1.0.1 tag from the repo and v0.0.0 exists but still doesn't work)