Project

General

Profile

Actions

action #113030

closed

test distribution directory git revision can be parsed as "UNKNOWN" and openQA investigation fails to show test git log size:M

Added by okurz almost 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
Regressions/Crashes
Target version:
Start date:
2022-06-24
Due date:
% Done:

0%

Estimated time:

Description

Observation

As found on o3 worker machines running a more recent version of git the test distribution git revision which is also used in the "investigation" information in openQA can be "UNKNOWN" if a correct git version can not be parsed.

Steps to reproduce

Minimal reproducer equivalent of what os-autoinst does:

podman run --rm -it registry.opensuse.org/opensuse/leap:15.3 /bin/sh -c 'zypper -n in sudo shadow git-core && useradd -M user2 && cd /tmp && mkdir git1 && cd git1 && git init && touch README && git config --global user.email "root@local" && git config --global user.name root && git add README && git commit -m "commit 1" && sudo -u user2 git -C /tmp/git1 rev-parse HEAD'

Leap 15.3 has git-core 2.35.3. The problem does not reproduce with Leap 15.2 with git-core 2.26.2 but we are running on Leap 15.3 already for longer. However the problem only appears when not using the worker cache.

Problem

os-autoinst calls git with the same user that isotovideo is called which is using the same username as openQA worker, by default "_openqa-worker". The main test distribution directories like /var/lib/openqa/share on the openQA webUI belong to the user "geekotest" so a differing user. Commonly we don't run into this problem because we use the worker cache solution which runs as the same user as the openQA worker, i.e. "_openqa-worker", so the owner matches. In the problematic case when one does not use the openQA worker cache, same as if one would run on just localhost I assume git would complain. That's already the same observation for the vanilla Leap 15.3 git version. Only the git version in Leap 15.2 (2.26.2) does not yet have that strict behaviour.

Suggestion

  • We could follow git's suggestion and call git config --global --add safe.directory $dir. Or actually as detailed in https://github.blog/2022-04-18-highlights-from-git-2-36/#stricter-repository-ownership-checks we could just run git config --global --add safe.directory '*'. Unfortunately this is only supported in git >= 2.36 so not the current Leap 15.3 or 15.4 git version 2.35.3 but might be enough. However to be safe we should likely call this command just before the rev-parse command anyway but check if it's not already in the config as otherwise it would be added multiple times.

Related issues 1 (0 open1 closed)

Related to openQA Project - action #113507: [logwarn] fatal: ambiguous argument '(unreadable git hash)..abcdef': unknown revision or path not in the working treeResolvedtinita2022-07-12

Actions
Actions

Also available in: Atom PDF