Git Product home page Git Product logo

Comments (8)

rosa avatar rosa commented on August 10, 2024 1

Thanks @Naren1997! 🙏 Going to check these and will let you know.

from solid_queue.

rosa avatar rosa commented on August 10, 2024 1

Aha! Great catch! Thanks a lot for letting me know, this can be helpful in the future in case someone else runs into this 🙏

from solid_queue.

rosa avatar rosa commented on August 10, 2024

Huh, this is very strange 😕 I'm not sure I understand the logs very well. I see this error:

undefined method puts_log' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter

Is it because the ibm_db adapter is using a PostgreSQL adapter under the hood?

One thing, before we dig deeper: could you upgrade Solid Queue to the latest version? 0.3.4. You might need to run some extra migrations for that.

from solid_queue.

rosa avatar rosa commented on August 10, 2024

Another thing that might help is to try to enqueue a job with ActiveRecord::Base.logger.level = :debug in your console, and include the full logs from the job insertion, no need to include the whole ctiveRecord::ConnectionAdapters::PostgreSQLAdapter object, which is pretty big.

from solid_queue.

Naren1997 avatar Naren1997 commented on August 10, 2024

Hello @rosa Thanks for your assistance!
I tried with upgrading the solidqueue version to 0.3.4(and rails version to 7.1.3.4), still I'm facing the same issue. Attaching my full debug log (i have included PostgreSQLAdapter log as well)
full_log_on_insert.txt

Indeed it looks like PostgreSQLAdapter is trying to call the method in ibm_db2 adaptor, but I don't see issue when I use good_jobs

from solid_queue.

rosa avatar rosa commented on August 10, 2024

Hey @Naren1997, would you mind copying the output of

SolidQueue::Job.connection.raw_connection

from your development console? I think that'll confirm the PostgreSQL adapter is being used 🤔

From the full logs, looks like the INSERT is at least happening on PostgreSQL:

INSERT INTO "solid_queue_jobs" ("queue_name", "class_name", "arguments", "priority", "active_job_id", "scheduled_at", "finished_at", "concurrency_key", "created_at", "updated_at") 
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id"

because I don't think IBM DB2 supports RETURNING. However, the ibm_db adapter is somehow being mixed with that, how puzzling! The create_savepoint method is being called because there's a callback on SolidQueue::Job: after creating the job we prepare it for execution, which creates other records. The update operation doesn't trigger any callbacks, thus no save points, and no errors.

Do you have any models in your app that trigger any callbacks before/after saving to save other models? Wondering if you could test with those and see if the same thing happens.

I think GoodJob doesn't run any callbacks when inserting jobs so that might be a reason this is not happening, but I'm not sure.

from solid_queue.

Naren1997 avatar Naren1997 commented on August 10, 2024

Hello @rosa Yeah I noticed for other models if I have a callback that has the logic to call the create_savepoint it is giving the same error. It looks the issue is with the ibm_db2 package, they have written this https://github.com/ibmdb/ruby-ibmdb/blob/master/IBM_DB_Adapter/ibm_db/lib/active_record/connection_adapters/ibm_db_adapter.rb#L502 code such that it'll override the actual https://github.com/rails/rails/blob/main/activerecord/lib/active_record/connection_adapters/abstract/savepoints.rb#L6

I'll open an issue with ibm_db2.

Thank you much for your support!

from solid_queue.

Naren1997 avatar Naren1997 commented on August 10, 2024

Issue is with ibm_db2 package

from solid_queue.

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.