tempfile command removed from debianutils

Bug #1951779 reported by Eternal Snow
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
boost1.74 (Ubuntu)
Invalid
Wishlist
Unassigned
bzip2 (Ubuntu)
Fix Released
Medium
Unassigned
ceph (Ubuntu)
Won't Fix
Wishlist
Unassigned
grub-legacy-ec2 (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Error when do-release-upgrade -d from 20.04.3

ProblemType: Package
DistroRelease: Ubuntu 22.04
Package: linux-image-5.13.0-19-generic 5.13.0-19.19
ProcVersionSignature: Ubuntu 5.4.0-90.101-generic 5.4.148
Uname: Linux 5.4.0-90-generic x86_64
ApportVersion: 2.20.11-0ubuntu73
Architecture: amd64
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/by-path', '/dev/snd/controlC0', '/dev/snd/hwC0D2', '/dev/snd/pcmC0D3p', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
CasperMD5CheckResult: unknown
Date: Mon Nov 22 13:31:36 2021
ErrorMessage: run-parts: /etc/kernel/postinst.d/x-grub-legacy-ec2 exited with return code 127
InstallationDate: Installed on 2018-10-01 (1147 days ago)
InstallationMedia: Ubuntu-Server 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180725)
IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig'
Lsusb:
 Bus 001 Device 002: ID 8087:07e6 Intel Corp.
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Lsusb-t:
 /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/8p, 480M
     |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
MachineType: PAIQ EC3-BT19D4L
ProcFB: 0 i915drmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.4.0-90-generic root=UUID=4c36d2b3-c1dd-469f-bfbf-5b7052d669d4 ro ipv6.disable=1 quiet reboot=pci ipv6.disable=1
Python3Details: Error: command ['readlink', '-f', "/usr/bin/which: this version of `which' is deprecated; use `command -v' in scripts instead.\n/usr/bin/python3"] failed with exit code 1: , Error: [Errno 2] No such file or directory: 'Error: command [\'readlink\', \'-f\', "/usr/bin/which: this version of `which\' is deprecated; use `command -v\' in scripts instead.\\n/usr/bin/python3"] failed with exit code 1: ', python3-minimal, 3.9.4-1build1
PythonDetails: N/A
RebootRequiredPkgs: Error: path contained symlinks.
RelatedPackageVersions: grub-pc 2.04-1ubuntu48
RfKill: Error: [Errno 2] No such file or directory: 'rfkill'
SourcePackage: grub-legacy-ec2
Title: package linux-image-5.13.0-19-generic 5.13.0-19.19 failed to install/upgrade: run-parts: /etc/kernel/postinst.d/x-grub-legacy-ec2 exited with return code 127
UpgradeStatus: Upgraded to jammy on 2021-11-22 (0 days ago)
dmi.bios.date: 02/28/2017
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 5.6.5
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: EC3-BT19D4L
dmi.board.vendor: PAIQ
dmi.board.version: A1
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: To Be Filled By O.E.M.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr5.6.5:bd02/28/2017:svnPAIQ:pnEC3-BT19D4L:pvrBIOSNameBT190003BIOSVersionA1BuildDate:rvnPAIQ:rnEC3-BT19D4L:rvrA1:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.family: To be filled by O.E.M.
dmi.product.name: EC3-BT19D4L
dmi.product.sku: 18:19:28
dmi.product.version: BIOS Name:BT190003 BIOS Version:A1 Build Date:
dmi.sys.vendor: PAIQ

Related branches

Revision history for this message
Eternal Snow (scegg) wrote :
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for taking the time to report this bug and trying to make Ubuntu better.

This seems to be a bug indeed. From the upgrade logs we can see:

/etc/kernel/postinst.d/x-grub-legacy-ec2:
Searching for GRUB installation directory ... found: /boot/grub
/usr/sbin/update-grub-legacy-ec2: line 494: tempfile: command not found
run-parts: /etc/kernel/postinst.d/x-grub-legacy-ec2 exited with return code 127
dpkg: error processing package linux-image-5.13.0-19-generic (--configure):
 installed linux-image-5.13.0-19-generic package post-installation script subprocess returned error exit status 1

The important part here is the "tempfile: command not found". The tempfile command was removed from debianutils package in version 5.0, and during the do-release-upgrade run it was upgraded from version 4.9.1 (Focal) to version 5.5-1 (Jammy). The debianutils package was upgraded before linux-image-5.13.0-19-generic:5.13.0-19.19 and then when the linux-image postinst triggered the execution of /usr/sbin/update-grub-legacy-ec2 you got the crash because this script still relies on the tempfile command.

In order to do not break upgrades from Focal to Jammy we need to make the update-grub-legacy-ec2 script in src:grub-legacy-ec2 use likely "mktemp" instead of "tempfile". A bonus point would be to avoid using the "which" command (probably use "command -v") since it was already deprecated in debianutils version 5.0 and should be removed in the future.

Changed in grub-legacy-ec2 (Ubuntu):
status: New → Triaged
tags: added: server-next
summary: - package linux-image-5.13.0-19-generic 5.13.0-19.19 failed to
- install/upgrade: run-parts: /etc/kernel/postinst.d/x-grub-legacy-ec2
- exited with return code 127
+ tempfile command removed from debianutils
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

We all wanted to have a look, this is what I found:

boost/boost1.74-1.74.0/tools/quickbook/build/warning-check:5:tmpfile=$(tempfile)
That is in jammy's current 1.74.0-13ubuntu1 but only referenced for travis runs (of the doc build).
Worth a task to check in detail, but unlikely to need a fix.

ceph/ceph/src/boost/tools/quickbook/build/warning-check:5:tmpfile=$(tempfile)
^^ That is the same as above as embedded source, worth a check if it is used indirectly anywhere (unlikely).

get-docker-images/ubuntu-layer/bin/bzexe:123:tmpfile=`tempfile -p gztmp -d /tmp` || exit 1
I found it here but it is actually part of src:bzip2
Fixed by
https://salsa.debian.org/debian/bzip2/-/commit/aff0bec9ea82646baf6d9d824022bc6f3cf46514
This is not yet uploaded to Debian and therefore missing in Jammy as well

Changed in bzip2 (Ubuntu):
importance: Undecided → Medium
Changed in ceph (Ubuntu):
importance: Undecided → Wishlist
Changed in boost1.74 (Ubuntu):
importance: Undecided → Wishlist
Changed in grub-legacy-ec2 (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Robie Basak (racb) wrote (last edit ):

In Ubuntu we've temporarily restored tempfile (for Jammy), but it's still deprecated and prints a deprecation notice to stderr, so I'm leaving the tasks for the other packages open, as they still need to move away from using tempfile.

tags: added: server-todo
removed: server-next
tags: added: bitesize
Changed in ceph (Ubuntu):
assignee: nobody → Miriam España Acebal (mirespace)
Revision history for this message
Miriam España Acebal (mirespace) wrote :

Hi!

For ceph, I was checking the use of the warning-check script commented on #3. Nothing is calling it in the repo.

At first glance, someone could think about this as necessary if it used in building time of Quickbook for boost, but I checked the building log for Jammy [1] and I didn't find any use of it.

[1] https://launchpadlibrarian.net/580257529/buildlog_ubuntu-jammy-amd64.ceph_16.2.7-0ubuntu2_BUILDING.txt.gz

Changed in ceph (Ubuntu):
status: New → Won't Fix
Changed in grub-legacy-ec2 (Ubuntu):
assignee: nobody → Miriam España Acebal (mirespace)
Changed in ceph (Ubuntu):
assignee: Miriam España Acebal (mirespace) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub-legacy-ec2 - 1:1ubuntu2

---------------
grub-legacy-ec2 (1:1ubuntu2) jammy; urgency=medium

  * Updates for deprecated calls (LP: #1951779)
    - d/update-grub-legacy-ec2: switch tempfile to mktemp
    - d/grub-legacy-ec2.postrm: switch which to command -v

 -- Christian Ehrhardt <email address hidden> Thu, 13 Jan 2022 09:53:19 +0100

Changed in grub-legacy-ec2 (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Miriam España Acebal (mirespace) wrote :

Fortunately, bzip2 landed in Debian and Jammy with the fix on Dec'21:

https://launchpad.net/ubuntu/+source/bzip2/1.0.8-5

bzip2 (1.0.8-5) unstable; urgency=medium

[...]
  * Use mktemp in bzexe instead of the no longer available tempfile
    (Closes: #992442)
[...]
 -- Anthony Fok <email address hidden> Fri, 03 Dec 2021 01:32:51 -0700

Changed in bzip2 (Ubuntu):
status: New → Won't Fix
Revision history for this message
Miriam España Acebal (mirespace) wrote (last edit ):

In the case of boost1.74, attending to the doc for Quickbook here [1], it seems that can be a rebuild of Quickbook (and maybe use of the warning-check script), because in the build log for boost1.74 [2] the following can be seen:

echo "using boostbook ;" > user-config-doc.jam
echo "using quickbook ;" >> user-config-doc.jam

and the building with b2/bjam :

cd tools/quickbook && /<<PKGBUILDDIR>>/b2 -j4 -q -d2 --layout=system --ignore-site-config --user-config=/<<PKGBUILDDIR>>/user-config.jam debug-symbols=on
Performing configuration checks

but the script is not used here, not deployed later with the package (checking if it can be used in quickbook's rebuilding):

ubuntu@tempfile-20-2-22:~$ apt-file search boost1.74 | grep quickbook
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/doc/html/quickbook.html
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/doc/html/quickbook/change_log.html
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/doc/html/quickbook/command_line.html
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/doc/html/quickbook/editors.html
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/doc/html/quickbook/faq.html
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/doc/html/quickbook/install.html
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/doc/html/quickbook/ref.html
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/doc/html/quickbook/syntax.html
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/doc/html/quickbook/syntax/block.html
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/doc/html/quickbook/syntax/phrase.html
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/doc/html/quickbook/syntax/structure.html
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/doc/html/quickbook/versions.html
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/examples/tools/quickbook/examples/simple-boostbook/Jamfile.v2
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/examples/tools/quickbook/examples/simple-boostbook/simple.xml
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/examples/tools/quickbook/examples/simple-quickbook/Jamfile.v2
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/examples/tools/quickbook/examples/simple-quickbook/simple.qbk
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/examples/tools/quickbook/examples/standalone-quickbook/Jamfile.v2
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/examples/tools/quickbook/examples/standalone-quickbook/Jamroot.jam
libboost1.74-doc: /usr/share/doc/libboost1.74-doc/examples/tools/quickbook/examples/standalone-quickbook/simple.qbk

[1] https://www.boost.org/doc/libs/1_74_0/doc/html/quickbook/install.html#quickbook.install.linux
[2] https://launchpadlibrarian.net/580760449/buildlog_ubuntu-jammy-amd64.boost1.74_1.74.0-14ubuntu1_BUILDING.txt.gz

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

Per comment #7 and
 bzip2 | 1.0.8-5 | jammy | source, amd64, arm64, armhf, i386, ppc64el, riscv64, s390x

Setting that to fix released.

Changed in bzip2 (Ubuntu):
status: Won't Fix → Fix Released
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

And as comment #8 and #3 outlined the use of it in boost is not a real problem for build or usage in the distribution, setting that task to invalid.

Changed in boost1.74 (Ubuntu):
status: New → Invalid
Changed in grub-legacy-ec2 (Ubuntu):
assignee: Miriam España Acebal (mirespace) → nobody
tags: removed: server-todo
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.