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

remove postgres adapter #404

Closed
wants to merge 1 commit into from

Conversation

LongLonghaoran
Copy link

Remove the line which substitute the postgresql to postgres that will lead to error

@adamruzicka
Copy link
Contributor

This should be safe to do, sequel added an alias[1] in 4.23. Starting with that version, both postgres and postgresql should be usable interchangeably. Still wonder how you run into the error, I don't seem able to reproduce it

[1] - jeremyevans/sequel@1932854

@adamruzicka adamruzicka linked an issue Jan 26, 2022 that may be closed by this pull request
@adamruzicka
Copy link
Contributor

Could you bump the lower bound on sequel to '>= 4.23.0'?

@LongLonghaoran
Copy link
Author

Seems not working,another error has appeared

➜  foreman-2.5.2 git:(develop-lhr) ✗ sidekiq -r ./extras/dynflow-sidekiq.rb
Your Gemfile lists the gem puma (~> 5.1) more than once.
You should probably keep only one of them.
Remove any duplicate entries and specify the gem only once.


...

2022-01-27T09:05:05 [D|sql|]   ForemanInternal Load (0.4ms)  SELECT "foreman_internals".* FROM "foreman_internals" WHERE "foreman_internals"."key" = $1 LIMIT $2  [["key", "database_seed"], ["LIMIT", 1]]
2022-01-27T09:05:05 [D|sql|]   ↳ app/services/foreman_seeder.rb:71:in `old_hash'
2022-01-27T09:05:05 [I|app|] No new seed file updates found. Skipping
undefined method `new' for class `#<Class:BigDecimal>'
Did you mean?  next
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/adapters/utils/pg_types.rb:60:in `method'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/adapters/utils/pg_types.rb:60:in `<module:Postgres>'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/adapters/utils/pg_types.rb:2:in `<module:Sequel>'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/adapters/utils/pg_types.rb:1:in `<main>'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:324:in `block in require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:324:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/core.rb:204:in `block in require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/core.rb:204:in `each'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/core.rb:204:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/adapters/shared/postgres.rb:1:in `<main>'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:324:in `block in require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:324:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/core.rb:204:in `block in require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/core.rb:204:in `each'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/core.rb:204:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/adapters/postgres.rb:1:in `<main>'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:324:in `block in require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/activesupport-6.0.3.7/lib/active_support/dependencies.rb:324:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/database/connecting.rb:97:in `load_adapter'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/database/connecting.rb:26:in `adapter_class'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/database/connecting.rb:55:in `connect'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sequel-4.20.0/lib/sequel/core.rb:95:in `connect'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/persistence_adapters/sequel.rb:294:in `initialize_db'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/persistence_adapters/sequel.rb:58:in `initialize'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails/configuration.rb:200:in `new'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails/configuration.rb:200:in `initialize_persistence'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails/configuration.rb:142:in `block (2 levels) in world_config'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/config.rb:43:in `method_missing'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/world.rb:29:in `initialize'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails/configuration.rb:79:in `new'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails/configuration.rb:79:in `initialize_world'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails.rb:105:in `init_world'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/dynflow-1.6.1/lib/dynflow/rails.rb:38:in `initialize!'
/Users/eddy/workspace/foreman-2.5.2/extras/dynflow-sidekiq.rb:29:in `<top (required)>'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sidekiq-5.2.9/lib/sidekiq/cli.rb:292:in `require'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sidekiq-5.2.9/lib/sidekiq/cli.rb:292:in `boot_system'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sidekiq-5.2.9/lib/sidekiq/cli.rb:46:in `run'
/Users/eddy/.rvm/gems/ruby-2.7.3/gems/sidekiq-5.2.9/bin/sidekiq:12:in `<top (required)>'
/Users/eddy/.rvm/gems/ruby-2.7.3/bin/sidekiq:23:in `load'
/Users/eddy/.rvm/gems/ruby-2.7.3/bin/sidekiq:23:in `<main>'
/Users/eddy/.rvm/gems/ruby-2.7.3/bin/ruby_executable_hooks:22:in `eval'
/Users/eddy/.rvm/gems/ruby-2.7.3/bin/ruby_executable_hooks:22:in `<main>'

@LongLonghaoran
Copy link
Author

Sorry, it works now after i change my sequel to original version(5.48.0) and rebundle install(which i meet errror at that version).

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

Successfully merging this pull request may close these issues.

Could not load the 'postgres' Active Record adapter
2 participants