Open flip111 opened 7 months ago
This is a Registry error, see the logs when we query the API using the job id from your logs:
$ curl https://registry.purescript.org/api/v1/jobs/c15beb1c-580f-4f2e-a269-c7d77a4f43bf | jq .
{
"createdAt": "2024-01-22T13:44:36.794Z",
"finishedAt": "2024-01-22T13:44:36.974Z",
"jobId": "c15beb1c-580f-4f2e-a269-c7d77a4f43bf",
"jobType": "publish",
"logs": [
{
"jobId": "c15beb1c-580f-4f2e-a269-c7d77a4f43bf",
"level": "ERROR",
"message": "Failed to clone git tag: Cloning into '/tmp/tmp-2210958-ehZufsMfSvEF/foldable-traversable-extra'...\nfatal: could not read Username for 'https://github.com': No such device or address",
"timestamp": "2024-01-22T13:44:36.973Z"
},
{
"jobId": "c15beb1c-580f-4f2e-a269-c7d77a4f43bf",
"level": "ERROR",
"message": "Failed to clone repository flip111/foldable-traversable-extra at ref v0.0.4",
"timestamp": "2024-01-22T13:44:36.975Z"
}
],
"packageName": "foldable-traversable-extra",
"ref": "v0.0.4",
"success": false
}
That tag was created at 13:43
, and the logs happen at 13:44
, so I think this is a bug?
I'll move the issue to the registry repo.
@thomashoneyman any clue what might be happening here? The spago config seems alright
The first error is strange:
Failed to clone git tag: Cloning into '/tmp/tmp-2210958-ehZufsMfSvEF/foldable-traversable-extra'...\nfatal: could not read Username for 'https://github.com': No such device or address",
We clone the repository early in publishing: https://github.com/purescript/registry-dev/blob/ef989a119d79f25d315ab7dcee603792750b059c/app/src/App/API.purs#L370
Here's the implementation of that fetch
call:
https://github.com/purescript/registry-dev/blob/ef989a119d79f25d315ab7dcee603792750b059c/app/src/App/Effect/Source.purs#L78-L81
Under the hood it's just calling git
on the command line:
https://github.com/purescript/registry-dev/blob/ef989a119d79f25d315ab7dcee603792750b059c/app/src/App/CLI/Git.purs#L74-L80
@f-f @flip111 The error is not good, but I would guess this is happening because the repository field in the Spago config is incorrect:
It lists the repository as foldable-traversable-extra
but the actual repository has a purescript
prefix:
https://github.com/flip111/purescript-foldable-traversable-extra
Thank you for looking into this. I changed the repo name and it worked. Let's keep this issue open to make a better error message.
Ah indeed! Thanks Thomas. I guess both the registry and spago should check for the existence of the repo before doing their thing.
What was actually output to the console from the Spago publish? The registry generally comments this line:
"Failed to clone repository flip111/foldable-traversable-extra at ref v0.0.4"
What error would y'all want instead? Some kind of preflight check that the repository exists, and an error "Repository flip111/foldable-traversable-extra
does not exist."?
Some kind of preflight check that the repository exists, and an error "Repository flip111/foldable-traversable-extra does not exist."?
Yeah, errors from git clone
are pretty generic, so we can offer a much better error just running this simple check
The errors returned to the user are the ones appearing in the API call, and the first one is pretty confusing:
"Failed to clone git tag: Cloning into '/tmp/tmp-2210958-ehZufsMfSvEF/foldable-traversable-extra'...\nfatal: could not read Username for 'https://github.com': No such device or address"
I think a simple git ls-remote
would be a good preflight check, with interaction disabled via GIT_TERMINAL_PROMPT=0
since if the repo doesn't exist GitHub will prompt for login in case it's private.
This works ...
Doesn't work
I don't have 2fa authenticated on github yet, not sure if that's related but i just mentioned it in case.