Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR (81171): Resolve and Reject Operation fields are still referenced from table \"directus_operations\" #79

Open
ckahle33 opened this issue Jun 14, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ckahle33
Copy link

ckahle33 commented Jun 14, 2024

Describe the bug
We are using quite a few flows, and depending on the UUIDs in different environments etc, we frequently see the error:

[10:12:32.849] ERROR (81171):
    errors: [
      {
        "message": {
          "length": 386,
          "name": "error",
          "severity": "ERROR",
          "code": "23503",
          "detail": "Key (id)=(<operation_id>) is still referenced from table \"directus_operations\".",
          "schema": "public",
          "table": "directus_operations",
          "constraint": "directus_operations_resolve_foreign",
          "file": "ri_triggers.c",
          "line": "2478",
          "routine": "ri_ReportViolation"
        },
        "extensions": {
          "code": "INTERNAL_SERVER_ERROR"
        }
      }
    ]
    response: {}

running update directus_operations set resolve = NULL, reject = NULL; will fix this error and will then write the correct operation fk value in those columns on the next npx directus-sync push.

It is possible that this is a directus bug from earlier versions where the db state can be "corrupt" in a way where old deleted operations are still being referenced from directus_operations.resolve and directus_operations.reject columns.

Thank you for taking a look at this. We rely on this tool to sync flow and schema state across environments, and it has been excellent and very useful so far.

To Reproduce
Steps to reproduce the behavior:

  1. Create a bunch of flows with a few operations in directus
  2. Run directus-sync push -c ./directus-sync.local.config.cjs

Expected behavior
In some cases directus-sync push will retry to reconcile foreign key relations, which in this case, is not happening

Versions (please complete the following information):

  • Directus-Sync version: ^1.5.3
  • Directus version: 10.11.0
  • Directus environment: Docker (local)
@EdouardDem
Copy link
Member

@ckahle33 It seems related to this issue : #58
I will add tests to reproduce this bug and fix it.

@jofmi
Copy link

jofmi commented Jun 27, 2024

I also just experienced this bug - deleting the flow in question is a temporary fix :)

@Vahagn-Zaqaryan
Copy link

Same issue here

image

@EdouardDem EdouardDem added the bug Something isn't working label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

4 participants