Comments (8)
We're also seeing the same problem. Ruby 3.2.4 and Rails 7.1.3.2
from rails.
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.
We have the same issue. We haven't been able to reproduce it outside production. I will make another attempt this week 😢.
from rails.
We faced the same issue after our DB ran out of memory. Ruby 3.3.1 and Rails 7.1.3.3
from rails.
Same issue here. I can't find a way to reproduce it neither
from rails.
@nelhefni Are you able to share any graphs?
Does it happen after a deploy or does the issue occur under load?
from rails.
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:
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.
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)
- accepts_nested_attributes_for doesn't validate unchanged objects HOT 2
- Rails server --pid option does not seem to work as expected. Also no documentation found. HOT 2
- `ActiveRecord::NotNullViolation` for Missing Enum Default in Rails 7 HOT 7
- No connection pool for 'ActiveRecord::Base' found for the 'reading' role. #275 HOT 4
- trix with rails 7.0 giving TypeError HOT 2
- in guides.rubyonrails documentation of threads: missing info about db access HOT 1
- HasMany/HasOne associations: combining `:through` and a scope including a `.merge` leads to missing table HOT 1
- [Question] Why doesn't set_pk_sequence! support the parameter for is_called? HOT 5
- Rails 6.0.6.1 transaction rollback doesn't reload object HOT 1
- Error `undefined method `start_with?' for nil` when logging
- new_framework_defaults initializer for Rails 7.1 not setting ActiveRecord.run_after_transaction_callbacks_in_order_defined
- [Feature Request][CSP] Support for multiple Content Security Policies HOT 2
- ActionCable: Invalid channel causes repeated subscription attempts
- Code generation memory bloat post alias fix HOT 8
- Rails throws an error when sending invalid UTF-8 query param HOT 1
- Lazy default_scope evaluation in joined models loses original context
- Some Rails integration tests break with rack 3.1 HOT 4
- ActionText Editor Previews uploaded pre 7.1.3.4 are broken in 7.1.3.4 after a resave HOT 13
- Inversion of associations with :through don't work until it's saved
- Incorrect `has_many through` load with custom association name and custom keys type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rails.