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

FixNum related error for pooling.rb #16

Open
charliebabbitt1988 opened this issue Jun 28, 2024 · 2 comments
Open

FixNum related error for pooling.rb #16

charliebabbitt1988 opened this issue Jun 28, 2024 · 2 comments

Comments

@charliebabbitt1988
Copy link

charliebabbitt1988 commented Jun 28, 2024

Blue Hydra won't launch with Ruby 3.2.3. Here is what I see in the blue_hydra.log file:

E, [2024-06-28T18:26:49.524571 #16435] ERROR -- : NameError: uninitialized constant DataObjects::Pooling::Pool::Fixnum
E, [2024-06-28T18:26:49.524669 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/data_objects-0.10.17/lib/data_objects/pooling.rb:149:in initialize' E, [2024-06-28T18:26:49.524681 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/data_objects-0.10.17/lib/data_objects/pooling.rb:121:in new'
E, [2024-06-28T18:26:49.524689 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/data_objects-0.10.17/lib/data_objects/pooling.rb:121:in block in new' E, [2024-06-28T18:26:49.524696 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/data_objects-0.10.17/lib/data_objects/pooling.rb:121:in synchronize'
E, [2024-06-28T18:26:49.524703 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/data_objects-0.10.17/lib/data_objects/pooling.rb:121:in new' E, [2024-06-28T18:26:49.524710 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/data_objects-0.10.17/lib/data_objects/connection.rb:68:in new'
E, [2024-06-28T18:26:49.524717 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-do-adapter-1.2.0/lib/dm-do-adapter/adapter.rb:251:in open_connection' E, [2024-06-28T18:26:49.524723 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-do-adapter-1.2.0/lib/dm-do-adapter/adapter.rb:276:in with_connection'
E, [2024-06-28T18:26:49.524731 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-do-adapter-1.2.0/lib/dm-do-adapter/adapter.rb:33:in select' E, [2024-06-28T18:26:49.524738 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-sqlite-adapter.rb:43:in table_info'
E, [2024-06-28T18:26:49.524744 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-sqlite-adapter.rb:18:in storage_exists?' E, [2024-06-28T18:26:49.524751 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:90:in create_model_storage'
E, [2024-06-28T18:26:49.524798 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:57:in upgrade_model_storage' E, [2024-06-28T18:26:49.524805 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:73:in upgrade_model_storage'
E, [2024-06-28T18:26:49.524812 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:145:in auto_upgrade!' E, [2024-06-28T18:26:49.524819 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:47:in block in repository_execute'
E, [2024-06-28T18:26:49.524825 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-core-1.2.1/lib/dm-core/support/descendant_set.rb:64:in block in each' E, [2024-06-28T18:26:49.524831 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-core-1.2.1/lib/dm-core/support/subject_set.rb:211:in block in each'
E, [2024-06-28T18:26:49.524838 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-core-1.2.1/lib/dm-core/support/ordered_set.rb:320:in block in each' E, [2024-06-28T18:26:49.524844 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-core-1.2.1/lib/dm-core/support/ordered_set.rb:320:in each'
E, [2024-06-28T18:26:49.524850 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-core-1.2.1/lib/dm-core/support/ordered_set.rb:320:in each' E, [2024-06-28T18:26:49.524858 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-core-1.2.1/lib/dm-core/support/subject_set.rb:211:in each'
E, [2024-06-28T18:26:49.524865 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-core-1.2.1/lib/dm-core/support/descendant_set.rb:63:in each' E, [2024-06-28T18:26:49.524871 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:46:in repository_execute'
E, [2024-06-28T18:26:49.524877 #16435] ERROR -- : /var/lib/gems/3.2.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:27:in auto_upgrade!' E, [2024-06-28T18:26:49.524884 #16435] ERROR -- : /root/blue_hydra/lib/blue_hydra.rb:400:in <top (required)>'
E, [2024-06-28T18:26:49.524898 #16435] ERROR -- : internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:86:in require' E, [2024-06-28T18:26:49.524905 #16435] ERROR -- : <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:86:in require'
E, [2024-06-28T18:26:49.524912 #16435] ERROR -- : ./bin/blue_hydra:61:in `

'

I'm not sure if you can re-produce this, but this is occurring on a brand new Ubuntu 24.04 LTS desktop install.

"ruby -v" shows this: ruby 3.2.3 (2024-01-18 revision 52bb2ac0a6) [x86_64-linux-gnu]

I'm not sure how to address this one as it seems to be a Ruby issue. From what I have been able to gather, the use of "FixNum" has been deprecated since Ruby 2.4 and "Integer" has replaced "FixNum" and "BigNum".

I could "patch" the pooling.rb file to use "Integer" instead of "FixNum", but that doesn't seem like a good long term solution.

Edited: I was able to work around this by editing the /var/lib/gems/3.2.0/gems/data_objects-0.10.17/lib/data_objects/pooling.rb file and changing line 149 to use "Integer" instead of "FixNum". Blue Hydra now launches and runs successfully.

This is the line now (starting at line 148):

      def initialize(max_size, resource, args)
         raise ArgumentError.new("+max_size+ should be a Integer but was #{max_size.inspect}") unless Integer === max_size
         raise ArgumentError.new("+resource+ should be a Class but was #{resource.inspect}") unless Class === resource

So this seems to be a Ruby gem issue with Ruby 3.2. Maybe a bug report should be filed to the Ruby developers?

@poison-ivy-3v3
Copy link

Quick fix to get it working on Ubuntu 24.04 LTS (Noble Numbat) is to install the backwards-compatibility gem and then manually add the require line to your blue_hydra/bin/blue_hydra file. Note - this MAY break blue_hydra for other distros, but worked for me today fixing it on Noble Numbat.

sudo gem install ruby3-backward-compatibility

Then add the following to the blue_hydra/bin/blue_hydra file:

require 'ruby3_backward_compatibility/compatibility/fixnum'

@ZeroChaos-
Copy link
Owner

1.9.20 detects the issue and tells you to patch the right file. I am considering if I can automate it using ruby3_backward_compatibility, but I'm not sure it's available for the distros that already have blue_hydra in their package manager so that would break it on those distros.

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

No branches or pull requests

3 participants