Comments (9)
Please at least include the full backtraces.
from rails.
@trevorturk I'm not using Falcon or Fibers 🤔
from rails.
Possibly related: #48716
from rails.
NoMethodError
undefined method `cmd_tuples' for []:Array (NoMethodError)
execute_and_clear(sql, name, binds) { |result| result.cmd_tuples }
activerecord (7.1.3.2) lib/active_record/connection_adapters/postgresql/database_statements.rb in block in exec_delete
activerecord (7.1.3.2) lib/active_record/connection_adapters/postgresql_adapter.rb in execute_and_clear at line 877
activerecord (7.1.3.2) lib/active_record/connection_adapters/postgresql/database_statements.rb in exec_delete at line 77
activerecord (7.1.3.2) lib/active_record/connection_adapters/abstract/database_statements.rb in delete at line 208
activerecord (7.1.3.2) lib/active_record/connection_adapters/abstract/query_cache.rb in delete at line 25
activerecord (7.1.3.2) lib/active_record/persistence.rb in _delete_record at line 624
activerecord (7.1.3.2) lib/active_record/persistence.rb in _delete_row at line 1198
activerecord (7.1.3.2) lib/active_record/persistence.rb in destroy_row at line 1194
activerecord (7.1.3.2) lib/active_record/counter_cache.rb in destroy_row at line 197
activerecord (7.1.3.2) lib/active_record/locking/optimistic.rb in destroy_row at line 125
activerecord (7.1.3.2) lib/active_record/persistence.rb in destroy at line 783
activerecord (7.1.3.2) lib/active_record/callbacks.rb in block in destroy at line 423
activesupport (7.1.3.2) lib/active_support/callbacks.rb in run_callbacks at line 110
activesupport (7.1.3.2) lib/active_support/callbacks.rb in _run_destroy_callbacks at line 952
activerecord (7.1.3.2) lib/active_record/callbacks.rb in destroy at line 423
activerecord (7.1.3.2) lib/active_record/transactions.rb in block in destroy at line 305
activerecord (7.1.3.2) lib/active_record/transactions.rb in block in with_transaction_returning_status at line 365
activerecord (7.1.3.2) lib/active_record/connection_adapters/abstract/transaction.rb in block in within_new_transaction at line 535
activesupport (7.1.3.2) lib/active_support/concurrency/null_lock.rb in synchronize at line 9
activerecord (7.1.3.2) lib/active_record/connection_adapters/abstract/transaction.rb in within_new_transaction at line 532
activerecord (7.1.3.2) lib/active_record/connection_adapters/abstract/database_statements.rb in transaction at line 344
activerecord (7.1.3.2) lib/active_record/transactions.rb in with_transaction_returning_status at line 361
activerecord (7.1.3.2) lib/active_record/transactions.rb in destroy at line 305
and
NoMethodError
undefined method `clear' for nil:NilClass (NoMethodError)
result.clear
activerecord (7.1.3.2) lib/active_record/connection_adapters/postgresql_adapter.rb in execute_and_clear at line 879
activerecord (7.1.3.2) lib/active_record/connection_adapters/postgresql/database_statements.rb in exec_delete at line 77
activerecord (7.1.3.2) lib/active_record/connection_adapters/abstract/database_statements.rb in delete at line 208
activerecord (7.1.3.2) lib/active_record/connection_adapters/abstract/query_cache.rb in delete at line 25
activerecord (7.1.3.2) lib/active_record/persistence.rb in _delete_record at line 624
activerecord (7.1.3.2) lib/active_record/persistence.rb in _delete_row at line 1198
activerecord (7.1.3.2) lib/active_record/persistence.rb in destroy_row at line 1194
activerecord (7.1.3.2) lib/active_record/counter_cache.rb in destroy_row at line 197
activerecord (7.1.3.2) lib/active_record/locking/optimistic.rb in destroy_row at line 125
activerecord (7.1.3.2) lib/active_record/persistence.rb in destroy at line 783
activerecord (7.1.3.2) lib/active_record/callbacks.rb in block in destroy at line 423
activesupport (7.1.3.2) lib/active_support/callbacks.rb in run_callbacks at line 110
activesupport (7.1.3.2) lib/active_support/callbacks.rb in _run_destroy_callbacks at line 952
activerecord (7.1.3.2) lib/active_record/callbacks.rb in destroy at line 423
activerecord (7.1.3.2) lib/active_record/transactions.rb in block in destroy at line 305
activerecord (7.1.3.2) lib/active_record/transactions.rb in block in with_transaction_returning_status at line 365
activerecord (7.1.3.2) lib/active_record/connection_adapters/abstract/transaction.rb in block in within_new_transaction at line 535
activesupport (7.1.3.2) lib/active_support/concurrency/null_lock.rb in synchronize at line 9
activerecord (7.1.3.2) lib/active_record/connection_adapters/abstract/transaction.rb in within_new_transaction at line 532
activerecord (7.1.3.2) lib/active_record/connection_adapters/abstract/database_statements.rb in transaction at line 344
activerecord (7.1.3.2) lib/active_record/transactions.rb in with_transaction_returning_status at line 361
activerecord (7.1.3.2) lib/active_record/transactions.rb in destroy at line 305
from rails.
result.clear
at https://github.com/rails/rails/blob/v7.1.3.2/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L879
if !prepare || without_prepared_statement?(binds)
result = exec_no_cache(sql, name, binds, async: async, allow_retry: allow_retry, materialize_transactions: materialize_transactions)
else
result = exec_cache(sql, name, binds, async: async, allow_retry: allow_retry, materialize_transactions: materialize_transactions)
end
begin
ret = yield result
ensure
result.clear
end
ret
This suggest exec_cache
or exec_no_cache
returned nil
, which shouldn't happen.
from rails.
it only happens in our production environment
Any patterns on how it happen? e.g. fully random? Or some spikes around a certain time across all processes, or only in one process, etc?
from rails.
@casperisfine figured it out, this was somehow caused by a missing dependent: :destroy
on a model, no idea how that materialized as nil result
though 🤔
from rails.
Yeah, that's extremely weird. If you ever come up with a repro, please share it. Because I suspect there is more to it.
from rails.
I'm not sure if this is related, but I wanted to mention that I encountered the same result.clear
error where exec_cache
and exec_no_cache
(I tested both) were nil
(which shouldn't happen) when I upgraded from Rails 7.0.x to 7.1.x in an app running Falcon where I hadn't switched isolation_state
to :fiber
. Once I switched the isolation state to fiber, the error disappeared. (There were a few other strange errors like this which all disappeared, but this was the most common one by far, and not just triggered by deleting records.)
I'm curious if @nathan-appere might be using Falcon and/or Fibers? I'm sorry if this isn't related or is misdirecting from the actual issue, but I thought it worth mentioning. Thanks!
from rails.
Related Issues (20)
- [ActiveStorage] blob.url doesn't return permanent link HOT 4
- Model marked as `readonly!` performs `update_all` insertions HOT 1
- Failure/Error: require 'active_support/all', while loading spec_helper.rb HOT 5
- [ActiveRecord] migrations: `update` statements are silently being executed in both directions HOT 2
- `alias_attribute` does not work when building `has_many` records via relation. HOT 2
- database.yml gets evaluated before initializers run since Rails 7.1.0 HOT 7
- `csp_meta_tag` helper generates a meta tag w/o out making use of the nonce hiding which could lead to nonce value exfiltration of nonce data HOT 3
- [ActiveRecord] PostgreSQL Adapter skips update on CIDR column when only netmask is changed
- ActionView's typecast method raises an TypeError on Resolver-object instance, but it shouldn't HOT 1
- Is there already a built-in method from the Rails API for finding all NESTED belongs_to associations? HOT 1
- Update getting started guide to include ImportMap and Turbo initalization.
- [7.1] MIME parsing raising errors on valid parameters HOT 1
- Rails Query Issue with Null Value Comparison HOT 1
- [Bug][ActionCable/Zeitwerk] Code reloading doesn't close connections HOT 4
- find_by called with no paramaters HOT 3
- Should select show a prompt when its attribute is false? HOT 8
- collection_check_boxes hidden field ignores :form option
- Action Cable as Stand Alone server leads to Devise::MissingWarden: error HOT 2
- Postgres prepared statements and array queries with certain syntax result in `PG::InvalidTextRepresentation` HOT 5
- Rubocop binstubs issue causes failures on Windows HOT 9
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.