Bug 1016725 - Empty /var/lib/alternatives/xxxx file makes `alternatives` confused
Summary: Empty /var/lib/alternatives/xxxx file makes `alternatives` confused
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: chkconfig
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukáš Nykrýn
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-08 15:08 UTC by Tomáš Bžatek
Modified: 2016-07-19 10:27 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-07-19 10:27:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Bžatek 2013-10-08 15:08:53 UTC
Description of problem:
For some reason (VM crash during yum update probably) some of the files on my filesystem got corrupted. Haven't really checked why, it's a development VM. However, my java stopped working, realizing that /usr/bin/java was a broken symlink, pointing to /etc/alternatives/java which itself was a broken link.

Reinstalling a package that uses that alternative didn't help. From user point of view I was screwed.

Looking at the package scriptlet, it calls `alternatives --install ...` to install its newly installed commands. However that call always returns "/var/lib/alternatives/xxxx empty!" error messages, not doing anything useful.

Removing that corrupted file from /var/lib/alternatives/ made the above call successful, updating links in /etc/alternatives/ etc.

Such troubles may happen anytime and we should have a kind of disaster recovery to prevent user being stuck.


Version-Release number of selected component (if applicable):
chkconfig-1.3.61-1.fc21.x86_64

How reproducible:
always

Steps to Reproduce:
1. Corrupt some files in /var/lib/alternatives/, i.e. make them empty
2. Install package that uses alternatives, e.g. java-1.7.0-openjdk
3. Watch error messages below

Actual results:
/var/lib/alternatives/java empty!
/var/lib/alternatives/jre_openjdk empty!
/var/lib/alternatives/jre_1.7.0 empty!

Expected results:
Working alternative update

Additional info:

Scriptlet excerpt:
> alternatives --install /usr/bin/java java /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.2.11.fc20.x86_64/jre/bin/java 170040
> alternatives --set $COMMAND /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.2.11.fc20.x86_64/jre/bin/java

Comment 1 Jaroslav Reznik 2015-03-03 15:07:30 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 4 CJ Kucera 2015-09-16 04:50:09 UTC
Yeah, I encountered this problem on my F22 laptop after some heat issues resulted in a mid-dnf-update hard poweroff.  Removing the empty /var/lib/alternatives/ entry fixed up the problem for me too!

Comment 5 Fedora End Of Life 2016-07-19 10:27:57 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.