gobinaries icon indicating copy to clipboard operation
gobinaries copied to clipboard

Expose some errors

Open tj opened this issue 4 years ago • 11 comments

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.

tj avatar May 05 '20 14:05 tj

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/[email protected] | sh
  ==> Downloading github.com/nats-io/[email protected]
  ==> Downloading binary for darwin amd64
  ==> Installing nats-server to /usr/local/bin
  ==> Installation complete

wallyqs avatar May 05 '20 18:05 wallyqs

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.

mblarsen avatar May 07 '20 01:05 mblarsen

@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

tj avatar May 07 '20 05:05 tj

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 avatar May 08 '20 00:05 wallyqs

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/[email protected]

wallyqs avatar May 08 '20 06:05 wallyqs

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

tj avatar May 12 '20 09:05 tj

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.

wallyqs avatar May 26 '20 20:05 wallyqs

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

tj avatar May 27 '20 09:05 tj

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

yujunz avatar Jun 26 '20 08:06 yujunz

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

tj avatar Jun 26 '20 08:06 tj

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/[email protected] | sh

  ==> Downloading github.com/Vaccine-Hunters-Canada/[email protected]
  ==> 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)

alvintangz avatar May 20 '21 21:05 alvintangz