Bug 284112 - sysutils/puppetserver7 broken by upgrade to devel/ruby-gems 3.6.2
Summary: sysutils/puppetserver7 broken by upgrade to devel/ruby-gems 3.6.2
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-17 11:02 UTC by Ray Bellis
Modified: 2025-01-27 12:05 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ray Bellis 2025-01-17 11:02:33 UTC
With latest 2025q1 packages for puppetserver7, the puppet daemon crashes after a few seconds, with this (snipped) stack trace appearing in the log as apparent root cause:

--8<--8<--
Caused by: org.jruby.embed.EvalFailedException: (NoMethodError) undefined method `bind_call' for #<UnboundMethod: Kernel#warn>
        at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:134)
...
Caused by: org.jruby.exceptions.NoMethodError: (NoMethodError) undefined method `bind_call' for #<UnboundMethod: Kernel#warn>
        at RUBY.warn(/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_warn.rb:16)
...
--8<--8<--

I have traced this to a 4 month old commit to ruby-gems, which among other things replaces a few calls to `.bind(self).call(args...)` with `.bind_call(self, args...)`:

https://github.com/rubygems/rubygems/commit/fc1f03b06a72b9e74a5e7410cf9a2d11b28090e7

IIUC this crash might arise because the version of JRuby embedded inside the FreeBSD puppetserver7 package perhaps does not support `.bind_call()` ?

I have been able to get my puppetserver running in the meantime by patching ruby-gems itself to revert the use of `.bind_call` in lines 16 and 43 of site_ruby/3.2/rubygems/core_ext/kernel_warn.rb

I'm happy to file additional reports elsewhere as needed, but in the first instance I think this needs triage from someone with much more experience with (J)Ruby than I have.
Comment 1 Ray Bellis 2025-01-17 13:06:33 UTC
The specific packages installed are:

ruby-3.2.6,1
ruby32-gems-3.6.2
puppetserver7-7.17.3

The OS is FreeBSD 14.2-RELEASE
Comment 2 Ray Bellis 2025-01-17 22:33:47 UTC
To further confuse things, the README.md in the puppetserver source on GitHub says:

--8<--

Puppet Server uses its own JRuby interpreter, which doesn't load gems or other
code from your system Ruby. If you want Puppet Server to load additional gems,
use the Puppet Server-specific `gem` command to install them.

--8<--

and yet I'm seeing issues definitely caused by the system's Ruby gems?
Comment 3 Ray Bellis 2025-01-27 12:05:24 UTC
Any advice, please?

The current puppetserver7 package is unusable, likely due to an ancient embedded JRuby install.   I don't know (and can't tell) whether that's a FreeBSD packaging issue or down to the upstream puppet server sources.