Skip to content

Failures during APT install of rlwrap don't abort the build immediately #169

Open
@edmorley

Description

@edmorley

Seen in Direwolf run 7e8bf080-e552-4614-98de-12872e040cc6 (which is building the Clojure Getting Started guide):

    remote: -----> Building on the Heroku-24 stack        
    remote: -----> Determining which buildpack to use for this app        
    remote: -----> Clojure (Leiningen 2) app detected        
    remote: -----> Installing Azul Zulu OpenJDK 17.0.15        
    remote: -----> Installing rlwrap...         
    remote:        Get:1 https://apt.postgresql.org/pub/repos/apt noble-pgdg InRelease [129 kB]        
    remote:        Get:2 https://apt.postgresql.org/pub/repos/apt noble-pgdg/main amd64 Packages [500 kB]        
    remote:        Get:3 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]        
    remote:        Get:4 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages [1,026 kB]        
    remote:        Get:5 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages [1,080 kB]        
    remote:        Ign:6 http://archive.ubuntu.com/ubuntu noble InRelease        
    remote:        Get:7 http://archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]        
    remote:        Get:8 http://archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB]        
    remote:        Get:6 http://archive.ubuntu.com/ubuntu noble InRelease [256 kB]        
    remote:        Get:9 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [1,378 kB]        
    remote:        Get:10 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [1,345 kB]        
    remote:        Get:11 http://archive.ubuntu.com/ubuntu noble-backports/universe amd64 Packages [31.8 kB]        
    remote:        Get:12 http://archive.ubuntu.com/ubuntu noble-backports/main amd64 Packages [48.0 kB]        
    remote:        Get:13 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages [19.3 MB]        
    remote:        Get:14 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages [1,808 kB]        
    remote: rm: cannot remove '/var/cache/apt/archives/partial/*.deb': Permission denied        
    remote:        Fetched 27.3 MB in 1min 31s (300 kB/s)        
    remote:        Reading package lists...        
    remote:        Reading package lists...        
    remote:        Building dependency tree...        
    remote:        The following NEW packages will be installed:        
    remote:          rlwrap        
    remote:        0 upgraded, 1 newly installed, 0 to remove and 31 not upgraded.        
    remote:        Need to get 107 kB of archives.        
    remote:        After this operation, 328 kB of additional disk space will be used.        
    remote:        Ign:1 http://archive.ubuntu.com/ubuntu noble/universe amd64 rlwrap amd64 0.46.1-1build2        
    remote:        Ign:1 http://archive.ubuntu.com/ubuntu noble/universe amd64 rlwrap amd64 0.46.1-1build2        
    remote:        Ign:1 http://archive.ubuntu.com/ubuntu noble/universe amd64 rlwrap amd64 0.46.1-1build2        
    remote:        Err:1 http://archive.ubuntu.com/ubuntu noble/universe amd64 rlwrap amd64 0.46.1-1build2        
    remote:          Connection failed [IP: 185.125.190.82 80]        
    remote: E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/r/rlwrap/rlwrap_0.46.1-1build2_amd64.deb  Connection failed [IP: 185.125.190.82 80]        
    remote: E: Some files failed to download        
    remote: ls: cannot access '/tmp/codon/tmp/cache/clojure-bp-apt/cache/archives/*.deb': No such file or directory        
    remote: chmod: cannot access '/tmp/build_d5f94e88/.heroku/apt/usr/bin/*': No such file or directory        
    remote:  !     Push rejected, failed to compile Clojure (Leiningen 2) app.        

The build should have aborted after the E: Some files failed to download and not tried to continue onto the ls command, here:

echo "-----> Installing rlwrap... "
apt-get $APT_OPTIONS update | indent
apt-get $APT_OPTIONS -y -d install --reinstall rlwrap | indent
mkdir -p $buildDir/.profile.d
cat <<EOF >$buildDir/.profile.d/rlwrap.sh
export PATH="\$HOME/.heroku/apt/usr/bin:\$PATH"
export LD_LIBRARY_PATH="\$HOME/.heroku/apt/usr/lib/x86_64-linux-gnu:\$HOME/.heroku/apt/usr/lib/i386-linux-gnu:\$HOME/.heroku/apt/usr/lib:\$LD_LIBRARY_PATH"
export LIBRARY_PATH="\$HOME/.heroku/apt/usr/lib/x86_64-linux-gnu:\$HOME/.heroku/apt/usr/lib/i386-linux-gnu:\$HOME/.heroku/apt/usr/lib:\$LIBRARY_PATH"
export INCLUDE_PATH="\$HOME/.heroku/apt/usr/include:\$INCLUDE_PATH"
export CPATH="\$INCLUDE_PATH"
export CPPPATH="\$INCLUDE_PATH"
export PKG_CONFIG_PATH="\$HOME/.heroku/apt/usr/lib/x86_64-linux-gnu/pkgconfig:\$HOME/.heroku/apt/usr/lib/i386-linux-gnu/pkgconfig:\$HOME/.heroku/apt/usr/lib/pkgconfig:\$PKG_CONFIG_PATH"
export PYTHONPATH="\$HOME/.heroku/apt/usr/lib/python2.7/dist-packages"
export SCREENDIR="\$HOME/.heroku/apt/var/run/screen"
EOF
for DEB in $(ls -1 $APT_CACHE_DIR/archives/*.deb); do
dpkg -x $DEB $buildDir/.heroku/apt/
done

I'm guessing the reason is that pipefail isn't enabled, given that the apt install command uses a pipe to indent:

apt-get $APT_OPTIONS -y -d install --reinstall rlwrap | indent

cc @Malax

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions