google / minions

Distributed filesystem scanner
Apache License 2.0
130 stars 12 forks source link

no such package '@com_google_protobuf//' #16

Closed MohamedElqdusy closed 6 years ago

MohamedElqdusy commented 6 years ago

I have tried to build an overlord: $ bazel build //go/overlord/runner then, I got the ERROR:

ERROR: /home/user/goworkspace/src/github.com/google/minions/src/proto/overlord/BUILD.bazel:4:1: every rule of type proto_library implicitly depends upon the target '@com_google_protobuf//:protoc', but this target could not be found because of: no such package '@com_google_protobuf//': java.io.IOException: thread interrupted
ERROR: Analysis of target '//go/overlord/runner:runner' failed; build aborted: no such package '@com_google_protobuf//': java.io.IOException: thread interrupted
INFO: Elapsed time: 677.133s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (42 packages loaded)
paradoxengine commented 6 years ago

I'm struggling to repro this issue. I'm starting from a clean git clone, clean bazel, and then building the target you mention. Everything builds correctly. It's also puzzling that the target that is failing for you is also built just fine by Travis.

Can you tell me a bit more about your setup to help me reproduce please? Local changes if any and version of bazel would be a starting point, I guess (though I'm no Bazel debugging expert). Can you build any other target successfully?

MohamedElqdusy commented 6 years ago

I use Ubuntu, I have updated Bazel with Build label: 0.16.0. $ bazel build -s //go/overlord/runner

Starting local Bazel server and connecting to it...
... still trying to connect to local Bazel server after 10 seconds ...
INFO: SHA256 (https://github.com/bazelbuild/buildtools/archive/4fe6acf537e980ff6878a51e5894605be221224c.zip) = 43c2df6ce1bd01b4d8173efe0795b05b19240f24ea33fde3694096f7b6043f8a
INFO: SHA256 (https://github.com/bazelbuild/rules_docker/archive/v0.4.0.tar.gz) = 6dede2c65ce86289969b907f343a1382d33c14fbce5e30dd17bb59bb55bb6593
INFO: SHA256 (https://codeload.github.com/google/protobuf/zip/ce044817c7ba0aea27c3fd8e496635d94d20a755) = ff88397a1eac8aab1dc71459399b1e888590141e260d0fef2919a8d864c36599
ERROR: /home/user/.cache/bazel/_bazel_user/20cd8ee227bd526a8bd4226d223c70ba/external/org_golang_google_grpc/transport/BUILD.bazel:3:1: no such package '@go_googleapis//google/rpc': Traceback (most recent call last):
    File "/home/user/.cache/bazel/_bazel_user/20cd8ee227bd526a8bd4226d223c70ba/external/io_bazel_rules_go/go/private/tools/overlay_repository.bzl", line 64
        _check_execute(ctx, ["git", "clone", "-n", ctx.at..."], ...))
    File "/home/user/.cache/bazel/_bazel_user/20cd8ee227bd526a8bd4226d223c70ba/external/io_bazel_rules_go/go/private/tools/overlay_repository.bzl", line 101, in _check_execute
        fail((((message + "\n") + res.stdout)...))
failed to clone https://github.com/googleapis/googleapis
Timed out; also encountered an error while attempting to retrieve output and referenced by '@org_golang_google_grpc//transport:go_default_library'
ERROR: Analysis of target '//go/overlord/runner:runner' failed; build aborted: no such package '@go_googleapis//google/rpc': Traceback (most recent call last):
    File "/home/user/.cache/bazel/_bazel_user/20cd8ee227bd526a8bd4226d223c70ba/external/io_bazel_rules_go/go/private/tools/overlay_repository.bzl", line 64
        _check_execute(ctx, ["git", "clone", "-n", ctx.at..."], ...))
    File "/home/user/.cache/bazel/_bazel_user/20cd8ee227bd526a8bd4226d223c70ba/external/io_bazel_rules_go/go/private/tools/overlay_repository.bzl", line 101, in _check_execute
        fail((((message + "\n") + res.stdout)...))
failed to clone https://github.com/googleapis/googleapis
Timed out; also encountered an error while attempting to retrieve output
INFO: Elapsed time: 2014.797s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (67 packages loaded)
paradoxengine commented 6 years ago

Ok, I'm running 0.15.2 locally so updating to debug further. However, there is a fairly clear error on cloning the googleapis repo. Can you successfully clone https://github.com/googleapis/googleapis from the command line from your box? (I can't begin to imagine why that would even fail, but let's have a look at that too just in case)

MohamedElqdusy commented 6 years ago

I have tried to do so $ go get github.com/googleapis/googleapis

# cd .; git clone https://github.com/googleapis/googleapis /home/user/goworkspace/src/github.com/googleapis/googleapis
Cloning into '/home/user/goworkspace/src/github.com/googleapis/googleapis'...
error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
package github.com/googleapis/googleapis: exit status 128
paradoxengine commented 6 years ago

Ok we're getting somewhere. I've confirmed everything works with bazel 0.16.0, with a clean build, over the slow ADSL I'm using here.

The error you are seeing is not related to minions or bazel: it seems to be either on your network or in the base system, given it reproes with native git. Given you have cloned minions I assume you can clone git repos, so that seems to rule out a config issue. The googleapis repo, is really really big. So it's possible that your network connection is not that stable and you are seeing it die midway through. Can you see it running for a while or does it error out immediately?

At this point we're trying to debug your network + your OS which seems not like something I can really help with :-/ Looking online though I read that git config --global http.postBuffer 1048576000 might help in these cases [https://stackoverflow.com/questions/6842687/the-remote-end-hung-up-unexpectedly-while-git-cloning]

I'm happy to help further with the build process but I'm not sure I can be of use in this specific instance.