activerecord-jdbc-adapter icon indicating copy to clipboard operation
activerecord-jdbc-adapter copied to clipboard

Cannot connect to database: `ArgumentError: wrong number of arguments (given 4, expected 1..3)`

Open number61971 opened this issue 1 year ago • 3 comments

activerecord-jdbc-adapter 70.1 jRuby 9.4.5.0 Rails (ActiveRecord) 7.1.3.2

All attempts to connect to a MySQL db fails with ArgumentError: wrong number of arguments (given 4, expected 1..3).

Possibly related to an existing (closed but apparently unsolved) issue: ArgumentError: wrong number of arguments (given 4, expected 1..3) #1013

Backtrace:

# /app/gems/gems/activerecord-jdbc-adapter-70.1-java/lib/arjdbc/abstract/core.rb:12:in `initialize'
# /app/gems/gems/activerecord-jdbc-adapter-70.1-java/lib/arjdbc/abstract/statement_cache.rb:23:in `initialize'
# /app/gems/gems/activerecord-jdbc-adapter-70.1-java/lib/arjdbc/mysql/adapter.rb:38:in `initialize'
# /app/gems/gems/activerecord-jdbc-adapter-70.1-java/lib/arjdbc/jdbc/callbacks.rb:14:in `new'
# /app/gems/gems/activerecord-jdbc-adapter-70.1-java/lib/arjdbc/jdbc/connection_methods.rb:10:in `jdbc_connection'
# /app/gems/gems/activerecord-jdbc-adapter-70.1-java/lib/arjdbc/mysql/connection_methods.rb:101:in `mysql_connection'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:676:in `new_connection'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:723:in `checkout_new_connection'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:702:in `try_to_checkout_new_connection'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:654:in `acquire_connection'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `checkout'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:182:in `connection'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/tasks/database_tasks.rb:501:in `block in with_temporary_connection'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/tasks/database_tasks.rb:518:in `with_temporary_pool'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/tasks/database_tasks.rb:500:in `with_temporary_connection'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/tasks/database_tasks.rb:377:in `schema_up_to_date?'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:762:in `block in any_schema_needs_update?'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:761:in `any_schema_needs_update?'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:715:in `load_schema_if_pending!'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:730:in `block in maintain_test_schema!'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1026:in `suppress_messages'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:735:in `method_missing'
# /app/gems/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:730:in `maintain_test_schema!'

number61971 avatar Feb 28 '24 17:02 number61971

Hi @number61971, It looks like you are trying to use the 70.1 version of this gem with rails 7.1. It doesn't currently support 7.1 but there is work in the master branch towards compatibility. Once we have compatibility, a 71.0 version of the gem will be released. We unfortunately haven't made much progress on the mysql or Postgres adapters though.

rdubya avatar Feb 28 '24 17:02 rdubya

Hi @rdubya, Thank you for the prompt reply! I didn't realize that version numbers tracked like that. Does this mean I have to stick to Rails 7.0.x?

number61971 avatar Feb 28 '24 19:02 number61971

Unfortunately, yeah. Until we get more help with the gem we're kind of stuck with slow progress.

rdubya avatar Feb 28 '24 19:02 rdubya