Git Product home page Git Product logo

Comments (8)

LucaProvencal avatar LucaProvencal commented on September 25, 2024 1

We're also seeing the same problem. Ruby 3.2.4 and Rails 7.1.3.2

from rails.

martinvium avatar martinvium commented on September 25, 2024 1

We run into this issue periodically after upgrading to rails (7.1.3.4), and running on pg (1.5.6), and ruby 3.3.2.

It happens during deployment of new pods, and sometimes will resolve it self after some time (Possibly only when the pod is restarted. I haven't been able to confirm).

We have had a couple of variants of this error happen (only in production). First one matches the one from the ticket description:

NoMethodError: undefined method `key?' for nil
get_oid_type(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/postgresql_adapter.rb:829)
block (2 levels) in internal_exec_query(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:70)
each(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:67)
each_with_index(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:67)
block in internal_exec_query(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:67)
execute_and_clear(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/postgresql_adapter.rb:877)
internal_exec_query(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:64)
select(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:630)
select_all(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:71)
block in select_all(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/abstract/query_cache.rb:112)
block in cache_sql(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/abstract/query_cache.rb:152)
synchronize(/usr/local/bundle/gems/activesupport-7.1.3.4/lib/active_support/concurrency/null_lock.rb:9)
cache_sql(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/abstract/query_cache.rb:147)
select_all(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/abstract/query_cache.rb:112)
_query_by_sql(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/querying.rb:62)
find_by_sql(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/querying.rb:51)
execute(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/statement_cache.rb:150)
cached_find_by(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/core.rb:431)
find_by(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/core.rb:300)
find_by!(/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/core.rb:304)
...

And this one we've seen more often:

ActiveRecord::StatementInvalid: wrong argument type nil (expected PG::TypeMap)
rescue in cached_find_by(/usr/local/bundle/gems/activerecord-7.1.3.3/lib/active_record/core.rb:433)
cached_find_by(/usr/local/bundle/gems/activerecord-7.1.3.3/lib/active_record/core.rb:430)
find_by(/usr/local/bundle/gems/activerecord-7.1.3.3/lib/active_record/core.rb:300)
find_by!(/usr/local/bundle/gems/activerecord-7.1.3.3/lib/active_record/core.rb:304)

from rails.

frodsan avatar frodsan commented on September 25, 2024

We have the same issue. We haven't been able to reproduce it outside production. I will make another attempt this week 😢.

from rails.

nelhefni avatar nelhefni commented on September 25, 2024

We faced the same issue after our DB ran out of memory. Ruby 3.3.1 and Rails 7.1.3.3

from rails.

sailor avatar sailor commented on September 25, 2024

Same issue here. I can't find a way to reproduce it neither

from rails.

zzak avatar zzak commented on September 25, 2024

@nelhefni Are you able to share any graphs?

Does it happen after a deploy or does the issue occur under load?

from rails.

nelhefni avatar nelhefni commented on September 25, 2024

We got the same stack trace as @martinvium (the one ending with get_oid_type call).

Here is the memory of our DB when the incident occured:
Screenshot 2024-06-12 at 6 50 21 PM

The issue is not related to a deployment.
We got our first instance of the error at 15:23 (13 mins after freeable memory reach a dangerous low), and the error continued for over an hour, despite the freeable memory increasing again. We had to restart the application to fix the issue.

from rails.

navidemad avatar navidemad commented on September 25, 2024

We got the same sometimes when the database is in a state of upgrading or out of memory or get DDOS.

from rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.