'version string generation failed' on deploy

Bug #1789447 reported by Stuart Bishop
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Nam Nguyen

Bug Description

With 2.4.2, I've started seeing spurious (?) warnings when deploying:

$ juju deploy ~/charms/repo/builds/postgresql
WARNING version string generation failed : exit status 128

Deploying charm "local:bionic/postgresql-2".

Everything seems to be working fine, despite the noise.

Tags: bitesize sts
Changed in juju:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Ian Booth (wallyworld)
milestone: none → 2.4.3
Revision history for this message
Ian Booth (wallyworld) wrote :

The issue here is that we now run "git describe --dirty" to pick up the sha of the latest commit and include that in a version file in the charm archive. This is reported in juju status.

However, it seems git describe can sometimes fail with error code 128 if it can't find any suitable tags. Using --always should fix this.

Note that it is just noise in that if there's an error running git describe, the charm deploy still goes ahead.

Ian Booth (wallyworld)
Changed in juju:
status: Triaged → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
Revision history for this message
Junien F (axino) wrote :

This is still a problem in 2.5-rc1. I believe this could be due to the fact that the "git" command is not run in the appropriate directory.

Changed in juju:
status: Fix Released → Triaged
milestone: 2.4.3 → none
Changed in juju:
milestone: none → 2.5.1
tags: added: bitesize
Changed in juju:
assignee: Ian Booth (wallyworld) → Richard Harding (rharding)
Ian Booth (wallyworld)
Changed in juju:
milestone: 2.5.1 → 2.5.2
Changed in juju:
assignee: Richard Harding (rharding) → nobody
Changed in juju:
milestone: 2.5.2 → 2.5.3
Changed in juju:
milestone: 2.5.3 → 2.5.4
Changed in juju:
milestone: 2.5.4 → 2.5.5
Changed in juju:
milestone: 2.5.6 → 2.5.8
Changed in juju:
milestone: 2.5.8 → 2.5.9
Revision history for this message
Nam Nguyen (nammn) wrote :

Yes, i could recreate the error. if you deploy from a folder which not contains a `.git` folder, this error occurs. So ` nam:~ $ juju deploy ./Workspace/charms/postgresql-charm` leads to it, while
`nam:/home/nam/charm-folder/pogresgit $.... deploy` does not.

Nam Nguyen (nammn)
Changed in juju:
assignee: nobody → Nam Nguyen (nammn)
Revision history for this message
Nam Nguyen (nammn) wrote :

So the kind of stacktrace is the following:

https://github.com/juju/juju/blob/857bf735ef592474eac6c529b27004e791170d19/api/client.go#L336
calls with archive information of the charm
https://github.com/juju/charm/blob/v6/charmdir.go#L248
calls tries to find out the vcs
https://github.com/juju/charm/blob/v6/charmdir.go#L435
find out the path and "just" calls for git case, "git describe --dirty --always" from the cwd.
Thus if the cwd does not contain a ".git" this error should return.

Even "worse" if this is called from a folder with ".git" but which does not belong to the charm the versionstring could be wrong.

The error message itself is a little missleading as we "just" catch the error and generate our own message. The actual error message is:

```
fatal: not a git repository (or any of the parent directories): .git
```

Revision history for this message
Nam Nguyen (nammn) wrote :
Nam Nguyen (nammn)
Changed in juju:
milestone: 2.5.9 → 2.7-beta1
Nam Nguyen (nammn)
Changed in juju:
status: Triaged → Fix Committed
Felipe Reyes (freyes)
tags: added: sts
Nam Nguyen (nammn)
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.