Skip to content

Don't log non-error "undefined method 'fields' for nil". - #440

Open
bglimepoint wants to merge 1 commit into
que-rb:masterfrom
bglimepoint:avoid-non-error
Open

Don't log non-error "undefined method 'fields' for nil".#440
bglimepoint wants to merge 1 commit into
que-rb:masterfrom
bglimepoint:avoid-non-error

Conversation

@bglimepoint

@bglimepoint bglimepoint commented Nov 14, 2025

Copy link
Copy Markdown

result is nil when running DELETE FROM public.que_jobs WHERE id = $1::bigint, which results in an error log.


Not sure whether this is something specific to us, but we're running 2.4.1 and are often seeing "error":"NoMethodError: undefined method 'fields' for nil" in our Que logs. Looks like this is where it's coming from (inside convert_result when it calls result.fields).

`result` is nil when running `DELETE FROM public.que_jobs WHERE id = ::bigint`, which results in an error log.
Comment thread lib/que/connection.rb
end

convert_result(result)
convert_result(result) unless result.nil?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I note that there are other call sites for convert_result, I'm wondering if this is better placed as a guard clause inside convert_result rather than out here?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants