Error: Error cloning remote repo 'origin` - jenkins

I'm facing the same issue as mentioned here
ERROR: Error cloning remote repo 'origin'
I'm getting this issue when it is triggered as a downstream job (triggered from another job / Upstream). I'm still be able to make it work by rebuilding the build / manually triggering the build but I don't understand how.
Also Tried giving Git tool chain explicitly in the configuration, but this doesn't have any effect on the build (resolving the above issue)
PFB Code Block:
12:43:55 > /usr/bin/git fetch --tags --force --progress -- <ssh git repo link> +refs/heads/*:refs/remotes/origin/* # timeout=10
12:45:11 ERROR: Error cloning remote repo 'origin'
12:45:11 hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --force --progress -- <ssh git repo link> +refs/heads/*:refs/remotes/origin/*" returned status code 128:
12:45:11 stdout:
12:45:11 stderr: remote: Counting objects: 12277, done
remote: Compressing objects: 1% (47/4605)
remote: Compressing objects: 2% (93/4605)
.
.
12:45:11 Receiving objects: 100% (12277/12277), 1012.00 KiB | 525.00 KiB/s
Receiving objects: 100% (12277/12277), 1.55 MiB | 731.00 KiB/s, done.
12:45:11 fatal: unable to open .git/objects/pack/tmp_pack_9xXtjN: No such file or directory
12:45:11 fatal: index-pack failed

Related

Is there a way to fix brew install early eof error?

Whenever I type any brew install command into the terminal I always get the same error:
==> Tapping homebrew/cask
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 659774, done.
remote: Counting objects: 100% (338/338), done.
remote: Compressing objects: 100% (170/170), done.
error: 6957 bytes of body are still expected.31 MiB | 4.20 MiB/s
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask --origin=origin --template=` exited with 128.
Is there anyway of fixing it? (I have tried uninstalling and reinstalling homebrew and other methods)
That is basically git clone issue, try turn off the compression to see it helps.
git config --global core.compression 0

Can't update or upgrade Homebrew

I can no longer run either brew upgrade or brew update: both abort with
Error: homebrew-core is a shallow clone. To `brew update` first run:
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
and if I follow this suggestion and run git ... --unshallow and then try brew update or brew upgrade I still get the same error message.
If I then try the command again (maybe I didn't do it right the first time?) I get
fatal: --unshallow on a complete repository does not make sense
How do I get past this error message to run brew upgrade or brew update without errors?
HOMEBREW_VERSION: 2.6.0-82-gde1afcb
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: de1afcbfc58fb3cd5779bd8fbb6b9995700dda4c
Last commit: 30 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: a7c63b0f7f7ae416a2f961b263155281759ac3a7
Core tap last commit: 29 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.FwPJPzeLfq/org.macosforge.xquartz:0
HOMEBREW_EDITOR: /usr/local/bin/bbedit
HOMEBREW_MAKE_JOBS: 4
HOMEBREW_NO_ANALYTICS: set
HOMEBREW_NO_EMOJI: set
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: quad-core 64-bit haswell
Clang: 12.0 build 1200
Git: 2.29.2 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.0_172
macOS: 10.15.7-x86_64
CLT: 12.0.32.27
Xcode: 12.2
XQuartz: 2.7.11 => /opt/X11
It's asking you to unshallow both homebrew-core and homebrew-cask with:
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask" fetch --unshallow
Nothing worked with me until I did:
cd /usr/local/Homebrew/Library/Taps/homebrew/
rm -rf homebrew-core
git clone https://github.com/Homebrew/homebrew-core.git
note: as of Feb 2023 Taps are now here:
/opt/homebrew/Library/Taps/homebrew
Seems that is has been a change in the Homebrew policy and there is not going to be a shallow clone any more.
The correct answer is unshallow, as requested —see Eric3 answer— or install it again, which is going to produce a unshallow / regular copy of the repo.
This worked for me.
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask" fetch --unshallow
remote: Enumerating objects: 561296, done.
remote: Counting objects: 100% (561255/561255), done.
remote: Compressing objects: 100% (200847/200847), done.
remote: Total 552295 (delta 355423), reused 545449 (delta 348597), pack-reused 0
Receiving objects: 100% (552295/552295), 214.42 MiB | 2.60 MiB/s, done.
Resolving deltas: 100% (355423/355423), completed with 4915 local objects.
From https://github.com/Homebrew/homebrew-core
09e19b5c825..003302f81db master -> origin/master
remote: Enumerating objects: 180904, done.
remote: Counting objects: 100% (166460/166460), done.
remote: Compressing objects: 100% (47394/47394), done.
remote: Total 155334 (delta 116608), reused 146431 (delta 107784), pack-reused 0
Receiving objects: 100% (155334/155334), 73.84 MiB | 4.87 MiB/s, done.
Resolving deltas: 100% (116608/116608), completed with 6054 local objects.
From https://github.com/Homebrew/homebrew-cask

git migration error: [remote rejected] master -> master (cannot combine normal pushes and magic pushes)

I would like to migrate a repo from server-A to server-B, here is my procedure:
"git clone --mirror" a repo, named test from server-A
$ git clone --mirror ssh://my.name#10.58.65.50:29418/test
Cloning into bare repository 'test.git'...
remote: Counting objects: 1836, done
remote: Finding sources: 100% (1829/1829)
remote: Total 2758 (delta 377), reused 2664 (delta 377)
Receiving objects: 100% (2758/2758), 1.28 MiB | 0 bytes/s, done.
Resolving deltas: 100% (949/949), done.
Checking connectivity... done.
Create an empty repo (test) on server-B
"git push --mirror" the repo (test) to server-B
git push was failed, and the error log is listed as below:
$ git push --mirror ssh://my.name#10.58.65.51:29418/test
Counting objects: 2661, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1713/1713), done.
Writing objects: 100% (2661/2661), 1.25 MiB | 0 bytes/s, done.
Total 2661 (delta 921), reused 2661 (delta 921)
remote: Resolving deltas: 100% (921/921)
remote: Processing changes: refs: 352, done
To ssh://my.name#10.58.65.51:29418/test
! [remote rejected] master -> master (cannot combine normal pushes and magic pushes)
! [remote rejected] refs/meta/config -> refs/meta/config (cannot combine normal pushes and magic pushes)
! [remote rejected] refs/changes/00/12100/1 -> refs/changes/00/12100/1 (cannot combine normal pushes and magic pushes)
error: failed to push some refs to 'ssh://my.name#10.58.65.51:29418/test'
I have no idea of this error and how could I solve that?
Thanks!
1-Clone the empty repository from server B( make sure to clone it with commit msg)
2-Copy all your files from the 'A' server repository (except the .git file) to your empty 'B' server repository.
3-In your 'B' server repository run git add .
then git commit -m 'your commit message'
And then lastly git push origin HEAD:refs/for/master'

CocoaPods/Specs cloning from github takes too much time

I tried many time to clone this url
git clone https://github.com/CocoaPods/Specs.git
But it shows like the following, how to fix this issue? Please help me.
$ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
Cloning into 'master'...
remote: Counting objects: 1082703, done.
remote: Compressing objects: 100% (279/279), done.
Receiving objects: 2% (25216/1082703), 5.03 MiB | 16.00 KiB/s
Sometime it may breaking like after 50% completed and also showing following error
error: RPC failed; curl 56 SSLRead() return error -9806 MiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
If you only need the most recent version, try
git clone --depth=1 https://github.com/CocoaPods/Specs.git
It will decrease the size to 1/3.
Also, depending on your network condition, a proxy might help.

Push to gerrit command error prohibited by Gerrit

I'd like to push my code to Gerrit. I added these lines in my ~/.gitconfig
[remote "origin"]
url = ssh://hxx#www.xxxx.com:29418/project/cloud
fetch = +refs/heads/*:refs/remotes/origin/*
push = refs/heads/*:refs/for/*
When I push in my source tree, I got error:
'git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v origin refs/heads/master:refs/heads/refs/for/master
Pushing to ssh://hxx#www.xxxx.com:29418/project/cloud
remote:
remote: Processing changes: refs: 1
remote: Processing changes: refs: 1, done
To ssh://hxx#www.xxxx.com:29418/project/cloud
! [remote rejected] master -> refs/for/master (prohibited by Gerrit)
error: failed to push some refs to
ssh://hxx#www.xxxx.com:29418/project/cloud
Pushing to ssh://hxx#www.xxxx.com:29418/project/cloud
remote:
remote: Processing changes: refs: 1
remote: Processing changes: refs: 1, done
To ssh://hxx#www.xxxx.com:29418/project/cloud! [remote rejected] master ->
refs/for/master (prohibited by Gerrit)
error: failed to push some refs to ssh://hxx#www.xxxx.com:29418/project/cloud
Completed with errors, see above
It seems my sourcetree send push command twice. also the command is incorrect:
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v origin refs/heads/master:refs/heads/refs/for/master
It seems the correct command should be:
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v origin master:refs/for/master
where is my mistake in my configuration?
Thanks in advance.
Don't worry, "refs/heads/master" and "master" points to the same commit. This is not the issue. Looking to the "To ssh://hxx#www.xxxx.com:29418/project/cloud! [remote rejected] master ->refs/for/master (prohibited by Gerrit)" error message, it seems that you do not have permission in Gerrit to create changes on this repository. Check your permissions.

Resources