gomods / athens

A Go module datastore and proxy
https://docs.gomods.io
MIT License
4.42k stars 498 forks source link

private GitHub repo download access change needs Athens restart #1726

Open vposham opened 3 years ago

vposham commented 3 years ago

Describe the bug Private Github repos for which Athens doesnt have access at the time of its startup are considered unauthenticated even if the access to that repo is granted later for athens github user.

Error Message Client - reading github.com/org/some-private-repo/go.mod at revision v0.1.5: unknown revision v0.1.5 Server - I wish I captured it, but I dint - sorry.

To Reproduce Steps to reproduce the behavior:

  1. Create a private GitHub repo for which Athens user doesnt have access to.
  2. Start Athens service with below configuration.
  3. Try to download using go get.

Expected behavior Once the access is provided in Github (irrespective of Athens server startup timestamp), Athens should be able to download it.

Environment: Docker-Compose configuration:

"ATHENS_PORT=3000",
"ATHENS_DISK_STORAGE_ROOT=/var/lib/athens",
"GO_BINARY_PATH=go",
"ATHENS_GOGET_WORKERS=30",
"ATHENS_TIMEOUT=300",
"ATHENS_STORAGE_TYPE=disk",
"ATHENS_GITHUB_TOKEN=xyz",
"ATHENS_GONOSUM_PATTERNS=github.com/org/*",
"ATHENS_SINGLE_FLIGHT_TYPE=memory",
"GONOSUMDB=github.com/org/*",
"GO_ENV=production",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GO111MODULE=on"

Work around Restart Athens service and download the same repo - it works fine.

DrPsychick commented 1 year ago

I would argue that Athens is a proxy/cache and supposed to save state to be effective. If a simple restart solves the issue, I'm not sure it is worth investing time here.

Is this still an issue? Or have others experienced this issue?