git ubuntu build fails when user's uid doesn't match ubuntu user in container
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
git-ubuntu |
Confirmed
|
Medium
|
Unassigned |
Bug Description
1. lsb_release: Xenial
2. % snap info git-ubuntu
name: git-ubuntu
summary: Ubuntu development git tooling
publisher: nacc
description: |
Imports, clones, etc. a source package in a git tree
snap-id: VAGSRAriUyDDlqs
commands:
- git-ubuntu
- git-ubuntu.man
- git-ubuntu.
- git-ubuntu.
tracking: edge
installed: 0.6.2+git81.94dbfe1 (357) 99MB classic
refreshed: 2018-02-14 05:17:41 -0600 CST
channels:
stable: 0.2.2+git11.9fa9149 (291) 110MB classic
candidate: 0.6.2+git49.967f050 (346) 99MB classic
beta: ↑
edge: 0.6.2+git81.94dbfe1 (357) 99MB classic
3. git ubuntu build should produce a deb for me
4. git ubuntu build throws errors like:
02/14/2018 16:43:47 - ERROR:Command exited 2: /usr/bin/lxc exec valid-piglet -- sudo -s -H -u ubuntu tar zxCf /tmp /tmp/tmpyltomlj
02/14/2018 16:43:47 - ERROR:stdout:
02/14/2018 16:43:47 - ERROR:stderr: tar (child): /tmp/tmpyltomlj
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
https:/
Looking into the build environment, I can see a mismatch of uids:
(neipa) bionic % whoami
rharper
(neipa) bionic % echo $UID
1001
(neipa) bionic % lxc exec normal-urchin /bin/bash
root@normal-
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
ubuntu@
ubuntu
ubuntu@
1000
ubuntu@
-rw-rw-r-- 1 1001 1001 22039 Feb 14 23:16 /tmp/bcache-
-rw------- 1 1001 1001 28516 Feb 14 23:16 /tmp/tmp1k_
User with UID != <uid of the ubuntu user> will encounter an issue when running build or build-source which ends up pushing files with the UID of the host's user which aren't readable by the in-container ubuntu user.
% git ubuntu build --keep-build-env
02/14/2018 17:14:36 - INFO:Started build container normal-urchin
02/14/2018 17:14:36 - INFO:Not cleaning up build container, it will need to be manually stopped with:
lxc stop --force normal-urchin
02/14/2018 17:14:36 - ERROR:Command exited 100: /usr/bin/lxc exec normal-urchin -- apt-get install -y devscripts equivs sudo
02/14/2018 17:14:36 - ERROR:stdout: Reading package lists...
Building dependency tree...
Reading state information...
Package equivs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
02/14/2018 17:14:36 - ERROR:stderr: E: Package 'equivs' has no installation candidate
02/14/2018 17:14:36 - ERROR:Failed to run apt-get in ephemeral build container (attempt 1/6)
02/14/2018 17:14:37 - ERROR:Command exited 100: /usr/bin/lxc exec normal-urchin -- apt-get install -y devscripts equivs sudo
02/14/2018 17:14:37 - ERROR:stdout: Reading package lists...
Building dependency tree...
Reading state information...
Package equivs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
02/14/2018 17:14:37 - ERROR:stderr: E: Package 'equivs' has no installation candidate
02/14/2018 17:14:37 - ERROR:Failed to run apt-get in ephemeral build container (attempt 2/6)
02/14/2018 17:14:40 - ERROR:Command exited 100: /usr/bin/lxc exec normal-urchin -- apt-get install -y devscripts equivs sudo
02/14/2018 17:14:40 - ERROR:stdout: Reading package lists...
Building dependency tree...
Reading state information...
Package equivs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
02/14/2018 17:14:40 - ERROR:stderr: E: Package 'equivs' has no installation candidate
02/14/2018 17:14:40 - ERROR:Failed to run apt-get in ephemeral build container (attempt 3/6)
02/14/2018 17:16:18 - INFO:Copied build files to normal-urchin
02/14/2018 17:16:19 - ERROR:Command exited 2: /usr/bin/lxc exec normal-urchin -- sudo -s -H -u ubuntu tar zxCf /tmp /tmp/tmp1k_
02/14/2018 17:16:19 - ERROR:stdout:
02/14/2018 17:16:19 - ERROR:stderr: tar (child): /tmp/tmp1k_
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
02/14/2018 17:16:19 - ERROR:Failed to build
Traceback (most recent call last):
File "/snap/
user='ubuntu',
File "/snap/
return run_lxc(_args, **kwargs)
File "/snap/
return run(cmd, env=env_unset_SNAP, **kwargs)
File "/snap/
raise e
File "/snap/
stdout=stdout, stderr=stderr, stdin=stdin)
File "/snap/
output=stdout, stderr=stderr)
subprocess.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/snap/
retry_backoffs,
File "/snap/
stack,
File "/snap/
) from e
RuntimeError: Failed to untar archive tarball in container
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/snap/
retry_backoffs,
File "/snap/
)) from e
RuntimeError: Unable to build using fetch_orig_
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Karl Stenerud (community): Approve
- Robie Basak: Pending requested
-
Diff: 148 lines (+38/-52)1 file modifiedgitubuntu/build.py (+38/-52)
Changed in usd-importer: | |
status: | New → Confirmed |
milestone: | none → future |
tags: | added: build |
Changed in usd-importer: | |
importance: | Undecided → Medium |