bzip2 is not available in the snap

Bug #1928775 reported by Christian Ehrhardt 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-ubuntu
Fix Released
Undecided
Robie Basak

Bug Description

[Affects the edge snap and git master only]

I've realized that postgresql-13 isn't imported yet into git ubuntu.
I wanted to locally import it to work with that repository until it is officially imported.

But I've found it to crash
$ cd /tmp/
$ mkdir postgresql-13
$ cd postgresql-13
$ git ubuntu import postgresql-13 -d postgresql-13 --no-push --no-fetch
05/18/2021 12:00:03 - INFO:Ubuntu Server Team importer v1.0
05/18/2021 12:00:07 - INFO:Importing patches-unapplied 13~beta2-1 to debian/experimental
05/18/2021 12:00:09 - INFO:Downloading postgresql-13_13~beta2.orig.tar.bz2 from launchpad.net (20.375 MiB)
05/18/2021 12:00:17 - INFO:Downloading postgresql-13_13~beta2-1.debian.tar.xz from launchpad.net (0.021 MiB)
05/18/2021 12:00:19 - ERROR:Command exited 1: gbp import-orig --no-merge --upstream-branch do-not-push --pristine-tar --no-interactive --no-symlink-orig '--upstream-tag=importer/upstream/debian/%(version)s.bz2' /tmp/postgresql-13/postgresql-13/.git/git-ubuntu-cache/postgresql-13_13~beta2.orig.tar.bz2
05/18/2021 12:00:19 - ERROR:stdout:
05/18/2021 12:00:19 - ERROR:stderr: tar (child): lbzip2: Cannot exec: No such file or directory
  tar (child): Error is not recoverable: exiting now
  tar: Child returned status 2
  tar: Error is not recoverable: exiting now
  gbp:error: Couldn't unpack '/tmp/postgresql-13/postgresql-13/.git/git-ubuntu-cache/postgresql-13_13~beta2.orig.tar.bz2': it exited with 2

05/18/2021 12:00:19 - WARNING:Unable to pristine-tar import orig tarball for 13~beta2-1
05/18/2021 12:00:19 - ERROR:Command exited 29: dpkg-source -x --skip-patches /tmp/postgresql-13/postgresql-13/.git/git-ubuntu-cache/postgresql-13_13~beta2-1.dsc /tmp/tmptyu3ehe8/x
05/18/2021 12:00:19 - ERROR:stdout: dpkg-source: info: extracting postgresql-13 in /tmp/tmptyu3ehe8/x
  dpkg-source: info: unpacking postgresql-13_13~beta2.orig.tar.bz2

05/18/2021 12:00:19 - ERROR:stderr: Can't exec "bunzip2": No such file or directory at /snap/git-ubuntu/514/usr/share/perl5/Dpkg/IPC.pm line 311.
  dpkg-source: error: unable to execute bunzip2: No such file or directory
  tar: This does not look like a tar archive
  tar: Exiting with failure status due to previous errors
  dpkg-source: error: tar -xf - --no-same-permissions --no-same-owner --anchored --no-wildcards-match-slash --exclude */.pc --exclude .pc subprocess returned exit status 2

Traceback (most recent call last):
  File "/snap/git-ubuntu/514/usr/lib/python3/dist-packages/gitubuntu/importer.py", line 2251, in import_publishes
    import_func(
  File "/snap/git-ubuntu/514/usr/lib/python3/dist-packages/gitubuntu/importer.py", line 1920, in import_unapplied_spi
    import_unapplied_dsc(
  File "/snap/git-ubuntu/514/usr/lib/python3/dist-packages/gitubuntu/importer.py", line 1832, in import_unapplied_dsc
    unapplied_import_tree_hash = dsc_to_tree_hash(
  File "/snap/git-ubuntu/514/usr/lib/python3/dist-packages/gitubuntu/importer.py", line 112, in dsc_to_tree_hash
    run(cmd)
  File "/snap/git-ubuntu/514/usr/lib/python3/dist-packages/gitubuntu/run.py", line 87, in run
    raise e
  File "/snap/git-ubuntu/514/usr/lib/python3/dist-packages/gitubuntu/run.py", line 64, in run
    cp = subprocess.run(
  File "/snap/git-ubuntu/514/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['dpkg-source', '-x', '--skip-patches', '/tmp/postgresql-13/postgresql-13/.git/git-ubuntu-cache/postgresql-13_13~beta2-1.dsc', '/tmp/tmptyu3ehe8/x']' returned non-zero exit status 29.

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

Traceback (most recent call last):
  File "/snap/git-ubuntu/514/usr/bin/git-ubuntu", line 11, in <module>
    load_entry_point('gitubuntu==1.0', 'console_scripts', 'git-ubuntu')()
  File "/snap/git-ubuntu/514/usr/lib/python3/dist-packages/gitubuntu/__main__.py", line 269, in main
    sys.exit(args.func(args))
  File "/snap/git-ubuntu/514/usr/lib/python3/dist-packages/gitubuntu/importer.py", line 2355, in cli_main
    return main(
  File "/snap/git-ubuntu/514/usr/lib/python3/dist-packages/gitubuntu/importer.py", line 497, in main
    _main_with_repo(
  File "/snap/git-ubuntu/514/usr/lib/python3/dist-packages/gitubuntu/importer.py", line 306, in _main_with_repo
    history_found = import_publishes(
  File "/snap/git-ubuntu/514/usr/lib/python3/dist-packages/gitubuntu/importer.py", line 2264, in import_publishes
    raise GitUbuntuImportError(msg) from e
gitubuntu.importer.GitUbuntuImportError: Unable to import patches-unapplied 13~beta2-1

Tags: snap

Related branches

Revision history for this message
Robie Basak (racb) wrote :

It is imported, but isn't the default repository in Launchpad. git-ubuntu can't do that as it doesn't have the privileges.

We have three separate issues here:

1) git-ubuntu has no automated mechanism to automatically make newly imported repositories the default repositories for the Ubuntu package target in Launchpad, which means that "git ubuntu clone <package>" doesn't work straight away. Manual intervention (by any core dev) is required.

2) bzip2 is broken in the snap as you discovered, but this is only in the edge snap and I have a card on it. The importer service instance isn't affected as it runs beta.

3) [not sure you hit this] packages in main are assessed when the poller is started, and not updated afterwards. Restarting the poller is necessary after a component change. The latest refactoring in edge now makes it easier to fix this, but this might not be worth worrying because we intend to import all packages anyway.

Which issue (if any) would you like to track with this bug?

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks,
I was affected by #1 and resolved via the lp-shell hint you passed me.

I was filing this bug for #2, but if you already have a card on it I can live without further pushing on it.

#3 isn't a problem for me atm.

You can either close the bug as "already tracked elsewhere" or keep it around until #2 is resolved as that is what this bug was meant for.

Robie Basak (racb)
summary: - postgresql-13 fails to import - lbzip2: Cannot exec: No such file or
- directory
+ bzip2 is not available in the snap
description: updated
Changed in usd-importer:
status: New → Triaged
assignee: nobody → Robie Basak (racb)
tags: added: snap
Robie Basak (racb)
Changed in usd-importer:
status: Triaged → In Progress
Robie Basak (racb)
Changed in usd-importer:
status: In Progress → Fix Committed
Revision history for this message
Robie Basak (racb) wrote : Fix released in git-ubuntu

Fix released in git-ubuntu version 1.1

Changed in git-ubuntu:
status: Fix Committed → Fix Released
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.