Bug #16168

USB image creation sometimes fails with: GLib.Error: udisks-error-quark: GDBus.Error:org.freedesktop.UDisks2.Error.NotSupported: No support for modifying a partition a table of type `PMBR' (11)

Added by intrigeri 2018-11-29 09:26:59 . Updated 2018-12-02 14:59:53 .

Status:
Resolved
Priority:
High
Assignee:
Category:
Target version:
Start date:
2018-11-29
Due date:
% Done:

100%

Feature Branch:
feature/15292-generate-usb-image
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Deliverable for:
316

Description

Spotted on https://jenkins.tails.boum.org/view/RM/job/build_Tails_ISO_stable/2433/.

INFO:__main__:Creating empty image '/tmp/tails-build.A5ktXB1y/tails-amd64-stable-3.11-20181129T0717Z-cd0985b389.img'
INFO:__main__:Executing 'dd if=/dev/zero of=/tmp/tails-build.A5ktXB1y/tails-amd64-stable-3.11-20181129T0717Z-cd0985b389.img bs=1M count=1178'
1178+0 records in
1178+0 records out
1235222528 bytes (1.2 GB, 1.2 GiB) copied, 0.643551 s, 1.9 GB/s
INFO:__main__:Setting up loop device
INFO:__main__:Loop device: '/org/freedesktop/UDisks2/block_devices/loop0'
INFO:__main__:Creating GPT
INFO:__main__:Creating partition
INFO:__main__:Partition: '/org/freedesktop/UDisks2/block_devices/loop0p1'
INFO:__main__:Setting partition flags
INFO:__main__:Setting partition type
INFO:__main__:Tearing down loop device
Traceback (most recent call last):
  File "/tmp/tails-build.A5ktXB1y/auto/scripts/create-usb-image-from-iso", line 401, in <module>
    main()
  File "/tmp/tails-build.A5ktXB1y/auto/scripts/create-usb-image-from-iso", line 397, in main
    image_creator.create_image()
  File "/tmp/tails-build.A5ktXB1y/auto/scripts/create-usb-image-from-iso", line 108, in create_image
    self.set_partition_type()
  File "/tmp/tails-build.A5ktXB1y/auto/scripts/create-usb-image-from-iso", line 214, in set_partition_type
    GLib.Variant('a{sv}', None)
GLib.Error: udisks-error-quark: GDBus.Error:org.freedesktop.UDisks2.Error.NotSupported: No support for modifying a partition a table of type `PMBR' (11)

High priority because it affects unrelated branches.

I think that some of the workarounds in Tails Installer make it avoid this hitting this failure mode, although see Bug #10987.


Subtasks


Related issues

Related to Tails - Bug #10987: Tails Installer sometimes fails with: No support for modifying a partition a table of type `PMBR' Resolved 2016-01-24

History

#1 Updated by intrigeri 2018-11-29 09:27:08

  • related to Bug #10987: Tails Installer sometimes fails with: No support for modifying a partition a table of type `PMBR' added

#3 Updated by segfault 2018-11-30 10:45:53

  • Assignee changed from segfault to intrigeri
  • QA Check set to Ready for QA
  • Feature Branch set to feature/15292-generate-usb-image

Seems like that’s another error caused by https://github.com/storaged-project/udisks/issues/418.

I’ve pushed a commit to use sgdisk directly to set the flags instead of the buggy set_flags udisks method.

#4 Updated by intrigeri 2018-11-30 13:06:45

  • Status changed from Confirmed to In Progress
  • Assignee changed from intrigeri to segfault
  • QA Check changed from Ready for QA to Info Needed

Where can I find that commit?

#5 Updated by segfault 2018-12-01 14:47:48

  • Assignee changed from segfault to intrigeri
  • QA Check changed from Info Needed to Ready for QA

Seems like I forgot to push it.

#6 Updated by intrigeri 2018-12-01 15:29:12

  • Assignee changed from intrigeri to segfault
  • % Done changed from 0 to 50
  • QA Check changed from Ready for QA to Pass

Code looks good. I have a doubt about dropping the “wait for the partition to be there” logics in set_partition_flags, but let’s hope the partition will always be there when we run sgdisk. I’m also worried that interleaving operations done via udisks (create/format/mount) and other ones done directly on the .img (sgdisk) may confuse udisks’ understanding of the world. Unfortunately, we won’t know for sure before we merge this into stable & devel: as we’ve seen already with this ticket, it’s hard to spot issues that happen only rarely, due to race conditions, by testing the new code on a single branch. So please merge into master → stable → devel after Jenkins has successfully built this branch a few times; there’s currently one ongoing build and I’ve scheduled another one; sadly one can’t have more than 1 build to the queue so we’ll need to trigger more of those later.

#7 Updated by intrigeri 2018-12-01 15:29:53

  • QA Check changed from Pass to Ready for QA

(More correct since I’ve asked segfault to gather more data from Jenkins before merging.)

#8 Updated by intrigeri 2018-12-01 17:19:01

  • QA Check changed from Ready for QA to Dev Needed

Hold on, with this commit applied, the system partition is not an ESP anymore. I hope we can merge the new automated tests soon so this sort of things can be identified being the code is sent to reviewers. The attributes are set correctly though.

#9 Updated by segfault 2018-12-01 18:10:13

  • Assignee changed from segfault to intrigeri
  • QA Check changed from Dev Needed to Ready for QA

Seems to be another issue with udisks which only happens on Stretch.

#10 Updated by segfault 2018-12-01 18:11:55

I’m starting to think that we would have a lot less trouble (and fewer loc) if we just used sgdisk directly everytime instead of udisks.

#11 Updated by intrigeri 2018-12-02 09:45:15

  • % Done changed from 50 to 80

Code review passes, merged into the Bug #16003 branch. I’ll merge into master→stable→devel once Jenkins has successfully build them a few times.

#12 Updated by intrigeri 2018-12-02 14:59:20

  • Status changed from In Progress to Resolved
  • % Done changed from 80 to 100

Applied in changeset commit:tails|1dcb842386538b5c779fa982de4065b2c92e64ba.

#13 Updated by intrigeri 2018-12-02 14:59:53

  • Assignee deleted (intrigeri)
  • QA Check changed from Ready for QA to Pass