PBR

Pip fails installing keystone package

Bug #1968877 reported by serenico
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
New
Undecided
Unassigned
PBR
New
Undecided
Unassigned
devstack
In Progress
Undecided
Unassigned

Bug Description

The issue I found is probably related with https://ubuntu.com/security/CVE-2022-24765

When trying to install a python package from a git local directory that is being installed as root using PBR, because PBR is being executing as root, git fails to execute commands on target directory when the directory is owned by another user.

The issue can be reproduced as follow:

 git clone https://opendev.org/openstack/keystone.git
 cd keystone
 sudo pip install -e .

Produces an error (posted at the bottom).

The known workaround for this issue is by executing below command:
 sudo git config --global --add safe.directory /path/to/git/directory

Error message printed out by PiP

       File "/usr/local/lib/python3.8/dist-packages/pbr/packaging.py", line 872, in get_version
        raise Exception("Versioning for this project requires either an sdist"
    Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name keystone was given, but was not able to be found.
    error in setup command: Error parsing /home/vagrant/keystone/setup.cfg: Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name keystone was given, but was not able to be found.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Changed in devstack:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on devstack (master)

Change abandoned by "Federico Ressi <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/devstack/+/837720
Reason: Abandoned in favour of https://review.opendev.org/c/openstack/devstack/+/837659

Revision history for this message
serenico (federico-ressi) wrote :
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.