debootstrap fails when bootstrapping to a directory name with spaces

Bug #1716079 reported by Simon Quigley
22
This bug affects 8 people
Affects Status Importance Assigned to Milestone
cdebootstrap (Ubuntu)
Invalid
Medium
Unassigned
debootstrap (Debian)
Fix Committed
Unknown
debootstrap (Ubuntu)
In Progress
Medium
Ken Sharp

Bug Description

I use debootstrap to do minimal installs of Ubuntu and I couldn't figure out why debootstrap would silently fail when I pass the name of my directory I wanted to install the Ubuntu system in (which, for purposes of bug reporting, I'll call "Ubuntu System").

Running this command will create bootstrap/ and var/ directories in "Ubuntu System" but will just silently stop:

 $ sudo debootstrap --arch amd64 artful Ubuntu\ System

While renaming to UbuntuSystem solves the problem:

 $ sudo debootstrap --arch amd64 artful UbuntuSystem

Since this was an Artful installation I was doing it from, I tried grabbing the version from zesty-updates and it happens there as well.

The least it could do is be a bit more verbose (I even tried with --verbose and it still didn't work)...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in debootstrap (Ubuntu):
status: New → Confirmed
Revision history for this message
Jeremy Soller (jackpot51) wrote :

sudo debootstrap --arch amd64 artful "test case"

Will only output:

I: Retrieving InRelease

Exit status is then 130

Revision history for this message
Jeremy Soller (jackpot51) wrote :

These files are then present:
test case/
test case/debootstrap
test case/debootstrap/debootstrap.log
test case/var
test case/var/lib
test case/var/lib/apt
test case/var/lib/apt/lists
test case/var/lib/apt/lists/partial
test case/var/lib/apt/lists/debootstrap.invalid_dists_artful_InRelease
test case/var/cache
test case/var/cache/apt
test case/var/cache/apt/archives
test case/var/cache/apt/archives/partial

Revision history for this message
Simon Quigley (tsimonq2) wrote :

This also affects cdebootstrap, I tried this with directory "Test 1" and I set it to use my local archive mirror at 8080:

$ sudo cdebootstrap --allow-unauthenticated --arch amd64 artful Test\ 1/ http://localhost:8080/ubuntu
P: Retrieving Release
P: Retrieving Release.gpg
P: Validating Release
W: Couldn't validate Release!
P: Parsing Release
P: Retrieving Packages.xz
P: Validating Packages.xz
sha256sum: /home/simon/Code/Test: No such file or directory
sha256sum: 1/var/cache/bootstrap/_dists_._main_binary-amd64_Packages.xz: No such file or directory
P: Retrieving Packages.gz
P: Validating Packages.gz
sha256sum: /home/simon/Code/Test: No such file or directory
sha256sum: 1/var/cache/bootstrap/_dists_._main_binary-amd64_Packages.gz: No such file or directory
E: Couldn't download Packages!

So it looks like it's not built to catch directories with spaces, I wonder if this is related to debootstrap's problem.

Changed in cdebootstrap (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Simon Quigley (tsimonq2) wrote :

This also might be of interest:

$ sudo debootstrap --arch amd64 artful Test\ 1 http://localhost:8080/ubuntu
I: Retrieving InRelease
I: Checking Release signature
I: Valid Release signature (key id 790BC7277767219C42C86F933B4FE6ACC0B21F32)
$ ls
1 Test Test 1
$ ls *
1:

Test:

Test 1:
debootstrap var

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cdebootstrap (Ubuntu):
status: New → Confirmed
Ken Sharp (kennybobs)
tags: added: artful zesty
Ken Sharp (kennybobs)
tags: added: jammy
Ken Sharp (kennybobs)
tags: added: noble
Revision history for this message
Ken Sharp (kennybobs) wrote :

Well, it's taken me hours of recursing through functions but I got there in the end.

Attached patch works in Focal, Jammy and Noble. There's an additional failure in Bionic but that'll have to stay unless someone really needs it.

I'll submit the patch where it needs to go (including upstream).

Changed in debootstrap (Ubuntu):
assignee: nobody → Ken Sharp (kennybobs)
tags: added: bionic focal patch
removed: artful zesty
Ken Sharp (kennybobs)
tags: added: patch-forwarded-debian
Changed in debootstrap (Debian):
status: Unknown → New
Ken Sharp (kennybobs)
summary: - debootstrap silently fails when bootstrapping to a directory name with
- spaces
+ debootstrap fails when bootstrapping to a directory name with spaces
Revision history for this message
Ken Sharp (kennybobs) wrote (last edit ):

The cause of the fault with debootstrap is unrelated to cdebootstrap. cdebootstrap is written in C. A seperate bug report should be opened for that.

Changed in cdebootstrap (Ubuntu):
status: Confirmed → Invalid
Ken Sharp (kennybobs)
tags: added: patch-accepted-debian
removed: patch-forwarded-debian
Changed in debootstrap (Debian):
status: New → Fix Committed
Ken Sharp (kennybobs)
Changed in debootstrap (Ubuntu):
status: Confirmed → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.