changesets-gitlab
changesets-gitlab copied to clipboard
npx changesets-gitlab - git fetch origin main - unable to access URL using bad/illegal format or missing URL
Running npx changesets-gitlab
I'm having this error, and I couldn't find any info about what could be the reason.
URL https://gitlab.company.com/project/path/name.git is correct and I could access by the browser.
Could you help us with any clue to look for a solution?
$ npx changesets-gitlab
::set-output name=published::false
::set-output name=publishedPackages::[]
setting git user
[command]/usr/bin/git config user.name Bot
[command]/usr/bin/git config user.email [email protected]
setting GitLab credentials
[command]/usr/bin/git checkout changeset-release/main
error: pathspec 'changeset-release/main' did not match any file(s) known to git
[command]/usr/bin/git checkout -b changeset-release/main
Switched to a new branch 'changeset-release/main'
[command]/usr/bin/git fetch origin main
fatal: unable to access 'https://gitlab.company.com/project/path/name.git/': URL using bad/illegal format or missing URL
Error: The process '/usr/bin/git' failed with exit code 128
at ExecState._setResult (/builds/project/path/name/node_modules/@actions/exec/lib/toolrunner.js:592:25)
at ExecState.CheckComplete (/builds/project/path/name/node_modules/@actions/exec/lib/toolrunner.js:575:18)
at ChildProcess.<anonymous> (/builds/project/path/name/node_modules/@actions/exec/lib/toolrunner.js:469:27)
at ChildProcess.emit (node:events:514:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1105:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5)
[command]/usr/bin/git fetch origin main
fatal: unable to access 'https://gitlab.company.com/project/path/name.git/': URL using bad/illegal format or missing URL
Error: The process '/usr/bin/git' failed with exit code 128
Do you have a custom GITLAB_HOST
environment?
Yes, Im using this variables:
variables:
NPM_TOKEN: ${CI_JOB_TOKEN}
GITLAB_HOST: https://${CI_SERVER_HOST}
GITLAB_CI_USER_NAME: BOT
GITLAB_CI_USER_EMAIL: [email protected]
Could be a change in the configuration? The Gitlab version is GitLab Community Edition 15.11.2
I have no idea with this, maybe you'll need to use patch-package to debug.
Hello there! I'm encoutering the exact same issue, and can't find a clue even using patch-package to debug. It looks like the trailing /
in the URL is totally at fault, but I can't find where it comes from.
Here are the logs when adding some git commands (remote origin set-url
and remote -v
especially):
[command]/usr/bin/git remote set-url origin https://BOT/ :[MASKED][email protected]/path/to/repository.git
[command]/usr/bin/git remote get-url --all origin
https://BOT/ :[MASKED][email protected]/path/to/repository.git
[command]/usr/bin/git -v
git version 2.39.2
[command]/usr/bin/git remote -v
origin https://BOT/ :[MASKED][email protected]/path/to/repository.git (fetch)
origin https://BOT/ :[MASKED][email protected]/path/to/repository.git (push)
[command]/usr/bin/git fetch https://BOT/ :[MASKED][email protected]/path/to/repository.git my-branch
fatal: unable to access 'https://gitlab.com/path/to/repository.git/': URL using bad/illegal format or missing URL
I'm not a Git specialist enough to understand if that's normal the remote is git:
protocol but it becomes https:
in fetch/in error log when fetching.
On local, with the same Git version, using git:
procotol, everything is OK when I fetch.
@Arnoid31 Does git fetch origin main
run successfully when you debug manually? I can only imagine it to be a git issue itself?
Hello @JounQin, and thank you for your reactivity :)
I get exactly the same issue. But in fact I'm surprised we are using here an https:
protocol with a .git
suffix.
3 weeks ago, the job was working and the fetch was done this way:
[command]/usr/bin/git fetch origin my-branch
From https://gitlab.com/path/to/repository
* branch master -> FETCH_HEAD
and everything was going well.
Another strange thing is, this is the only repository that fails this way, all the others using changesets-gitlab
the exact same way are just fine.
@Arnoid31 Are you using different changesets-gitlab versions in different repositories? If so then maybe some recent releases could be related.
Installed version is 0.10.3. I also tried with v0.10.1 which is run by another (working) repository and no change.
Are they running on same git version?
You've got something here: working repo is running Git v2.20.1, not working is v2.39.2. Verified by using v2.20.1 on not working repo, and it works (but as a side effect I had to downgrade Node version from 20 to 16, so might also be related to Node version, but unlikely).
OK so, from what I see, it looks like finally the error comes from Node version. It works with a node:18.17
builder, but not with a node:20
.
I can't investigate more for the moment, but maybe I'll get back to you if I have some time to proceed to some more investigations.
@JounQin I contacted you at the email address on your GitHub profile (admin(at)1stg(dot)me
) to fund this issue investigation, but I'm not sure you are using it on day-to-day.
Faced exactly the same issue with node:20
after adding GITLAB_CI_USER_NAME variable.
Without variable everything is ok.
I check the source codes, the error should only occur at
https://github.com/un-ts/changesets-gitlab/blob/54e3175ad30a3819b9e9610d72cfe0ea1e68760b/src/run.ts#L215
It could be a git compatibility issue, I may need some more useful info like git/node versions, and maybe volunteer to help debugging like #145.
i have the same issue : https://gitlab.com/robin.louarn/monorepo-test/-/jobs/7603795314
$ node -v
v22.6.0
$ git -v
git version 2.39.2
$ pnpm exec changesets-gitlab
::set-output name=published::false
::set-output name=publishedPackages::[]
setting git user
[command]/usr/bin/git config user.name Robin LOUARN
fatal: not in a git directory
Error: The process '/usr/bin/git' failed with exit code 128
at ExecState._setResult (/builds/robin.louarn/monorepo-test/node_modules/.pnpm/@[email protected]/node_modules/@actions/exec/lib/toolrunner.js:592:25)
at ExecState.CheckComplete (/builds/robin.louarn/monorepo-test/node_modules/.pnpm/@[email protected]/node_modules/@actions/exec/lib/toolrunner.js:575:18)
at ChildProcess.<anonymous> (/builds/robin.louarn/monorepo-test/node_modules/.pnpm/@[email protected]/node_modules/@actions/exec/lib/toolrunner.js:469:27)
at ChildProcess.emit (node:events:520:28)
at ChildProcess.emit (node:domain:488:12)
at maybeClose (node:internal/child_process:1105:16)
at Socket.<anonymous> (node:internal/child_process:[45](https://gitlab.com/robin.louarn/monorepo-test/-/jobs/7603795314#L45)7:11)
at Socket.emit (node:events:520:28)
at Socket.emit (node:domain:[48](https://gitlab.com/robin.louarn/monorepo-test/-/jobs/7603795314#L48)8:12)
at Pipe.<anonymous> (node:net:337:12)
i have the same issue : https://gitlab.com/robin.louarn/monorepo-test/-/jobs/7603795314
$ node -v v22.6.0 $ git -v git version 2.39.2 $ pnpm exec changesets-gitlab ::set-output name=published::false ::set-output name=publishedPackages::[] setting git user [command]/usr/bin/git config user.name Robin LOUARN fatal: not in a git directory Error: The process '/usr/bin/git' failed with exit code 128 at ExecState._setResult (/builds/robin.louarn/monorepo-test/node_modules/.pnpm/@[email protected]/node_modules/@actions/exec/lib/toolrunner.js:592:25) at ExecState.CheckComplete (/builds/robin.louarn/monorepo-test/node_modules/.pnpm/@[email protected]/node_modules/@actions/exec/lib/toolrunner.js:575:18) at ChildProcess.<anonymous> (/builds/robin.louarn/monorepo-test/node_modules/.pnpm/@[email protected]/node_modules/@actions/exec/lib/toolrunner.js:469:27) at ChildProcess.emit (node:events:520:28) at ChildProcess.emit (node:domain:488:12) at maybeClose (node:internal/child_process:1105:16) at Socket.<anonymous> (node:internal/child_process:[45](https://gitlab.com/robin.louarn/monorepo-test/-/jobs/7603795314#L45)7:11) at Socket.emit (node:events:520:28) at Socket.emit (node:domain:[48](https://gitlab.com/robin.louarn/monorepo-test/-/jobs/7603795314#L48)8:12) at Pipe.<anonymous> (node:net:337:12)
- git config --global --add safe.directory $(pwd)
fix my problem for me