dapper -> hardy upgrade breaks system

Bug #242703 reported by Kevin O'Gorman
6
Affects Status Importance Assigned to Milestone
langpack-locales (Ubuntu)
Invalid
Undecided
Unassigned
update-manager (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Upgrading dapper to hardy yesterday has broken my system, specifically, Xorg will no longer start (I'm submitting this using links(1)). Xorg reports three attempts to set the display resolution, all of them failures.

In addition (and perhaps related), locale(1) and a bunch of lsb-* packages (and some miscellaneous others) report that they cannot be configured. Just about all attempts to rebuild or reinstall anything runs into trouble with locales.

What to do?

Tags: dapper2hardy
Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :
Revision history for this message
Nick Ellery (nick.ellery) wrote :

Thanks for taking the time to report this bug and helping to make Ubuntu better. Could you please add the log files from '/var/log/dist-upgrade/' to this bug report as attachments? Thanks in advance.

Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

I assume you have already tried 'sudo dpkg --configure -a' and 'sudo dpkg-reconfigure xserver-xorg'?

Michael Vogt (mvo)
Changed in update-manager:
status: New → Incomplete
Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :
Download full text (7.1 KiB)

I did not even know about those things. I will try them.

In the meantime, I have solved the X part of this. Bumbling around comparing with the Gentoo system that shares this monitor via KVM switch, I narrowed the hsync and vsync ranges until something worked. I now have X, so it was unrelated to the other breakages.

Here's the output of "dpkg --configure -a" it fails without any interaction from me. I'll be exploring localedef as it seems to want....

root@uhuru:~ # dpkg --configure -a
Setting up locales (2.7.9-4) ...
Generating locales...
  ",.1) = 1... Try `localedef --help' or `localedef --usage' for more information.
failed
  ",.11) = 11... Try `localedef --help' or `localedef --usage' for more information.
failed
  ",.13) = 13... Try `localedef --help' or `localedef --usage' for more information.
failed
  ",.16) = 16... Try `localedef --help' or `localedef --usage' for more information.
failed
  ",.17) = 17... Try `localedef --help' or `localedef --usage' for more information.
failed
  ",.19) = 19... Try `localedef --help' or `localedef --usage' for more information.
failed
  ",.20) = 20... Try `localedef --help' or `localedef --usage' for more information.
failed
  ",.21) = 21... Try `localedef --help' or `localedef --usage' for more information.
failed
  ",.21) = 21... Try `localedef --help' or `localedef --usage' for more information.
failed
  ",.23) = 23... Try `localedef --help' or `localedef --usage' for more information.
failed
  ",.26) = 26... Try `localedef --help' or `localedef --usage' for more information.
failed
  access("/etc/ld.F_OK) = 0... Try `localedef --help' or `localedef --usage' for more information.
failed
  access("/etc/ld.R_OK) = -1 ENOENT (No such file or directory)... localedef: invalid option -- 1
Try `localedef --help' or `localedef --usage' for more information.
failed
  brk(0).= 0x804f000... Try `localedef --help' or `localedef --usage' for more information.
failed
  brk(0x8070000).= 0x8070000... Try `localedef --help' or `localedef --usage' for more information.
failed
  close(3).= 0... Try `localedef --help' or `localedef --usage' for more information.
failed
  en_US.ISO-8859-1... up-to-date
  en_US.UTF-8... up-to-date
sed: -e expression #1, char 39: unknown option to `s'
dpkg: error processing locales (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of sun-java5-jre:
 sun-java5-jre depends on locales; however:
  Package locales is not configured yet.
dpkg: error processing sun-java5-jre (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-minimal:
 ubuntu-minimal depends on locales; however:
  Package locales is not configured yet.
dpkg: error processing ubuntu-minimal (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of sun-java5-jdk:
 sun-java5-jdk depends on sun-java5-jre (= 1.5.0-15-0ubuntu1); however:
  Package sun-java5-jre is not configured yet.
dpkg: error processing sun-java5-jdk (--configure):
 dependency problems - leaving unconf...

Read more...

Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :

Okay, after reading localedef --help and localedef --usage, I'm still pretty much flying blind.

I could, of course, just make a stab at it: for instance "localedef en_US" seems plausible.
But no more than plausible, and I'm worried about making matters worse.

++ kevin

Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :
Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :
Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :
Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :
Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :
Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :

I wrote too quickly about Xorg being repaired. It is not quite. When I reboot, it fails, and I have to log in a root console and start X with gdm(1). Then it comes up okay, modulo an unexpected dialog or two. I can't quite imagine what's different between the normal bootup and gdm run by root.

Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

Kevin, please try running the 'sudo dpkg-reconfigure xserver-xorg' I mentioned earlier, it might fix your X.

As for your other problems, it seems the root of them is the 'locales' package not being configured...

Maybe you could try running 'sudo aptitude reinstall locales'?

Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :

'sudo dpkg-reconfigure xserver-xorg' ran fine, but accomplished only reducing my resolution to 800x600. The xorg.conf file was nice and clean however, and I just put the modelines in that one. I still have to start Xorg manually with 'gdm'.

Looking at the reboot more carefully, however, I have a more accurate idea of the problem. Xorg is not failing at all. I was looking at output from grub as it ran the splash screen stuff, and thinking it was error messages. There's no evidence that Xorg even tries to run
on startup. However, the default runlevel is 2, which differs only slightly from 5 (2 has K01fetchmail instead of S99). Both have S10xserver-xorg-init-wacom as the only obvious reference to xorg.

Shouldn't 'gdm' appear somehow in the runlevels?

As for locales, I agree that most if not all of the other symptoms are caused by locales being borked. I'm attaching the typescript from
running 'aptitude reinstall locales'. Synopsis: no joy.

Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

I think the error message to look at is:
dpkg: error processing locales (--configure):
 subprocess post-installation script returned error exit status 1

The post-installation script is:
/var/lib/dpkg/info/locales.postinst

Try renaming it to something else, so that dpkg doesn't find it, and try the 'sudo dpkg --configure -a' again?

Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :

I found it. It's a tiny script that just calls "locale-gen". I commented that out and did the
     aptitude reinstall locales
which now looked clean. Of course it left behind a bunch of unconfigured packages.

Moreover, when I manually ran locale-gen, it failed again in the same way. I even did a
     aptitude reinstall belocs-locales-bin
to reinstall locales-gen, but this had the same sort of failure that "locales" did orignally.

So did another package chosen for its short name: "lsb".

It appears I'll have to solve the mystery of "locale-gen". This reports a number of errors, then
has a failure of sed(1). A typescript is attached.

Just in case: here's a quick checksum:
root@uhuru:~ # sum /usr/sbin/locale-gen
30903 7
root@uhuru:~ #

Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :

The immediate problem turned out to be a stray file in /var/lib/locales/supported.d, namely a "typescript" file that got there from one of my attempts to debug something else. It also turns
out that locale-gen looks at all files in that directory, and its filters don't catch that a typescript is the wrong thing.

Removing the file, and running "aptitude reinstall lsb" the system still appears to be miscofigured at least a little. /etc/default/locale contains "en_US", which is reported as "not found". This has to be my fault too. I thought the first line of my /var/lib/locales/supported.d/local covered that:
    en_US ISO-8859-1
What should it be?

I'm also getting invoke-rc.d: initscript gdm, action "reload" failed. This may relate to my difficulty getting X up on reboot, but when I run it manually, the error reported goes back to /etc/default/locale. I would really like a locale "en_US" to make it similar to the systems at work.

That said, the reinstall seems to have worked, and it automatically went about reconfiguring the
other packages that previously failed. So progress is happening.

Bottom line: with a bit of help configuring locales, I may be able to fix the rest of this myself.

Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :

Some more poking around revealed that I needed /etc/default/locale to contain
LANG=en_US, not just the locale name, because it's sourced as a shell script.

With this change, X now starts on bootup (bad syntax in /etc/default/locale was
crashing /etc/init.d/gdm, among other things).

Feel free to mark this bug as resolved or closed or whatever. I feel quite competent to tweak the few
minor things I still want to change.

I wonder, though, if a a sanity check at the beginning of the upgrade wouldn't be
a good idea. It might be nice to know that the problems encountered were not
caused by the update.

Thanks to all

++ kevin

Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

Kevin, i'm glad you managed to resolve things. I will close this bug report.
In the end, it's still unclear to me: what were the starting conditions that caused this problem? Was something wrong with your configuration, or is there actually a bug in the upgrade process?

Changed in langpack-locales:
status: New → Invalid
Changed in update-manager:
status: Incomplete → Invalid
Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :

Starting conditions:
1) Bad syntax in /etc/default/locale was "en_US" needed to be "LANG=en_US"
2) Bad file in /var/lib/locales/supported.d, which is scanned for shell scripts and filtered only lightly. My bad file was treated as a script and failed miserably. It was actually an artifact of previous debugging attempts, the output of script(1).

Maybe only (1) was original. By itself, it stopped X from coming up on reboot, because /etc/init.d/gdm was stopped by the failure of "en_US" to be a shell command, and stopped a number of other packages from configuring properly.

So: no bug in upgrade, but if anyone else is as error-prone as I seem to be, maybe some (more) sanity checks would be a good idea.

Thanks again.

++ kevin

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.