Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

Rails/Redis ActiveRecord::RecordNotFound error even when the record clearly exists

$
0
0

I am currently working on a piece of software for the company I am working at, and I am at a complete loss as to how I can resolve this error.

This is what Sidekiq spits back at me

09:26:23 sidekiq.1 | 2024-07-02T13:26:22.990Z pid=45032 tid=17cw WARN: ActiveRecord::RecordNotFound: Couldn't find Quote with 'id'=1758

I can't share too much code, but below should be enough

class CreateOrUpdateApiJob < ApplicationJob  queue_as :default  # Called with quote=1758 and action=create  def perform(quote, action)     Quote.find(quote)     if action == "create"          ApiService.create()     elsif action === "update"          ApiService.update()     end  endend# This is queued withCreateOrUpdateApiJob.perform_later(quote, "create")

What I am working with:

  • MacBook Pro 2015, 2.8 Ghz Quad Intel Core i7, 16GB of 1600MHz DDR3, 1TB SSD, AMD Radeon R9 M370X 2GB, macOS Monterey 12.7.5

  • Ruby 3.1.4, via rbenv

  • PostgreSQL v15 server

  • Gems

    • Rails 6.1.7.4

    • Sidekiq 7.1.2

    • ActiveRecord 6.1.7.4

    • redis 4.8.1, redis-client 0.15.0

    • pg 1.5.4

The commands I run (via the foreman gem):

bundle exec rails server -p 3000 -e productionredis-server # Omitted in production, we have a separate Redis for productionbundle exec sidekiq -c 2 -q default -q mailers

I have tried just about everything. Whether it be passing the whole record into the quote argument, sending the record as a string and parsing, installing Redis fresh, it just doesn't work.


Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>