Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails for Heroku 7.68.0 on Debian 11 (stable) #2240

Closed
chetgray opened this issue Feb 11, 2023 · 4 comments
Closed

Installation fails for Heroku 7.68.0 on Debian 11 (stable) #2240

chetgray opened this issue Feb 11, 2023 · 4 comments

Comments

@chetgray
Copy link

chetgray commented Feb 11, 2023

What is the current behavior?

$ sudo apt install heroku
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be upgraded:
  heroku
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
0 not fully installed or removed.
Need to get 0 B/30.5 MB of archives.
After this operation, 0 B of additional disk space will be used.
Retrieving bug reports... Done
Parsing Found/Fixed information... Done
dpkg-deb: error: archive '/var/cache/apt/archives/heroku_7.68.0-1_amd64.deb' uses unknown compression for
 member 'control.tar.zst', giving up
Traceback (most recent call last):
  File "/usr/share/apt-listchanges/DebianFiles.py", line 124, in readdeb
    output = subprocess.check_output(command)
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['dpkg-deb', '-f', '/var/cache/apt/archives/heroku_7.68.0-1_amd64.deb',
 'Package', 'Source', 'Version', 'Architecture', 'Status']' returned non-zero exit status 2.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/bin/apt-listchanges", line 323, in <module>
    main(config)
  File "/usr/bin/apt-listchanges", line 104, in main
    pkg = DebianFiles.Package(deb)
  File "/usr/share/apt-listchanges/DebianFiles.py", line 358, in __init__
    parser.readdeb(self.path)
  File "/usr/share/apt-listchanges/DebianFiles.py", line 127, in readdeb
    raise RuntimeError(_("Error processing '%(what)s': %(errmsg)s") %
RuntimeError: Error processing '/var/cache/apt/archives/heroku_7.68.0-1_amd64.deb': Command '['dpkg-deb', '-f',
 '/var/cache/apt/archives/heroku_7.68.0-1_amd64.deb', 'Package', 'Source', 'Version', 'Architecture',
 'Status']' returned non-zero exit status 2.
dpkg-deb: error: archive '/var/cache/apt/archives/heroku_7.68.0-1_amd64.deb' uses unknown compression for
 member 'control.tar.zst', giving up
dpkg: error processing archive /var/cache/apt/archives/heroku_7.68.0-1_amd64.deb (--unpack):
 dpkg-deb --control subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/heroku_7.68.0-1_amd64.deb
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

What is the expected behavior?

The Heroku .deb would be decompressed and installed.


Debian 11.6 "bullseye" (current stable release) includes dpkg 1.20.12, which does not know how to decompress Zstandard (zstd) format. That functionality was added in dpkg 1.21.18, and while Debian testing "bookworm" has included that version and beyond, it is built with a later version of libc6 than is compatible with that on bullseye, and to install on a bullseye system would require replacing a ton of packages with those from "bookworm", which is untenable.

@chetgray chetgray changed the title Installation fails for Heroku >=7.67.2 on Debian 11 (stable) Installation fails for Heroku 7.68.0 on Debian 11 (stable) Feb 11, 2023
@k80bowman
Copy link
Contributor

Thank you for letting us know. We'll look into it.

@chetgray
Copy link
Author

This is almost a duplicate of #2213 , but the author closed that issue as completed when they found a workaround by using a later version of Ubuntu.

@colindean
Copy link

colindean commented Feb 17, 2023

I'm impacted by this and decided to go down the rabbit hole with some time available to me.

TL;DR it looks like oclif needs to allow the user to configure the compression type, per this S.O. thread.

Research:

The deb is packed in GHA:

- name: Building deb
run: ./scripts/pack/deb

Which eventually calls oclif-dev pack:deb here:

cli/scripts/pack/deb

Lines 11 to 14 in 9aa4339

await execa('./node_modules/.bin/oclif-dev', ['pack:deb'], {
cwd: CLI_ROOT,
stdio: 'inherit'
})

oclif works its packing magic in src/commands/pack/deb.ts, but mostly just writes a bunch of files before invoking dpkg --build.

Through some searching on DDG, I eventually found this S.O. Q/A that indicates that oclif needs to allow the user to specify it in the debian/rules file:

override_dh_builddeb:
    dh_builddeb -- -Zxz

or to pass -Zxz, as alluded by this output on Debian 11.6:

$ dpkg-deb --help
...
  -Z<type>                         Set the compression type used when building.
                                     Allowed types: gzip, xz, none.
...

However, there's a lot of code stuff to test and change there. Perhaps the shortest solution is to use ubuntu-20.04 as the GitHub Actions runner for the pack job instead of ubuntu-latest, which appears to now be 22.04, which I speculate uses zstd by default for compression of debs.

colindean added a commit to colindean/cli that referenced this issue Feb 17, 2023
ubuntu-latest points to Ubuntu 22.04 as of this commit, which may use zstd by default for compressing all or a part of deb packages in `dpkg --build` or `dpkg-deb --build`. Debian 11 cannot use zstd, as filed in heroku#2240. So, revert to building on an older Debian/Ubuntu base to maintain compatibility with Debian 11 since it is still supported.
mdonnalley added a commit to oclif/oclif that referenced this issue Jan 10, 2024
This enables passing options to override what dpkg-deb uses by default,
which is zstd on newer versions of Debian/Ubuntu and xz on older
versions. Debian 11 can't read zstd so when building on newer Debian
base for older, specifying may be necessary.

This should aid in the resolution of heroku/cli#2240.

Co-authored-by: Mike Donnalley <mdonnalley@salesforce.com>
mdonnalley added a commit to oclif/oclif that referenced this issue Jan 10, 2024
* feat: option to specify compression used for pack:deb (#1110)

This enables passing options to override what dpkg-deb uses by default,
which is zstd on newer versions of Debian/Ubuntu and xz on older
versions. Debian 11 can't read zstd so when building on newer Debian
base for older, specifying may be necessary.

This should aid in the resolution of heroku/cli#2240.

Co-authored-by: Mike Donnalley <mdonnalley@salesforce.com>

* fix: use Flags.option

* test: gzip test for pack deb

* fix: no -Z option

* test: debugging

* test: debugging

* test: debugging

---------

Co-authored-by: Colin Dean <colindean@users.noreply.github.com>
@k80bowman
Copy link
Contributor

Closing since we are on version 8.9.0. If this is still happening, please feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants