1

EDIT: We are not from the dev team. I have cloned the repo to try command listed below.

My colleague has launched a deploy via Jenkins and 5 min after the deploy stopped with error:

[WARNING] The requested profile "ntic" could not be activated because it does not exist.
[ERROR] Failed to execute goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-start (default-cli) on project nsnet-parent: Error starting release: Error starting release: a release branch [refs/remotes/origin/release/8.15.0] already exists. Finish that first! -> [Help 1]

Here the part of the log where the commitis specified find in jenkins jobs output.

> git.exe config --local --remove-section credential # timeout=10
 > git.exe rev-parse "refs/remotes/origin/RCI^{commit}" # timeout=10
 > git.exe rev-parse "refs/remotes/origin/origin/RCI^{commit}" # timeout=10
Checking out Revision 7e91bd1bf2353bc74ddb491faf2f83917b487211 (refs/remotes/origin/RCI)
 > git.exe config core.sparsecheckout # timeout=10
 > git.exe checkout -f 7e91bd1bf2353bc74ddb491faf2f83917b487211
 > git.exe rev-list 7e91bd1bf2353bc74ddb491faf2f83917b487211 # timeout=10

Since I cannot see the branch Name RCI or the last commit. I have tryed git reflog but I cannot see the commit 7e91bd1bf2353bc74ddb491faf2f83917b487211 or the branch RCI used in deployment. Have you any idea, is it still possible to restore RCI branch and all the code ?

We have Jenkins on Windows and Gitlab-ci for git project Thanks

rab
  • 133
  • 2
  • 13
  • can you try running `git fetch && git branch -a --contains=7e91bd1bf`? – Nitsan Avni Feb 06 '20 at 07:04
  • Error from windows for the para '&&'. it's not recognized by powershell – rab Feb 06 '20 at 07:28
  • ok so separately: `git fetch` then `git branch -a --contains=7e91bd1bf` – Nitsan Avni Feb 06 '20 at 07:47
  • Sorry I'am idiiot, I have installed git on a separate linux server . I have cloned the repo but it's seems still an error with the command: error: malformed object name 7e91bd1bf – rab Feb 06 '20 at 07:57
  • @rab "malformed object": the commit is not known at all: https://stackoverflow.com/a/5549506/6309 – VonC Feb 06 '20 at 08:35
  • Ok so nothing to do in this case ? I will ask to the dev team to recreate the branch and push again ... – rab Feb 06 '20 at 08:51
  • @rab I would clone again the repo, for testing, in order to see if, when cloning *everything*, that commit exists or not. – VonC Feb 06 '20 at 09:00
  • @vonc I hve tryed to clone it again and I cannot found the commit with reflog – rab Feb 06 '20 at 09:30
  • @rab and with a simple `git log -1 7e91bd1bf` or `git show 7e91bd1bf`? (done in the folder where you have cloned again the repo) – VonC Feb 06 '20 at 09:38
  • `git log -1 7e91bd1bf fatal: ambiguous argument '7e91bd1bf': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]' ` and `esesame]$ git show 7e91bd1bf fatal: ambiguous argument '7e91bd1bf': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]' ` – rab Feb 06 '20 at 10:06
  • @rab Yes, this commit does not seem to have been pushed to the repository that you have cloned. – VonC Feb 06 '20 at 13:13
  • @VonC I think it have been pushed in the branch but it have been crushed. So thanks for help guys. – rab Feb 06 '20 at 17:10
  • @rab OK, that would explain why `git reflog` does not show any result: it is a local command. If the commit has been crushed (overriden by a forced push for instance), only the remote repo would keep a trace in its own `git reflog`. Not your local clone. – VonC Feb 06 '20 at 17:14
  • @VonC Ok dear got it. :D – rab Feb 07 '20 at 09:09

1 Answers1

1

I have cloned the repo but it's seems still an error with the command: error: malformed object name 7e91bd1bf

I have tryed git reflog but I cannot see the commit 7e91bd1bf2353bc74ddb491faf2f83917b487211

That happens if the commit was overriden by a force push: cloning the repository, and doing a git log or git reflog in it would not retrieve that commit.
It is best to:

  • recover the old commit/branch from the currently cloned repo one by the Jenkins job (it has the history before the force push)
  • or relaunch the Jenkins job, using the new modified history of the remote repository, and check if the error persists.
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • To recover the repo,we have used the clone which have been done by Jenkins. git clone is executed when the job is launched. – rab Feb 07 '20 at 09:10
  • @rab It is possible that the force push (rewriting the history) was done *after* the Jenkins job clone. Using the clone from Jenkins is a good idea, because it still has the history before the force push. – VonC Feb 07 '20 at 09:18