GitLab push error gitmodulesUrl: disallowed submodule url: xxx
Summary
git push a project to GitLab report error
gitmodulesUrl: disallowed submodule url:
Steps to reproduce
Example project: https://github.com/topjohnwu/Magisk.git
Operation steps:
# get the code
git clone --recurse-submodules https://github.com/topjohnwu/Magisk.git
# change the repo URL
git remote rename origin old-origin
git remote add origin https://git-hk.xxx.xx/android/magisk.git
# push to my own Omnibus GitLab
git push --set-upstream origin --all
It shows the error:
Enumerating objects: 85550, done.
Counting objects: 100% (85550/85550), done.
Delta compression using up to 11 threads
Compressing objects: 100% (18362/18362), done.
Writing objects: 100% (85550/85550), 59.45 MiB | 197.00 KiB/s, done.
Total 85550 (delta 53836), reused 85548 (delta 53834), pack-reused 0
remote: error: object 5bea0fbd6b56c8c63223a056f7c7e84215f555f9: gitmodulesUrl: disallowed submodule url: https://github.com:topjohnwu/resetprop.git
remote: fatal: fsck error in packed object
error: remote unpack failed: index-pack abnormal exit
To https://git-hk.xxx.xx/android/magisk.git
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'https://git-hk.xxx.xx/android/magisk.git'
but the repo can pass the fsck
# git fsck --full 1 ↵ master
Checking object directories: 100% (256/256), done.
Checking objects: 100% (85869/85869), done.
error in blob 5bea0fbd6b56c8c63223a056f7c7e84215f555f9: gitmodulesUrl: disallowed submodule url: https://github.com:topjohnwu/resetprop.git
dangling tree 7a58a48c0b40bacf61e57f5bfc44a05cbee841dc
dangling commit 50803c338ae5205ee5f096d38e1fa32901cd2e2a
dangling commit 0905adcd6442d891c93d268dfd4f9c59306d34f0
dangling commit a721b2ad8414bb588bce0fa53814b7f4ac4f0c47
dangling commit ae78b2e8b0d3656bae4ec0ae2a62ea47e47534ec
dangling commit 73544bf3ed48fd3c8f4f91c845e1dbf85e1be19a
dangling commit c46307ebcf6018af7ec78515665131d2412753e4
Then I searched the info on the internet, refer to Encountering gitmodulesUrl: disallowed submodule url error when running repository check
I tried to add a .git-fsck-skiplist
file, write in 5bea0fbd6b56c8c63223a056f7c7e84215f555f9
, but it still failed.
$ cat <<EOF >.git-fsck-skiplist
> # invalid submodule path
> 5bea0fbd6b56c8c63223a056f7c7e84215f555f9
> EOF
$ git config fsck.skipList .git-fsck-skiplist
And then change the gitaly config, add:
gitaly['configuration'] = {
git: {
config: [
{ key: "fetch.fsck.gitmodulesUrl", value: "ignore" },
{ key: "fsck.gitmodulesUrl", value: "ignore" },
],
},
}
reconfigure and restart, failed too.
What is the current bug behavior?
What is the expected correct behavior?
Relevant logs
Relevant logs
Details of package version
Provide the package version installation details
gitlab-jh-17.10.4-jh.0.el9.x86_64
Environment details
- Operating System:
Alma Linux 9.5
- Installation Target, remove incorrect values:
- Other:
VMware ESXi 8
- Other:
- Installation Type, remove incorrect values:
- New Installation
- Is there any other software running on the machine:
none
- Is this a single or multiple node installation?
two single geo
- Resources
- CPU:
4 vCPU
- Memory total:
8G vRAM
- CPU:
Configuration details
Provide the relevant sections of `/etc/gitlab/gitlab.rb`
gitaly\['configuration'\] = { git: { config: \[ { key: "fetch.fsck.gitmodulesUrl", value: "ignore" }, { key: "fsck.gitmodulesUrl", value: "ignore" }, \], }, }
Edited by Andrew Smith