Misleading "cryptsetup: WARNING: invalid line in /etc/crypttab - "

Bug #332950 reported by Daniel Hahler
44
This bug affects 7 people
Affects Status Importance Assigned to Milestone
cryptsetup (Debian)
Fix Released
Unknown
cryptsetup (Ubuntu)
Fix Released
Low
Surbhi Palande
Lucid
Won't Fix
Low
Unassigned
Maverick
Won't Fix
Low
Surbhi Palande

Bug Description

Binary package hint: cryptsetup

When there's no line for the cryptsetup root device, a misleading warning is issued during update-initramfs:
  cryptsetup: WARNING: invalid line in /etc/crypttab -

I'm attaching a patch that handles this better, by outputting
  cryptsetup: WARNING: Missing line in /etc/crypttab for $target
in this case.

I've ran into this when manually doing the "mdadm-cryptsetup-lvm2-initramfs" dance, and used another name during "cryptsetup luksOpen".

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia
Package: cryptsetup 2:1.0.6-7ubuntu5 [modified: usr/share/initramfs-tools/hooks/cryptroot]
ProcEnviron:
 LANGUAGE=
 PATH=(custom, user)
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: cryptsetup
Uname: Linux 2.6.28-8-generic i686

Revision history for this message
Daniel Hahler (blueyed) wrote :
Changed in cryptsetup:
importance: Undecided → Low
Revision history for this message
Daniel Hahler (blueyed) wrote :
Revision history for this message
Johnathon (kirrus) wrote :

Thanks for the bug report and patch. Would you be able to create a step-by-step testcase, so that we can test your problem here?

Changed in cryptsetup:
status: New → Incomplete
Revision history for this message
Daniel Hahler (blueyed) wrote :

TESTCASE:
 0a. /dev/md1 being my root device
 0b. /etc/crypttab refers to the rootdevice as "sroot", not "md1"
 1. cryptsetup luksOpen /dev/md1 md1
 2. update-initramfs -c -k $(uname -a)

Changed in cryptsetup:
status: Incomplete → Triaged
Revision history for this message
Daniel Hahler (blueyed) wrote :

It should be "uname -r" in step 2 above, of course.

Revision history for this message
Jonathan Kolberg (bulldog98) wrote :

For me the same thing happens in lucid (I only get the linenumber where the error occurs) For me this line is an empty line, could that be the reason of the bug?

Revision history for this message
AmenophisIII (amenophisiii) wrote :

please include the patch. cryptroot is already hard enough to debug, because its quite fragile (read: crappy :)
would have saved me some time today.

Revision history for this message
Daniel Hahler (blueyed) wrote :

I would be happy to refresh this patch, if this would increase its acceptance.

Changed in cryptsetup (Ubuntu):
importance: Low → Medium
Revision history for this message
Robbie Williamson (robbiew) wrote :

Has anyone confirmed this bug exists in Maverick?

Changed in cryptsetup (Ubuntu Lucid):
milestone: none → ubuntu-10.04.2
importance: Undecided → Low
Changed in cryptsetup (Ubuntu Maverick):
importance: Medium → Low
status: Triaged → Incomplete
Revision history for this message
Carsten Andrich (carsten-andrich) wrote :

I just stumbled upon this one, trying to install the maverick amd64 desktop beta, so I can confirm that it does exist in Maverick.

Daniel Hahler (blueyed)
Changed in cryptsetup (Ubuntu Maverick):
status: Incomplete → Triaged
Revision history for this message
Robbie Williamson (robbiew) wrote :

Surbhi, can you take a look at this one? Seems like something we could easily slide into Maverick.

Changed in cryptsetup (Ubuntu Maverick):
assignee: nobody → Surbhi Palande (csurbhi)
milestone: none → ubuntu-10.10
Changed in cryptsetup (Ubuntu Maverick):
milestone: ubuntu-10.10 → maverick-updates
Surbhi Palande (csurbhi)
Changed in cryptsetup (Ubuntu Maverick):
status: Triaged → In Progress
Michael Vogt (mvo)
Changed in cryptsetup (Ubuntu Maverick):
status: In Progress → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted cryptsetup into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Martin Pitt (pitti) wrote :

Any testers of the macerick-proposed package? As this has been in -proposed for a long time already, I'll remove the proposed package soon if there is no feedback. Thank you!

Also, this needs to be fixed in Natty _first_ before it can go to -updates.

Changed in cryptsetup (Ubuntu Maverick):
milestone: maverick-updates → none
Changed in cryptsetup (Ubuntu):
milestone: maverick-updates → none
Changed in cryptsetup (Ubuntu Lucid):
milestone: ubuntu-10.04.2 → none
Revision history for this message
Rolf Leggewie (r0lf) wrote :

