'extended_part_no' referenced before assignment error during install

Bug #1861251 reported by Dmitriy Vinokurov
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
curtin
Fix Committed
Medium
Ryan Harper
subiquity (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Hi all!

I'm trying to install ubuntu-18.04.3-live-server-amd64.iso to our Supermicro 216-9 production server and got disk configuring "curtin" failure saying "Please report this error in Launchpad".

Screenshot of error - https://ibb.co/0KfDk1N, screenshot of full installer output tail - https://ibb.co/RN7CKFt (it says "local variable 'extended_part_no' referenced before assignment").

This server got disks array with 3 drives groups, I'm installing Ubuntu on recently added 3rd group consisting of one SSD disk and selected "Use entire disk" during installation.

I've made a little research and seems that bug is here - https://ibb.co/NnzRBMP (https://git.launchpad.net/curtin/tree/curtin/commands/block_meta.py?h=ubuntu/bionic, lines 633-640), there are search in array and variable may be unreferenced if search is failed and this is not handled.

Related branches

Revision history for this message
Dmitriy Vinokurov (gim6626) wrote :

Here is disk configuration that I prepared for install - https://ibb.co/L5R0wyk, but according to screenshots in my previous message seems that something is wrong with sda5 while I'm installing to sdc.

Revision history for this message
Ryan Harper (raharper) wrote :

Thanks for filing the bug. The path taken looks like the storage configuration sent to curtin was incomplete;

Can you switch to tty2 and extract /var/log/installer/subiquity-curtin-install.conf somehow and attach to this bug?

Changed in curtin:
status: New → Incomplete
Revision history for this message
Ryan Harper (raharper) wrote :

Actually, I'm quite confused now as Subiquity only uses GPT partitioning, the storage config should not include any MSDOS related partitioning. Getting the curtin-install.conf should help reveal what's going on.

Revision history for this message
Dmitriy Vinokurov (gim6626) wrote :

Actually I've got around this problem by deleting sda5 which was small swap partition and successfully installed system (after tweaking system datetime cause without Internet access datetime on server was Jan 2018 and installer complained on invalid Ubuntu certificate and failed).

But I was able to reproduce problem on VirtualBox. Here is steps to do it:
1. Create virtual machine with two disks - on first (20 GB for example) create msdos partition table (I used gparted from ubuntu-19.10-desktop-amd64.iso) with 1 primary partition (I've created 18.5 GB ext4, it will be sda1) and 1 extended partition (sda2) consisting of 1 logical partition (e.g. 1.5 GB swap, sda5), second leave as is (sdb, I've created 10 GB disk).
2. Load VM from ubuntu-18.04.3-live-server-amd64.iso, pass to disk selection, select entire disk and choose second one (sdb, without partitions), apply (settings should looke like this https://ibb.co/YZBSMvR), curtin will start to work and will fail just like on our physical server (https://ibb.co/4f4rJRY, https://ibb.co/nfQ8S0z).

Attached /var/log/installer/subiquity-curtin-install.conf as Ryan Harper have asked.

Revision history for this message
Ryan Harper (raharper) wrote :

Thanks for the logs. There are a few things to fix for curtin and probert;

It appears that your disk has an existing MSDOS MBR on it and 3 partitions, sda1, sda2 and sda5.

sda5 is marked as a logical partition, but sda2 was not marked as an extended partition (in which sda5 would be contained). This is a bug between the probe data and curtin converting to a storage config.

Ryan Harper (raharper)
Changed in curtin:
importance: Undecided → Medium
status: Incomplete → Triaged
Revision history for this message
Ryan Harper (raharper) wrote :

Hi,

I've verified that curtin can detect and discover extended partitions and correctly sets the flag: extended value on such partitions. Could you also provide the contents from /var/log/installer/block/*

In particular, looking for the probe_data json files.

Changed in curtin:
status: Triaged → Incomplete
Revision history for this message
Dmitriy Vinokurov (gim6626) wrote :

Attached content of /var/log/installer/block

Revision history for this message
Ryan Harper (raharper) wrote :

Excellent; that's what I needed.

ID_PART_ENTRY_TYPE=0x5

Is the bug here; curtin matched 0xF as extended but not the other values.

"05 (DOS extended partition), 0f (W95 extended partition), 85 (Linux extended partition), or c5 (DRDOS/secured extended partition)"

Ryan Harper (raharper)
Changed in curtin:
status: Incomplete → In Progress
Ryan Harper (raharper)
Changed in subiquity (Ubuntu):
status: New → Invalid
Dan Watkins (oddbloke)
Changed in curtin:
assignee: nobody → Ryan Harper (raharper)
Revision history for this message
Vinorcola (vinorcola-f) wrote :

Hello here, I'm affected by the same bug.

I do have a hard drive configured with an extended partition (msdos partition table and DOS extended partition).
I've created a bright new GPT partition on a new installed hard drive. And this error pops when I'm trying to install Ubuntu 18.04.3 on this disk.

I don't want the installation to touch anything of the legacy disk. During the install, I only select the new drive mount "/". The other drives are left untouched. Yet, I still have the error.

Is there a workaround I can use? May that be to tell Ubuntu to not touch the first hard drive. Or maybe, use a previous Ubuntu ISO (18.04.1, 16.04 ?)

Thanks for the help!

Revision history for this message
Vinorcola (vinorcola-f) wrote :

Here is my probe-data.json file

Revision history for this message
Dmitriy Vinokurov (gim6626) wrote :

Vinorcola, sorry for late reply - you could just try to install Ubuntu with old hard drive switched off, I made so for recent installation on another server where faced same bug.

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

This bug is fixed with commit 4d468eff to curtin on branch master.
To view that commit see the following URL:
https://git.launchpad.net/curtin/commit/?id=4d468eff

Changed in curtin:
status: In Progress → Fix Committed
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.