Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with failed alternatives #114

Closed
Frick opened this issue Jan 9, 2014 · 5 comments
Closed

Problem with failed alternatives #114

Frick opened this issue Jan 9, 2014 · 5 comments

Comments

@Frick
Copy link

Frick commented Jan 9, 2014

I ran into the issue of "failed" Java alternatives preventing a successful Chef run (failed on line 41 of providers/alternatives.rb) and resolved it per this StackOverflow comment. I wound up adding the following on line 35 of providers/alternatives.rb, but this only pertains to RHEL due to the path. I know the path for Ubuntu is /var/lib/dpkg/alternatives, but not sure for any other platforms. I have my monkeypatch in place, but thought I'd alert you to the issue in case you'd like to solve it properly going forward. I'd submit a pull request, but without knowing the path for any platforms beyond RHEL and Ubuntu leaves a lot to be desired.

      # delete failed alternative if needed
      if !::File.exist?(bin_path) && ::File.exist?("/var/lib/alternatives/#{cmd}")
        Chef::Log.debug "Failed alternative for #{cmd} exists - deleting"
        ::File.unlink("/var/lib/alternatives/#{cmd}")
      end
@carmstrong
Copy link
Contributor

@Frick, how did the machine get in that state? I've heard a few people report this, but haven't come across it myself.

Even though you don't know the fix beyond RHEL and Ubuntu, I would open a pull request with your change anyhow - perhaps we can start a discussion there.

@Frick
Copy link
Author

Frick commented Jan 10, 2014

I'm swamped at work, so I'll try to get to providing a pull request over the weekend. I'm not exactly sure what put it in this state, but there was an error (mistyped attribute name on my part) when upgrading the Java cookbook (v 1.16.0 to 1.17.4) that may have caused an attempt to install OpenJDK in place of Oracle's JDK. I'm not even sure how far it got as I killed the chef run as soon as I saw any mention of OpenJDK.

@carmstrong
Copy link
Contributor

I just merged #144 and released cookbook version 1.21.0. Could you update to the latest and see if this is still happening?

@carmstrong
Copy link
Contributor

Closing - please reopen if this is still an issue.

@lock
Copy link

lock bot commented May 3, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants