Bug #14724

Make Tails Installer's isohybrid detection code robust

Added by anonym 2017-09-25 17:41:52 . Updated 2018-03-22 09:40:50 .

Status:
Rejected
Priority:
Elevated
Assignee:
Category:
Installation
Target version:
Start date:
2017-09-25
Due date:
% Done:

0%

Feature Branch:
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Installer
Deliverable for:

Description

From Feature #8860#note-57:

I’m a tiny bit worried about the new isohybrid detection code (commit:b7dcb936a58bb0016981645c9224caee4493112a): I’ve seen very weird stuff happening when the kernel detects these devices, kinda lacking determinism (sometimes it would be recognized in a way, sometimes in the other) which is not surprising given such devices are really two different things at the same time. Let’s not bother for now but keep it in mind if we get related bug reports.

From Feature #8860#note-66:

I think I’ve found a bug:

  1. dd a Tails ISO to a USB stick
  2. leave that USB stick plugged
  3. start Tails Installer
  4. /dev/sdc1 is automatically selected
  5. the “Upgrade” button is visible (weird) but disabled (OK)
  6. the “Reinstall (delete all data)” button is enabled, which is inconsistent wrt. the “Upgrade” button (but if I click on it I’m told “No ISO image selected” as expected); that’s another bug, please handle it separately
  7. once I select an ISO image the “Upgrade” button is enabled
  8. clicking “Upgrade” fails with “Unknown GLib exception while trying to mount device: udisks-error-quark: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error mounting /dev/sdb1 at /media/intrigeri/Tails2: Wrong fs type, /dev/sdb1 has an invalid superblock or missing helper program. (0)”
  9. unplug / re-plug the USB stick => I see an “Install” button, which works.

That’s a regression because in 4.4.18+dfsg-1 when clicking “Upgrade” I was told:

It is impossible to upgrade the device TOSHIBA TransMemory (7.8 GB) - /dev/sdb1 because it was not created using Tails Installer. You should instead use "Install from ISO" to upgrade Tails on this device.

… and when clicking “Install” the correct device (/dev/sdb) is selected.

Granted, it’s a corner case and thankfully our doc does not instructs anyone to do that. But it makes the developer experience a bit painful, and (worse) confusing when working on the code that handles isohybrid’ed devices. Also, I had doubts wrt. the robustness of some changes made in our isohybrid detection code on this ticket, and this experience decreases a bit my level of confidence.

And here is the response to the above from Feature #8860#note-67:

So this is exactly what we do in the Writing a Tails isohybrid to a USB drive [...] scenario, except that the dd:ing doesn’t happen during the same session we start tails-installer. I’m hypothesizing that the flakiness you’ve seen re: “isohybrid detection” only occurs during the session the isohybrid is dd:ed to the disk, due to a race between the writing of the partition table to the disk, and the scanning of said partition table, possibly in an intermediate state of the write.


Subtasks


Related issues

Related to Tails - Bug #10912: Tails Installer fails to install on USB stick that has a isohybrid dd'ed to it Resolved 2016-01-12
Related to Tails - Bug #15031: Installing to a device that previously had an hybrid ISO copied to it is fragile Resolved 2017-12-09

History

#1 Updated by anonym 2017-09-25 17:44:08

  • Description updated

#2 Updated by intrigeri 2017-09-26 05:42:10

  • Subject changed from Make Tails Installer's isohybrid detection code robus to Make Tails Installer's isohybrid detection code robust

#3 Updated by intrigeri 2017-11-06 15:45:20

  • Assignee changed from anonym to kurono

kurono, perhaps you would like to work on this? Ideally it should be done for 3.3 but don’t worry too much: let’s first focus on polishing (if needed) and merging the work you’ve already submitted for QA; this one can wait a bit more.

#4 Updated by kurono 2017-11-09 12:56:39

  • Target version changed from Tails_3.3 to Tails_3.5

#5 Updated by intrigeri 2017-12-15 06:22:43

  • related to Bug #10912: Tails Installer fails to install on USB stick that has a isohybrid dd'ed to it added

#6 Updated by intrigeri 2017-12-15 06:22:48

  • related to Bug #15031: Installing to a device that previously had an hybrid ISO copied to it is fragile added

#7 Updated by intrigeri 2017-12-15 06:36:09

  • Priority changed from Normal to Elevated

I’m raising priority because we see lots of failures in our test suite when installing with Tails Installer on a device that had an ISO dd’ed to, but this time it’s happening in a different session: the computer was rebooted in the meantime, which cancels anonym’s initial hypothesis. See the full debug log on Bug #15031. I don’t know if this failure is related to the problem that made us open this ticket, but we already have Bug #10912 to track a different kind of failures in similar situations, and I’d rather not create a 3rd ticket about this, so let’s say this one is about the regressions wrt. isohybrid’ed sticks handling introduced in Tails Installer 5.x.

kurono, is this something you think you can work on in the next few weeks? Ideally something would be ready to review early in January, so we have time to review/polish/etc. before the 3.5 release.

#8 Updated by Anonymous 2018-01-15 15:51:05

  • Target version changed from Tails_3.5 to Tails_3.6

Postponing as 3.5 is supposed to be released in 8 days.
kurono, do you think you could work on this for 3.6?

#9 Updated by kurono 2018-01-15 17:46:47

u wrote:
> Postponing as 3.5 is supposed to be released in 8 days.
> kurono, do you think you could work on this for 3.6?

I will do my best to have it done to 3.6

#10 Updated by intrigeri 2018-03-05 07:45:51

Context: this bug makes my work on Feature #14595 painful (Bug #15031); the deal was that anonym would fix it 3.5 months ago to the latest.

kurono wrote:
> I will do my best to have it done to 3.6

We’re now in the 3.6 feature freeze but a good, well tested bugfix could still potentially make it. What’s your current ETA? If it’s later than March 15, please reassign to anonym and I’ll discuss the best course of action with him. Thanks!

#11 Updated by kurono 2018-03-12 18:51:07

  • Assignee changed from kurono to intrigeri
  • QA Check set to Info Needed

intrigeri wrote:
> Context: this bug makes my work on Feature #14595 painful (Bug #15031); the deal was that anonym would fix it 3.5 months ago to the latest.
>
> kurono wrote:
> > I will do my best to have it done to 3.6
>
> We’re now in the 3.6 feature freeze but a good, well tested bugfix could still potentially make it. What’s your current ETA? If it’s later than March 15, please reassign to anonym and I’ll discuss the best course of action with him. Thanks!

I am not able to reproduce this, I have even tried to create an test scenario:

Given a computer
And I start Tails from DVD with network unplugged and I login
And I temporarily create a 7200 MiB disk named “isohybrid”
And I write the Tails ISO image to disk “isohybrid”
And I plug USB drive “isohybrid”
And I upgrade Tails to USB drive “isohybrid” by cloning
Then the running Tails is installed on USB drive “isohybrid”
But there is no persistence partition on USB drive “isohybrid”
When I shutdown Tails and wait for the computer to power off
And I start Tails from USB drive “isohybrid” with network unplugged and I login
Then Tails is running from USB drive “isohybrid”
And the boot device has safe access rights
And there is no persistence partition on USB drive “isohybrid”

but it fails because there is no upgrade button available.
Do you know how can I reproduce it?

#12 Updated by intrigeri 2018-03-12 22:45:48

  • Target version changed from Tails_3.6 to Tails_3.7

#13 Updated by intrigeri 2018-03-22 09:39:09

  • Status changed from Confirmed to Rejected

> I am not able to reproduce this

I cannot reproduce it anymore. It might be yet another race condition that happens only sometimes. I’m still not convinced that b7dcb936a58bb0016981645c9224caee4493112a will do the right thing in all cases but well, let’s close this ticket for now: we have Bug #10912 to track this class of issues.

#14 Updated by intrigeri 2018-03-22 09:40:51

  • Assignee deleted (intrigeri)
  • QA Check deleted (Info Needed)