Skip to content

[11.0->12.0] queue_job module is not upgraded correctly (postgres trigger is missing) #262

Closed

Description

@legalsylvain

Hi all,

I faced an issue, with a database that comes from 11.0, with queue_job installed, when I migrated the database to 12.0.

After a (loooong !) investigation, the database is not correctly set, because this script is not executed.

  • The script doesn't exist in V11.
  • The script is only executed on the installation of the module (not during the update / upgrade process)

To check if the database is OK, you can run the following script :
select * from information_schema.triggers;

if there are no result, queue_job will not work correctly.

I think that moving the script from a post_init_hook to a migrations folder could fix the bug.

What do you think ?

Thanks.

CC : @guewen

Activity

  1. pedrobaeza commented on Oct 10, 2020

    @pedrobaeza
    Member

    It should be in both places. Create a migration script that imports the method (from odoo.addons.queue_job.hooks import post_init_hook or similar) and call it in the migration script.

    I haven't experimented this problem in my 12.0 migrated databases though. I will check to see.

  2. sbidoul commented on Oct 10, 2020

    @sbidoul
    Member

    @legalsylvain the trigger was moved from the job runner startup to a post init hook quite recently (see #245).

    But the trigger did exist in v11, in fact it has never changed since the job runner exists.

    Could it be the trigger was lost in a db dump/restore ?

  3. legalsylvain commented on Oct 10, 2020

    @legalsylvain
    ContributorAuthor

    Hi @sbidoul and @pedrobaeza. Thanks for taking a time to answer my issue.

    Could it be the trigger was lost in a db dump/restore ?

    No. (it would be worrying !)

    But the trigger did exist in v11, in fact it has never changed since the job runner exists.

    OK ! I made a summary, but the whole story is that the db is a 8.0, openupgraded from 8.0 to 12.0, using each step. In the V11 step, a module pos_picking_delayed has a new dependency to queue_job, so queue_job is installed.
    But as it is only an upgrade with --stop-after-init, and --workers=0 and without server_wide_modules=queue_job,web, maybe the _initialize() function (that was hosting before the creation of the postgres function) is not executed, that could explain my problem, and explain also why it doesn't occure in other regular cases. (like @pedrobaeza instances).

  4. github-actions commented on Feb 6, 2022

    @github-actions

    There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
    If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

  5. added
    stalePR/Issue without recent activity, it'll be soon closed automatically.
    on Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stalePR/Issue without recent activity, it'll be soon closed automatically.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions