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

Differences in require between 1.7.13 -> 1.7.14 breaking activerecord + jdbc + postgresql #3592

Closed
lupine opened this issue Jan 11, 2016 · 5 comments

Comments

@lupine
Copy link

lupine commented Jan 11, 2016

Hi,

I'm afraid I've not managed to get a simple replication of this, but I've got a large, complicated and fairly stupid application which runs in JRuby and uses ActiveRecord. Trying to update to latest JRuby (1.7.23), I experienced this error when trying to connect this application (or its tests) to the database (i.e., the ActiveRecord::Base#establish(:adapter => "postgresql", ...) call:

TypeError: superclass mismatch for class PostgreSQLAdapter
[...]/activerecord-4.1.4/lib/active_record/connection_adapters/postgresql/oid.rb:5:in `ConnectionAdapters'
[...]/activerecord-4.1.4/lib/active_record/connection_adapters/postgresql/oid.rb:4:in `ActiveRecord'
[...]/activerecord-4.1.4/lib/active_record/connection_adapters/postgresql/oid.rb:3:in `(root)'
org/jruby/RubyKernel.java:1065:in `require'
[...]
  • I bisected the versions and discovered that 1.7.13 does not display this behaviour, whilst 1.7.14 does.
  • Using "bundle exec rake test ..." in 1.7.14 makes the error disappear.
  • Using "jdbcpostgresql" instead of "postgresql" as the adapter makes the error appear in 1.7.13 as well

I hacked require to output the file being required and the call depth, and got these:
13.txt
14.txt

diff -Nru between 13 and 14 reports:

[lupine@nlwork Desktop]$ diff -Nru 13.txt 14.txt 
--- 13.txt  2016-01-11 19:18:36.294333723 +0000
+++ 14.txt  2016-01-11 19:18:41.901000322 +0000
@@ -1217,33 +1217,7 @@
 REQUIRE 3 thread_safe
 REQUIRE 2 arjdbc/postgresql/connection_methods
 REQUIRE 1 active_record/connection_adapters/postgresql_adapter
-REQUIRE 1 jdbc/postgres
-REQUIRE 2 jdbc/postgres/version
-REQUIRE 1 postgresql-9.3-1102.jdbc41.jar
-REQUIRE 1 active_record/scoping/default
-REQUIRE 1 active_record/scoping/named
-REQUIRE 1 active_record/base
-REQUIRE 1 database_cleaner/active_record/truncation
-REQUIRE 2 active_record/base
 REQUIRE 2 active_record/connection_adapters/abstract_adapter
-REQUIRE 2 active_record/connection_adapters/abstract_mysql_adapter
-REQUIRE 3 arel/visitors/bind_visitor
-REQUIRE 2 active_record/connection_adapters/postgresql_adapter
-REQUIRE 2 active_record/connection_adapters/sqlite3_adapter
+REQUIRE 2 active_record/connection_adapters/statement_pool
+REQUIRE 2 active_record/connection_adapters/postgresql/oid
 REQUIRE 3 active_record/connection_adapters/abstract_adapter
-REQUIRE 3 active_record/connection_adapters/statement_pool
-REQUIRE 3 arel/visitors/bind_visitor
-REQUIRE 3 active_record/connection_adapters/abstract_adapter
-REQUIRE 3 active_record/connection_adapters/statement_pool
-REQUIRE 3 arel/visitors/bind_visitor
-REQUIRE 3 database_cleaner/generic/truncation
-REQUIRE 3 database_cleaner/active_record/base
-REQUIRE 2 active_support/core_ext/array/conversions
-REQUIRE 2 active_support/core_ext/string/inflections
-REQUIRE 2 active_support/json
-REQUIRE 2 active_support/core_ext/string/access
-REQUIRE 2 active_support/core_ext/string/behavior
-REQUIRE 2 active_support/core_ext/module/delegation
-REQUIRE 2 yaml
-REQUIRE 2 i18n/core_ext/hash
-REQUIRE 2 i18n/core_ext/kernel/suppress_warnings

Installed gems that seem relevant:

  • activerecord (and friends) 4.1.4
  • activerecord-jdbc-adapter 1.3.9
  • activerecord-jdbcpostgresql-adapter 1.3.9
  • arel 5.0.1.20140414130214
  • bundler (1.11.2)
  • database_cleaner 1.3.0
  • jdbc-postgres 9.3.1102

I'm doing a bunch of stupid stuff in my codebase, and it's possible activerecord is actually the one at fault here - detecting and acting on the different version of jruby, perhaps - but @headius demanded on IRC that I file a bug, so that's what I'm doing ^^.

@kares
Copy link
Member

kares commented Jan 11, 2016

could you confirm this still happens with updated activerecord >= 4.1.13 activerecord-jdbc-adapter >= 1.3.17 and jruby 1.7.23 ?

@lupine
Copy link
Author

lupine commented Jan 12, 2016

Hi,

Yes, I get the same behaviour with AR 4.1.14 and activerecord-jdbc{,postgresql}-adapter 1.3.19 and jruby 1.7.23.

@headius
Copy link
Member

headius commented Jan 21, 2016

@lupine Is it possible for you to test with JRuby 9k?

If you can figure out what commit broke it, we can probably fix it in minutes. Alternatively, you can provide a reproduction (e.g. a git repo we can run against) we'll bisect it ourselves, but it will take longer to fix :-)

@enebo
Copy link
Member

enebo commented Apr 11, 2016

Punting this to 1.7.26 in the hopes it is still valid and should get lost. Without any more information I do not think we can fix this for 1.7.25 (out this week).

@enebo enebo modified the milestones: JRuby 1.7.26, JRuby 1.7.25 Apr 11, 2016
@enebo enebo modified the milestones: JRuby 1.7.26, JRuby 1.7.27 Aug 26, 2016
@headius
Copy link
Member

headius commented Mar 15, 2017

No information in over a year.

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

No branches or pull requests

4 participants