Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context deadline exceeded while downloading googleapis dependencies #824

Closed
handikacatur opened this issue Jan 3, 2022 · 5 comments
Closed

Comments

@handikacatur
Copy link

handikacatur commented Jan 3, 2022

I experienced an error while buf is downloading dependencies.

Here is my buf.yaml

name: buf.build/mypackage/authentication-service
version: v1beta1
build:
  roots:
    - proto/analytics
lint:
  use:
    - DEFAULT
deps:
  - buf.build/googleapis/googleapis
  - buf.build/grpc-ecosystem/grpc-gateway

Here is my terminal output:

buf: downloading buf.build/googleapis/googleapis:6358935a97044c1494fe13d369ac2f3b
Failure: context deadline exceeded.

I've updated using buf mod update but it always return context deadline exceeded while I do generate or build.

@cyinma
Copy link
Member

cyinma commented Jan 3, 2022

Hi @handikacatur , thank you for your issue.

buf has a global flag --timeout for setting the timeout duration, which has a default value of 2m0s, can you try to execute with a longer duration (e.g. buf build --timeout 5m) to see if it works?

googleapis is a relatively huge dependency, depending on your network condition, it is likely that buf cannot download the dependency with the default 2 minutes timeout.

@handikacatur
Copy link
Author

handikacatur commented Jan 3, 2022

Thank you for your quick reply @cyinma , I have done as you said. I set the timeout to be 5m, but it results in an error stating that the remote is unavailable.
Here's the error looks like:

buf: downloading buf.build/googleapis/googleapis:6358935a97044c1494fe13d369ac2f3b
Failure: the server hosted at that remote is unavailable: error reading from server: read tcp 192.168.114.7:60785->35.193.118.40:443: read: connection reset by peer.

@amckinney
Copy link
Contributor

This looks like a network issue similar to the one we saw here.

Are you able to build other modules just fine? How about a smaller one like buf.build/acme/petapis?

@handikacatur
Copy link
Author

handikacatur commented Jan 4, 2022

@amckinney I cloned the petapis repository and use a buf.yaml like this:

version: v1
lint:
  use:
    - DEFAULT
breaking:
  use:
    - FILE
deps:
  - buf.build/acme/petapis

I do buf build and this is the output:

buf: downloading buf.build/acme/paymentapis:6e230f46113f498392c82d12b1a07b70
buf: downloading buf.build/acme/petapis:84a33a06f0954823a6f2a089fb1bb82e
buf: downloading buf.build/googleapis/googleapis:84c3cad756d2435982d9e3b72680fa96
Failure: context deadline exceeded.

I'm not using buf.build/googleapis/googleapis but it still downloading the dependency. Is this the default behavior of buf to download all deps although it is from another project in another directory?
Another dependencies seems downloaded successfully except for buf.build/googleapis/googleapis. When I run buf build again it is just downloading the googleapis. I assume this happened because the googleapis server has some errors.

@handikacatur
Copy link
Author

[RESOLVED]

I do buf build --timeout 5m as @cyinma said but it returns server failure before. But after I delete the buf.lock and do buf generate --timeout 5m resolved the issue and my protobuf is generated successfully. I don't really know what happened but it looks like cache conflict because I use buf.build/beta/googleapis before.

I will close this issue. Thank you @cyinma @amckinney for helping me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants