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

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

Open
number61971 opened this issue Feb 28, 2024 · 3 comments

Comments

@number61971
Copy link

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!'
@rdubya
Copy link
Collaborator

rdubya commented Feb 28, 2024

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.

@number61971
Copy link
Author

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?

@rdubya
Copy link
Collaborator

rdubya commented Feb 28, 2024

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

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

2 participants