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

Fixes #37291 - Use explicit java on RH with Puppetserver 8 #910

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Mar 22, 2024

The /usr/bin/java file may point to any version. This changes the logic to determine the java version (unless explicitly specified) dynamically based on the puppetserver version and the OS.

@ekohl ekohl force-pushed the 37291-use-explicit-java-on-redhat branch 3 times, most recently from bae34d3 to 7bf85f4 Compare March 22, 2024 13:09
@ekohl ekohl marked this pull request as ready for review March 22, 2024 13:09
@ekohl ekohl force-pushed the 37291-use-explicit-java-on-redhat branch from 7bf85f4 to 70f35a9 Compare March 22, 2024 14:33
manifests/server/puppetserver.pp Outdated Show resolved Hide resolved
The /usr/bin/java file may point to any version. This changes the logic
to determine the java version (unless explicitly specified) dynamically
based on the puppetserver version and the OS.
@@ -714,7 +714,7 @@
Optional[Stdlib::Absolutepath] $server_puppet_basedir = $puppet::params::server_puppet_basedir,
Enum['current', 'future'] $server_parser = $puppet::params::server_parser,
Variant[Undef, Enum['unlimited'], Pattern[/^\d+[smhdy]?$/]] $server_environment_timeout = $puppet::params::server_environment_timeout,
String $server_jvm_java_bin = $puppet::params::server_jvm_java_bin,
Optional[Stdlib::Absolutepath] $server_jvm_java_bin = undef,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need an installer migration as well to wipe the value. I wonder if this a breaking change, but I think a relative path was never valid.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekohl ekohl merged commit b608826 into theforeman:master Mar 22, 2024
26 checks passed
@ekohl ekohl deleted the 37291-use-explicit-java-on-redhat branch March 22, 2024 17:04
@ekohl
Copy link
Member Author

ekohl commented Jul 19, 2024

Coming back to this: it didn't resolve our upgrade issues.

What happens is:

  • dnf upgrade runs the scriptlet that calls /usr/bin/systemctl try-restart puppetserver.service
  • puppetserver enters a restart loop
  • Puppet runs and can't reliably restart the service (bug in systemd? Puppet service provider?)

I've opened puppetlabs/ezbake#627 to avoid this. On EL8 it may not be reliable since there's no explicit java binary there, since it relies on a virtual package. For EL9 it should be though.

@ekohl
Copy link
Member Author

ekohl commented Jul 19, 2024

Contemplating the solutions: I think the best is for the foreman-installer to add a hook that detects the broken situation (/usr/bin/java being too old) and then stops puppetserver. That should prevent the restart loop.

@evgeni
Copy link
Member

evgeni commented Jul 19, 2024

That doesn't sound crazy.

Do we tell people to do f-m services stop before the upgrade?

@ekohl
Copy link
Member Author

ekohl commented Jul 19, 2024

Not sure, but there's no harm in an explicit stop if it prevents issues. At least our upgrade pipelines hit the problem so we're not doing it.

@evgeni
Copy link
Member

evgeni commented Jul 19, 2024

Yeah, not arguing against your solution. More wondering how many people would actually run into that.

@ekohl
Copy link
Member Author

ekohl commented Jul 26, 2024

theforeman/foreman-installer#953 is now ready. This allows users to also upgrade to Puppet 8 as a separate procedure:

  • Update puppet-release
  • Upgrade puppetserver
  • Run installer

Now I just need to see if this is also a problem for Debian.

@ekohl
Copy link
Member Author

ekohl commented Jul 29, 2024

Now I just need to see if this is also a problem for Debian.

When I do a fresh installation of Puppet 7 on Debian 11 it install Java 11, so that shouldn't be a problem. I'm sure we'll find some cases, but not something to generally solve for everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants