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

Rails 5.1 Breaks postgres adapter #780

Closed
mattclar opened this issue Mar 28, 2017 · 20 comments
Closed

Rails 5.1 Breaks postgres adapter #780

mattclar opened this issue Mar 28, 2017 · 20 comments
Milestone

Comments

@mattclar
Copy link
Contributor

mattclar commented Mar 28, 2017

I get this error on startup of my server after upgrading to rails 5.1
I presume its from an activerecord change somewhere

web_1 | Bundler::GemRequireError: There was an error while trying to load the gem 'activerecord-jdbcpostgresql-adapter'.
web_1 | Gem Load Error is: uninitialized constant ActiveRecord::ConnectionAdapters::PostgreSQL::ColumnDefinition
web_1 | Backtrace for gem load error is:
web_1 | /usr/local/bundle/bundler/gems/activerecord-jdbc-adapter-395443eef4db/lib/arjdbc/postgresql/adapter.rb:1527:in `<class:PostgreSQLAdapter>'
web_1 | /usr/local/bundle/bundler/gems/activerecord-jdbc-adapter-395443eef4db/lib/arjdbc/postgresql/adapter.rb:1490:in `<module:ConnectionAdapters>'
web_1 | /usr/local/bundle/bundler/gems/activerecord-jdbc-adapter-395443eef4db/lib/arjdbc/postgresql/adapter.rb:1478:in `<main>'
web_1 | /usr/local/bundle/bundler/gems/activerecord-jdbc-adapter-395443eef4db/lib/arjdbc/postgresql.rb:1:in `<main>'
web_1 | /usr/local/bundle/bundler/gems/activerecord-jdbc-adapter-395443eef4db/lib/arjdbc/postgresql.rb:2:in `<main>'
web_1 | /usr/local/bundle/bundler/gems/activerecord-jdbc-adapter-395443eef4db/activerecord-jdbcpostgresql-adapter/lib/activerecord-jdbcpostgresql-adapter.rb:1:in `require'
web_1 | /usr/local/bundle/bundler/gems/activerecord-jdbc-adapter-395443eef4db/activerecord-jdbcpostgresql-adapter/lib/activerecord-jdbcpostgresql-adapter.rb:1:in `block in (root)'
web_1 | /usr/local/bundle/bundler/gems/activerecord-jdbc-adapter-395443eef4db/activerecord-jdbcpostgresql-adapter/lib/activerecord-jdbcpostgresql-adapter.rb:3:in `each'
web_1 | /usr/local/bundle/bundler/gems/activerecord-jdbc-adapter-395443eef4db/activerecord-jdbcpostgresql-adapter/lib/activerecord-jdbcpostgresql-adapter.rb:3:in `block in (root)'
web_1 | /opt/jruby/lib/ruby/gems/shared/gems/bundler-1.13.7/lib/bundler/runtime.rb:1:in `each'
web_1 | /opt/jruby/lib/ruby/gems/shared/gems/bundler-1.13.7/lib/bundler/runtime.rb:1:in `(root)'
web_1 | /opt/jruby/lib/ruby/gems/shared/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in `require'
web_1 | /opt/jruby/lib/ruby/gems/shared/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `<main>'
web_1 | /opt/jruby/lib/ruby/gems/shared/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `require'
web_1 | /opt/jruby/lib/ruby/gems/shared/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `block in require'
web_1 | /opt/jruby/lib/ruby/gems/shared/gems/bundler-1.13.7/lib/bundler.rb:106:in `tap'
web_1 | /opt/jruby/lib/ruby/gems/shared/gems/bundler-1.13.7/lib/bundler.rb:106:in `require'
web_1 | /usr/src/app/config/application.rb:9:in `(root)'
web_1 | /usr/local/bundle/gems/railties-5.1.0.rc1/lib/rails/commands/server/server_command.rb:1:in `(root)'
web_1 | /usr/local/bundle/gems/railties-5.1.0.rc1/lib/rails/commands/server/server_command.rb:128:in `perform'
web_1 | /usr/local/bundle/gems/railties-5.1.0.rc1/lib/rails/commands/server/server_command.rb:125:in `perform'
web_1 | /usr/local/bundle/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
web_1 | /usr/local/bundle/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `<main>'
web_1 | bin/rails:4:in `require'
web_1 | bin/rails:4:in `<main>'
web_1 | Bundler Error Backtrace:
web_1 | 
web_1 |   block in require at /opt/jruby/lib/ruby/gems/shared/gems/bundler-1.13.7/lib/bundler/runtime.rb:95
web_1 |               each at org/jruby/RubyArray.java:1733
web_1 |   block in require at /opt/jruby/lib/ruby/gems/shared/gems/bundler-1.13.7/lib/bundler/runtime.rb:86
web_1 |               each at org/jruby/RubyArray.java:1733
web_1 |            require at /opt/jruby/lib/ruby/gems/shared/gems/bundler-1.13.7/lib/bundler/runtime.rb:75
web_1 |            require at /opt/jruby/lib/ruby/gems/shared/gems/bundler-1.13.7/lib/bundler.rb:106
web_1 |             <main> at /usr/src/app/config/application.rb:9
web_1 |            require at org/jruby/RubyKernel.java:961
web_1 |    block in (root) at /usr/local/bundle/gems/railties-5.1.0.rc1/lib/rails/commands/server/server_command.rb:1
web_1 |                tap at org/jruby/RubyKernel.java:1747
web_1 |            perform at /usr/local/bundle/gems/railties-5.1.0.rc1/lib/rails/commands/server/server_command.rb:128
web_1 |            perform at /usr/local/bundle/gems/railties-5.1.0.rc1/lib/rails/commands/server/server_command.rb:125
web_1 |                run at /usr/local/bundle/gems/thor-0.19.4/lib/thor/command.rb:27
web_1 |     invoke_command at /usr/local/bundle/gems/thor-0.19.4/lib/thor/invocation.rb:126
web_1 |           dispatch at /usr/local/bundle/gems/thor-0.19.4/lib/thor.rb:369
web_1 |            perform at /usr/local/bundle/gems/railties-5.1.0.rc1/lib/rails/command/base.rb:63
web_1 |             <main> at /usr/local/bundle/gems/railties-5.1.0.rc1/lib/rails/command.rb:44
web_1 |            require at org/jruby/RubyKernel.java:961
web_1 |             <main> at bin/rails:4


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@kares
Copy link
Member

kares commented Apr 5, 2017

well ar 5.0 (still) isnt really supported/tested much ... as far as I know. thus not sure if there was smt to break :) but thanks for the report. recommend you try take a look at it yourself as there isnt much activity besides patch merging/maintenance around here.

@bencarsal
Copy link
Contributor

I change this line in file arjdbc/jdbc.rb, please review this: rails-5...bencarsal:patch-1

@keithrbennett
Copy link

keithrbennett commented May 19, 2017

@kares Can you help me understand why this is not a serious issue? I may be missing something, but doesn't it make JRuby unusable with Rails 5.1 and Postgres?

@kares
Copy link
Member

kares commented May 20, 2017

@keithrbennett simply because there's no one to do it (personally trying to do maintenance of the stable line and some house-keeping/perf.work on master when I have time, the rest of JRuby team already tried doing the AR 5.x update but did not yet deliver fully) ... there are attempts but its a task that needs focused men power (AR-JDBC supports a lot of adapters and also accumulated some debt). have tried asking for support to speed things up (personally have no need to chase the Rails 5.x dragon yet) but no one cared much.

simply said this is OSS. its a bit demotivating explaining this over-and-over (esp. when someone expects volunteers to have a certain sense of "seriousness") and communicating false hopes over private e-mail with occasional "supporters" that always go silent 😥

@keithrbennett
Copy link

Firstly, thank you for the time and effort you've contributed. It's totally understandable that you have your own life and priorities, and are already contributing heavily, and no one can fault you for that. I was not complaining, I was just confused because I inferred that you believed that the issue was not important. Now I understand that you are not questioning the importance but just explaining that there is not enough manpower to address the issue. Thanks also for the explanation.

@rsov
Copy link
Contributor

rsov commented May 22, 2017

I'm just curious as to why the rails team feels the need to change everything on each revision. Like sure, I read the rails doctrine and agree with their "Progress over stability" moto. However in the real world its painful that they change everything.

The as400 system at my workplace has been around longer than I've been alive but since everything is backwards compatible, we don't have to worry about updates breaking stuff. Trying to explain to our boss why it takes us so much time and effort to upgrade rails is always an uphill battle

@fmluizao
Copy link

fmluizao commented Oct 6, 2017

How can I help to support rails 5? I'm willing to help, but don't want to mess with java if possible =P

@enebo enebo added this to the 51.0 milestone Nov 13, 2017
@enebo
Copy link
Member

enebo commented Nov 13, 2017

This is sort of represented by our new label and targetted milestone but I left it open to resolve when 51.0 is released.

@Dee-2015
Copy link

Could it be that RoR 5.1 doesn't work with postgresl > 10 ? I found this page due to the fact that my rspecs starting to fail with a PG 10 database. They work fine with PG 9.5.10 version.

@rdubya
Copy link
Collaborator

rdubya commented Nov 15, 2017

The original issue is happening because the gem isn't compatible with Rails 5.1 yet. It should be fixed with this commit: 3ad4910

@kares
Copy link
Member

kares commented Nov 15, 2017

@rdubya feel free to close it - if you feel like there isn't much value here for the (pending) 5.1 work here

@rdubya
Copy link
Collaborator

rdubya commented Nov 15, 2017

Sounds good. I'll close it for now, it should be fixed with the 51 release.

@rdubya rdubya closed this as completed Nov 15, 2017
@abevoelker
Copy link

I'm still encountering this issue; I see there are 51.0 versions released for gems activerecord-jdbc-adapter, activerecord-jdbcmysql-adapter and activerecord-jdbcsqlite3-adapter, but activerecord-jdbcpostgresql-adapter is still on 50.0 - would it be possible to get a 51.0 release for the Postgres adapter, or is something else holding it up? Thank you!

@enebo
Copy link
Member

enebo commented Jan 11, 2018

@abevoelker there was a lot of broken tests from 50 to 51 on postgresql. I think several of those have been fixed now so we should consider that even if it is not perfect.

@risinglf
Copy link

@rdubya @enebo this issue still persists, right @abevoelker ?

Why the 51 gem is not yet available?

Thanks a lot for your work

@michaeldbarry
Copy link

@rdubya ++ for the patch ... it almost worked for me but I was also getting a

NameError: undefined local variable or method `max_identifier_length' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter

error. I just

alias_method :max_identifier_length, :table_alias_length

in lib/arjdbc/postgresql/adapter.rb and all seems wll.

@rdubya
Copy link
Collaborator

rdubya commented Feb 21, 2018

@risinglf I'm currently (slowly) trying to patch up some more issues with 50 that I'm going to port over to 51 and then we'll likely be able to release a 51.0 for postgres.

@michaeldbarry I haven't seen that issue, what version of rails and adapter gem are you using? Could you make a new issue for it so I can keep track of it a little easier?

@bgmat
Copy link

bgmat commented Mar 21, 2018

Hi,
I'm getting a similar error, when trying to run rake db:migrate (rails 5.1.5, jRuby 9.1.16.0).
Bundler::GemRequireError: There was an error while trying to load the gem 'activerecord-jdbcpostgresql-adapter'.
Gem Load Error is: uninitialized constant ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Rails51Point

Is this the same issue?

@rdubya
Copy link
Collaborator

rdubya commented Mar 21, 2018

Hi @bgmat, we still haven't released a version of the postgres adapter that works with 5.1 yet, we are hopefully getting close though.

glebm added a commit to glebm/order_query that referenced this issue Mar 21, 2018
@n-rodriguez
Copy link

Hi there! Any news?

Good725 added a commit to Good725/ruby_order that referenced this issue Feb 25, 2020
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