jenkins-x-plugins/jx-release-version

FATAL: Failed to bump version using "auto": object not found

Closed this issue · 9 comments

Hi! I'm using jx-release-version version 2.4.2 on ubuntu to get next tag and push to Gitlab. It's been working fine for me but suddenly I started seeing this error:

FATAL: Failed to bump version using "auto": object not found

I've never encountered this error before and I'm not sure why it's happening. Here is the sequence of commands I run:

git fetch origin 'refs/tags/*:refs/tags/*'
tag=$(./jx-release-version)

can you please run it again with the -debug flag - or with the JX_LOG_LEVEL env var set to debug - and copy/paste the log here? thanks

@vbehar I did not expect a super quick response! I needed to resolve quickly so I deleted all the tags in the repo and ran x-release-version and that resolved the issue.

I still have no clue what went wrong and why that error was returned. I'm unable to reproduce after deleting all the tags and starting over.

ok, I've just added more context to our error messages in #79 so if you get the error again, it should be more explicit about which tag can't be found.
I'm closing this issue for now, but if you get the error again please feel free to re-open it

@vbehar I ran into this issue again. Here is the log with debug flag

From https://gitlab...

  • [new tag] 0.0.4 -> 0.0.4
  • [new tag] 0.0.5 -> 0.0.5
  • [new tag] 0.0.6 -> 0.0.6
  • [new tag] 0.0.7 -> 0.0.7
  • [new tag] 0.0.8 -> 0.0.8
    DEBUG: jx-release-version 2.4.3 running in debug mode in /builds/...
    DEBUG: Using "auto" version reader (with "")
    DEBUG: Trying to read the previous version from the git tags first...
    DEBUG: Found 8 semver tags with pattern ""
    DEBUG: Previous version: 0.0.8
    DEBUG: Using "auto" version bumper (with "")
    DEBUG: Trying to bump the version using semantic release first...
    DEBUG: Previous version tag commit is 4a1a393f932a51bc52098a33d73874d6cb696ca9
    DEBUG: Iterating over all commits since 2021-04-24 02:50:36 -0400 -0400
    DEBUG: Checking commit c87a82e5f67df85afcd49cbdd5fc92cc0655c89d with message test
    DEBUG: Parsing commit c87a82e5f67df85afcd49cbdd5fc92cc0655c89d
    DEBUG: Skipping non-conventional commit c87a82e5f67df85afcd49cbdd5fc92cc0655c89d
    DEBUG: Checking commit a96b4463baba8d022e7cc508a8af15839c552b79 with message test
    DEBUG: Parsing commit a96b4463baba8d022e7cc508a8af15839c552b79
    DEBUG: Skipping non-conventional commit a96b4463baba8d022e7cc508a8af15839c552b79
    DEBUG: Checking commit dd96c22620365d222a01bcaa50849afc468c0b29 with message fix spell
    DEBUG: Parsing commit dd96c22620365d222a01bcaa50849afc468c0b29
    DEBUG: Skipping non-conventional commit dd96c22620365d222a01bcaa50849afc468c0b29
    DEBUG: Checking commit 5d9a58f6cfb4aa2ef7885e0a12c144e5cef1921c with message 188 test
    DEBUG: Parsing commit 5d9a58f6cfb4aa2ef7885e0a12c144e5cef1921c
    DEBUG: Skipping non-conventional commit 5d9a58f6cfb4aa2ef7885e0a12c144e5cef1921c
    FATAL: Failed to bump version using "auto": failed to bump version 0.0.8 using semantic strategy: failed to iterator over commits: object not found

Here are the existing tags:
git ls-remote --tags
From https://gitlab.....git
a9453dc6f3712ef121b413144e85fa5bafa65d49 refs/tags/0.0.1
e05a59125558f14fc45dab7d8be23009fe02235b refs/tags/0.0.1^{}
83607283898e24be108a0b2ceafe3ecc854fb96a refs/tags/0.0.2
f7e912b29910a203b46fb7e25cc18b242a7c5a3b refs/tags/0.0.2^{}
cedca77c77f0bad528bfb73a0761da8c8fc3b374 refs/tags/0.0.3
2102ea020ad8f8969906d97188ab7526666a6ba0 refs/tags/0.0.3^{}
7883af8622544e0107f946e5d64cc3691f5fc7e6 refs/tags/0.0.4
c6b0268d8abe56b37edb4d683b348089a51e6c45 refs/tags/0.0.4^{}
9797ba0cb67475b17cc61d1e60879d29ca67f146 refs/tags/0.0.5
cd6b19de96ea8edce5ee613267945d41d955e87e refs/tags/0.0.5^{}
3b88bbfb7a7a37ee280715ef27b6e5b9089e32bd refs/tags/0.0.6
9e3915a65515910b3f0e6a9c37f9ff73a2a8c1bf refs/tags/0.0.6^{}
31601ca4bd3c3e6740483dbf7b6fce23b172f0c3 refs/tags/0.0.7
e9df2d27fc0dd7060e6bf3b520d58ef2d918e2ec refs/tags/0.0.7^{}
6ee20e71098c8f0c73bd6b8f79ffbc6a449e080c refs/tags/0.0.8
4a1a393f932a51bc52098a33d73874d6cb696ca9 refs/tags/0.0.8^{}

ok thanks for the logs, can you please run git log 4a1a393f932a51bc52098a33d73874d6cb696ca9..HEAD?

@vbehar I think the earliest commit doesn't have a line break so it's breaking the iterator. I don't know how that's possible tho. I typically commit from the command line on my mac using git commit -m "message"

Take a look at this:

image

All commit messages seem to have a line break except for the last one:

image

@vbehar any thoughts on the above? I've been deleting all the tags when I encounter the issue and I think that has been fixing it because jx-release-version does not need to look at previous tags in this case so it's not running into the issue with the iterator but I'm looking for a more long term solution.

I'm going to try updating the commit message that is missing a line break to add a line break at the end and see if that works as well. But again, a long term solution will be necessary either way. Thanks much!

Also, I'm not able to reopen a closed issue. can you do that on your end?

ok I'm re-opening it, I'll have a look tomorrow

ok it should be good now, the new logic won't fail if it can't retrieve/decode a commit, instead it will just skip it