Descriptive error message for non-conforming module imports
- Dominant language
- Go
- Stars
- 4.8k
- Forks
- 542
- Avg merge
- 7d 21h
- Merged PRs (30d)
- 2
Description
**Describe the bug**
maybe can be fixed with #1318. When a module's tag doesn't match sem ver format, especially for v1+ modules, athens will return a 404, whereas proxy.golang.org returns a descriptive error
https://athens.azurefd.net/github.com/uber/h3-go/@v/v3.0.2.info
https://proxy.golang.org/github.com/uber/h3-go/@v/v3.0.2.info
**Error Message**
```console
DEBUG[4:50PM]: saving github.com/uber/h3-go@v3.0.2 to storage... http-method=GET http-path=/github.com/uber/h3-go/@v/v3.0.2.info request-id=02262b68-dd99-4238-ac73-9d73e45d4c8b
INFO[4:50PM]: github.com/uber/h3-go@v3.0.2: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v3 http-method=GET http-path=/github.com/uber/h3-go/@v/v3.0.2.info kind=Not Found module=github.com/uber/h3-go operation=download.InfoHandler ops=[download.InfoHandler pool.Info protocol.Info protocol.processDownload stash.Pool stasher.Stash stasher.fetchModule goGetFetcher.Fetch module.downloadModule] request-id=02262b68-dd99-4238-ac73-9d73e45d4c8b version=v3.0.2
INFO[4:50PM]: incoming request http-method=GET http-path=/github.com/uber/h3-go/@v/v3.0.2.info http-status=404 request-id=02262b68-dd99-4238-ac73-9d73e45d4c8b```
**To Reproduce**
Steps to reproduce the behavior:
start the server and GET http://localhost:3000/github.com/uber/h3-go/@v/v3.0.2.info
**Expected behavior**
410 Gone but with descriptive message
Contributor guide
Research direction
Start the Athens server and request /github.com/uber/h3-go/@v/v3.0.2.info, then compare its response and status with proxy.golang.org for the same module version. Trace the request handling for this endpoint and the invalid-version error shown in the report. Done means the non-conforming import returns HTTP 410 with a descriptive error message instead of a generic 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100