@Carsten, can you please verify the package from -proposed fixes the issue?

Daniel Hahler (blueyed)
description: updated
Revision history for this message
Daniel Hahler (blueyed) wrote :

I've submitted the patch upstream to Debian, so that it will hopefully come into Ubuntu this way:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=648192

Changed in cryptsetup (Debian):
status: Unknown → New
Changed in cryptsetup (Debian):
status: New → Fix Committed
Changed in cryptsetup (Debian):
status: Fix Committed → Fix Released
Revision history for this message
Jean-Louis Dupond (dupondje) wrote :

The fix (that was already added in the debian package) is merged into Ubuntu since Precise.

Changed in cryptsetup (Ubuntu):
status: Triaged → Fix Released
Rolf Leggewie (r0lf)
Changed in cryptsetup (Ubuntu Lucid):
status: New → Triaged
Changed in cryptsetup (Ubuntu Maverick):
status: Fix Committed → Won't Fix
Revision history for this message
David Schoen (neerolyte) wrote :

This seems to still break in Quantal (12.10) when upgrading from 12.04.

I was getting the "cryptsetup: WARNING: invalid line in /etc/crypttab - " errors when running update-initramfs (under a live CD because the machine was completely unbootable).

After following advice from http://forums.linuxmint.com/viewtopic.php?f=189&t=83763 I started digging around and in /usr/share/initramfs-tools/hooks/cryptroot and found it couldn't parse /etc/crypttab if the target field wasn't exactly the device name that was root was sitting under, e.g. changing it from "sda2_crypt" (what I believe 12.04 alternative installer set it to) to "sda2" meant update-initramfs and update-grub both ran without issue and the machine now boots without issue - seems like some dodgy parsing going on in that hook?

Revision history for this message
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in cryptsetup (Ubuntu Lucid):
status: Triaged → Won't Fix
Revision history for this message
Roel Van de Paar (roel11) wrote :

This seems still flaky even in 17.04.

# cat /etc/crypttab
nvme0n1p3_crypt UUID="20eada6e-6b8c-4e19-b612-524ea2a131ff" none luks,discard
# update-initramfs -k 4.10.0-24-generic -c -b /boot
update-initramfs: Generating /boot/initrd.img-4.10.0-24-generic
cryptsetup: WARNING: Invalid source device UUID="20eada6e-6b8c-4e19-b612-524ea2a131ff"
cryptsetup: WARNING: Invalid source device UUID="20eada6e-6b8c-4e19-b612-524ea2a131ff"
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.

# vi /etc/crypttab
# cat /etc/crypttab
nvme0n1p3_crypt UUID=20eada6e-6b8c-4e19-b612-524ea2a131ff none luks,discard
# update-initramfs -k 4.10.0-24-generic -c -b /boot
update-initramfs: Generating /boot/initrd.img-4.10.0-24-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.

In other words, when the UUID is quoted (") it fails. However, the quoted UUID is exactly what at least one of the other tools in Ubuntu must use because there was a second line in that file originally (I removed it to make the example/testcase above clearer) for another drive and that one uses quotes.

Please review and QA this area properly. Thank you.

no longer affects: cryptsetup
Revision history for this message
Roel Van de Paar (roel11) wrote :

How do I add zesty?

Revision history for this message
Roel Van de Paar (roel11) wrote :

"at least one of the other tools in Ubuntu" - that is unless I added it, which is a possibility too. Still, that secondary drive works fine (assuming that /etc/crypttab is used to unlock it, which I cannot confirm due to lack of knowledge in that area)

Revision history for this message
Michael McCallum (stickycode) wrote :

I'm seeing this on 17.04 as well

Ø sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.img-4.10.0-33-generic
cryptsetup: WARNING: invalid line in /etc/crypttab for myvolume -
cryptsetup: WARNING: invalid line in /etc/crypttab for myvolume -

manually mounted the volume on boot with the wrong name

Revision history for this message
Tomas (xhudik) wrote :

ubuntu 18.04, the same:
update-initramfs -c -k all
update-initramfs: Generating /boot/initrd.img-4.15.0-38-generic
cryptsetup: WARNING: invalid line in /etc/crypttab for luks-9013e4bc-3ea3-4379-957c-88e2bbb701c1 -
update-initramfs: Generating /boot/initrd.img-4.15.0-29-generic
cryptsetup: WARNING: invalid line in /etc/crypttab for luks-9013e4bc-3ea3-4379-957c-88e2bbb701c1 -

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.