Git fails to describe project in build server

Bug #1991317 reported by Facundo Batista
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
launchpad-buildd
Triaged
High
Unassigned

Bug Description

I'm trying to `snapcraft remote-build` the Charmcraft snap, which calculates the version doing `git describe --tags --dirty`.

However, that command fails on the servers.

FTR, the project uploaded by Snapcraft has the proper tags in it, this is the output I get if I tweak the project to do `git log`:

```
commit b22fcdba3b894004468abfbf45caa54d93fbf7d0 (HEAD -> refs/heads/release-2.1, tag: refs/tags/2.1.0, tag: refs/tags/2.1, refs/remotes/upstream/main, refs/heads/main)
```

(full output of the command: https://pastebin.ubuntu.com/p/8GXRCJTR3K/)

The problem is that Git is failing with:

```
fatal: detected dubious ownership in repository at '/build/snapcraft-charmcraft-f3e050ba9add253d3c37d743f9b09089/parts/charmcraft/src'
To add an exception for this directory, call:

    git config --global --add safe.directory /build/snapcraft-charmcraft-f3e050ba9add253d3c37d743f9b09089/parts/charmcraft/src
```

Which is weird, because everything looks owned by `root`: the following is the result of running `id` instead of `git` in the server:

    uid=0(root) gid=0(root) groups=0(root)

...and attached in this report is the whole output of `find /build -ls`.

The Git version in the servers is:

```
git version 2.25.1
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
```

Thanks!

Tags: lp-code
Revision history for this message
Facundo Batista (facundo) wrote :
Jürgen Gmach (jugmac00)
Changed in launchpad-buildd:
status: New → Triaged
importance: Undecided → High
tags: added: lp-code
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.