Open blalor opened 8 years ago
I've seen this issue before with yum (and apt-get I think?), and I have no clue what causes it. I saw this while running acbuild in a tty, so I kind of doubt that's the issue there. I'll dig into this next time I can spare some cycles.
If I can't figure out the cause of this, https://github.com/appc/acbuild/issues/13 (if it ever gets done) might also end up shining some light on this.
Your logs are implying you're getting to the point of exec'ing systemd-nspawn in lib/run.go
, so it's unlikely that this will fix it, but would you mind seeing if https://github.com/appc/acbuild/pull/171 fixes this for you?
I'm having good luck reproducing acbuild bugs by replicating people's setup. What distro is this on, and any chance you'd be willing to share your acbuild script?
I'm building on stock CentOS 7.2 with updates; currently kernel 3.10.0-327.10.1.el7.x86_64
and systemd-219-19.el7_2.4.x86_64
.
I'm avoiding systemd-nspawn entirely by using a shell script replacement.
This is one of my build scripts, but without my systemd-nspawn replacement, it just dies at the first acbuild run
:
#!/usr/bin/env bash
## must be run as root, or "acbuild run" will fail
set -e -u -o pipefail
## sudo fucks with our PATH, via secure_path
export PATH=/usr/local/bin:$PATH
acbuild="acbuild --debug"
if [ $# -ne 3 ]; then
echo "usage: $0 <parent aci spec> <aci name> <version>"
exit 1
fi
parent_aci_spec="${1}"
aci_name="${2}"
aci_version="${3}"
cur_dir=${PWD}
dest_dir="${cur_dir}/work"
mkdir -p "${dest_dir}"
function cleanup() {
EXIT=$?
$acbuild end
exit ${EXIT}
}
trap cleanup EXIT
$acbuild begin
rootfs=".acbuild/currentaci/rootfs"
$acbuild annotation add created "$( date --rfc-3339=ns | tr ' ' 'T' )"
$acbuild set-name "${aci_name}"
$acbuild label add version "${aci_version}"
$acbuild label add os linux
$acbuild label add arch amd64
$acbuild dependency add "${parent_aci_spec}"
cp -r src ${rootfs}/src/
$acbuild run -- /src/setup.sh
$acbuild set-exec /launch
# $acbuild environment add COLLECTD_HOST
# $acbuild environment add COLLECTD_PORT
# $acbuild environment add COLLECTD_USERNAME
# $acbuild environment add COLLECTD_PASSWORD
# $acbuild environment add LOG_COURIER_DEST
# $acbuild environment add LOG_COURIER_TAGS
rm -rfv \
${rootfs}/etc/localtime \
${rootfs}/etc/resolv.conf \
${rootfs}/usr/share/zoneinfo/
mkdir -p "$( dirname "${dest_dir}/${aci_name}" )"
$acbuild write "${dest_dir}/${aci_name}"
## generate XML (aieeee!) describing what we just built
## this is mainly for GoCD, so we can set properties based on this artifact
{
echo '<?xml version="1.0" encoding="utf-8"?>'
echo '<aci>'
echo " <name>${aci_name}</name>"
echo " <version>${aci_version}</version>"
echo '</aci>'
} > "${dest_dir}/aci.xml"
## also, since I don't yet have a handle on how these dependencies are going to
## be chained, capture the manifest.
$acbuild cat-manifest > "${dest_dir}/manifest"
## we're probably root, anyway, but check just in case
if [ "${EUID}" -eq 0 ]; then
## ensure the calling user can remove the generated files
chown -R "$( stat --format='%U:%G' . )" "${dest_dir}"
fi
I installed Centos 7.2, and am on the same versions of the kernel and systemd as you are. I made a src/setup.sh
that just runs yum install -y java-1.8.0-openjdk-headless.x86_64
, and ran your script with the current master of acbuild.
Still can't reproduce this, and I have no clue why systemd-nspawn isn't working out for you. Maybe this just means it's time to get around to https://github.com/appc/acbuild/issues/13 finally, so it'll be easy for you to swap out systemd-nspawn for something else.
I'm now having this same issue when using acbuild v0.4.0, it was not present in v0.3.1.
CentOS Linux release 7.2.1511 (Core) 3.10.0-327.el7.x86_64 systemd-219-19.el7.x86_64
Running: [/bin/sh -c (yum clean all)]
Warning: "/bin/sh" is a symlink, which systemd-nspawn version 219 might error on
Container rootfs terminated by signal KILL.
run: non-zero exit code: 1
Ending the build
I'm running into the above error when running acbuild in my CI system (GoCD), but not when running it by hand. I get no other meaningful information:
This is with acbuild from the current master, and with a couple of debug statements added to output the systemd-nspawn command (I removed
--quiet
, too) and the environment.The host OS is CentOS 7.2 with
systemd-219-19.el7.x86_64
. Thebase/centos7
dependency is the same.systemd-nspawn is such a pain in the ass. Any ideas how I can troubleshoot this? Could it have something to do with not having a controlling tty?