robfig / glock

MIT License
230 stars 27 forks source link

sync occasionally fails with a "cannot find package" error #27

Closed joeshaw closed 9 years ago

joeshaw commented 9 years ago

Sometimes running glock sync fails:

Step 7 : RUN glock sync github.com/redacted/redacted
 ---> Running in 2baed2746ee2
cannot find package "code.google.com/p/snappy-go" in any of:
    /usr/local/go/src/pkg/code.google.com/p/snappy-go (from $GOROOT)
    /gopath/src/code.google.com/p/snappy-go (from $GOPATH)
time="2015-06-02T15:43:43-04:00" level=info msg="The command [/bin/sh -c glock sync github.com/redacted/redacted] returned a non-zero code: 1" 

The actual package it cannot find varies from failure to failure. I'd say it happens about 10% of the time across all of our Go repositories.

This comes from our continuous integration system, in which we build every commit within a GitHub pull request. We use Docker in the CI system to build a container that can later be pushed and deployed to production servers. The CI system runs on Linux.

I don't think I've seen this on my local development box, which runs OS X, but I also run glock sync very infrequently compared to the CI systems.

joeshaw commented 9 years ago

To try to track things down I started running glock sync with -v, here's the output from one failed build:

Step 10 : RUN glock -v sync github.com/redacted/redacted
 ---> Running in ce5539569f7a
go [get -v -d code.google.com/p/go-uuid]
go [get -v -d github.com/RangelReale/osin]
go [get -v -d github.com/cactus/go-statsd-client]
go [get -v -d github.com/chrismrivera/backoff]
go [get -v -d github.com/codegangsta/cli]
go [get -v -d github.com/crowdmob/goamz]
go [get -v -d github.com/dgrijalva/jwt-go]
go [get -v -d github.com/getsentry/raven-go]
go [get -v -d github.com/gogo/protobuf]
go [get -v -d github.com/iron-io/iron_go]
go [get -v -d github.com/jmoiron/sqlx]
go [get -v -d github.com/joeshaw/customerio]
go [get -v -d github.com/joeshaw/envdecode]
go [get -v -d github.com/joeshaw/httpgzip]
go [get -v -d github.com/joeshaw/httpmethodoverride]
go [get -v -d github.com/joeshaw/iso8601]
go [get -v -d github.com/joeshaw/multierror]
go [get -v -d github.com/joeshaw/rst-extract]
go [get -v -d github.com/jteeuwen/go-bindata]
go [get -v -d github.com/lib/pq]
go [get -v -d github.com/litl/mime]
go [get -v -d github.com/litl/randstring]
go [get -v -d github.com/mischief/pubnub]
go [get -v -d github.com/rlmcpherson/s3gof3r]
go [get -v -d github.com/shopspring/decimal]
go [get -v -d golang.org/x/crypto]
go [get -v -d golang.org/x/net]
go [get -v -d golang.org/x/oauth2]
go [get -v -d golang.org/x/tools]
go [get -v -d google.golang.org/cloud]
go [get -v -d gopkg.in/check.v1]
cannot find package "golang.org/x/net" in any of:
    /usr/local/go/src/golang.org/x/net (from $GOROOT)
    /home/apiary/gopath/src/golang.org/x/net (from $GOPATH)
time="2015-05-18T15:35:34-04:00" level=info msg="The command [/bin/sh -c glock -v sync github.com/redacted/redacted] returned a non-zero code: 1" 

Verbose output suggests that it got golang.org/x/net...

(This repository is different than the one from my first comment, which is why you don't see snappy-go in the list.)

joeshaw commented 9 years ago

Well, for the snappy-go thing apparently it has moved to github and that error pops up consistently. The error message could be improved.

glock sync:

cannot find package "code.google.com/p/snappy-go" in any of:
    /usr/local/Cellar/go/1.4/libexec/src/code.google.com/p/snappy-go (from $GOROOT)
    /Users/joeshaw/src/gosrc/src/code.google.com/p/snappy-go (from $GOPATH)

go get:

package code.google.com/p/snappy-go: unable to detect version control system for code.google.com/ path

(Bleh, neither is great.)

The second comment is the intermittent failure, though.

robfig commented 9 years ago

Hm, seems like glock should at minimum be printing errors from "go get"

joeshaw commented 9 years ago

Yeah. Maybe it is succeeding or somehow otherwise returning a 0 status code?

robfig commented 9 years ago

Pushed an update to the error reporting. Now it looks like this

$ glock sync something
failed to get: code.google.com/p/snappy-go

> go get -v -d code.google.com/p/snappy-go
package code.google.com/p/snappy-go: unable to detect version control system for code.google.com/ path
exit status 1

> import code.google.com/p/snappy-go
cannot find package "code.google.com/p/snappy-go" in any of:
    /Users/robfig/go/src/pkg/code.google.com/p/snappy-go (from $GOROOT)
    /Users/robfig/alpha/gocode/src/code.google.com/p/snappy-go (from $GOPATH)

Thanks for the report!

joeshaw commented 9 years ago

Thanks. I'll deploy this and report back when/if it fails again.