Skip to content

Deadlock on 1655979260869-sync-handlers.ts migration #325

Open
@Konard

Description

@Konard
npm run migrate
  shell: /usr/bin/bash -e {0}
  env:
    MIGRATIONS_ID_TYPE_SQL: bigint
    MIGRATIONS_HASURA_PATH: localhost:8080
    MIGRATIONS_HASURA_SSL: 0
    MIGRATIONS_HASURA_SECRET: myadminsecretkey
    MIGRATIONS_DEEPLINKS_URL: http://host.docker.internal:3006/
    JWT_SECRET: {"type":"HS256","key":"3EK6FD+o0+c7tzBNVfjpMkNDi2yARAAKzQlk8O2IKoxQu4nF7EdAh8s3TwpHwrdWT6R"}

> @deep-foundation/[email protected] migrate
> npm run package:build && npx migrate@latest up --matches '*.js'


> @deep-foundation/[email protected] package:build
> tsc --project tsconfig.json

npm WARN exec The following package was not found and will be installed: [email protected]
ok
ok
(node:4524) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
  up : 1616701513782-links.js
  up : 1616701513790-selectors-cache.js
  up : 1621815803560-auto-indexes.js
  up : 1621815803572-materialized-path.js
  up : 1621815803592-type-mp.js
  up : 1622230000000-reserved-links.js
  up : 1622421760250-values.js
  up : 1622421760256-types.js
admin 380
  up : 1622421760258-selectors.js
  up : 1622421760259-can.js
  up : 1622421760260-permissions.js
  up : 1623023831753-jwt.js
  up : 1637975150573-packager.js
  up : 1637975150590-promises.js
  up : 1642827746040-demo.js
  up : 1655979260869-sync-handlers.js
error Internal Server Error {
  internal: {
    statement: 'DROP FUNCTION IF EXISTS hdb_catalog."notify_hasura_links_INSERT"() CASCADE',
    prepared: false,
    error: {
      exec_status: 'FatalError',
      hint: 'See server log for query details.',
      message: 'deadlock detected',
      status_code: '40P01',
      description: 'Process 252 waits for AccessExclusiveLock on relation 16528 of database 13458; blocked by process 257.\n' +
        'Process 257 waits for AccessShareLock on relation 16809 of database 13458; blocked by process 252.'
    },
    arguments: []
  },
  path: '$.args',
  error: 'database query error',
  code: 'unexpected'
}
  up : 1657486935281-authorization.js
  up : 1657720948151-handlers.js
  up : 1658622099992-unvalue.js
  up : 1658909585601-hasura-storage.js
  up : 1661392616544-core-symbols.js
[
  {
    "name": "ApolloError",
    "graphQLErrors": [
      {
        "extensions": {
          "internal": {
            "error": "expecting 2xx or 4xx status code, but found 500",
            "response": {
              "status": 500,
              "body": {
                "error": "ApolloError: database query error"
              },
              "headers": [
                {
                  "value": "Express",
                  "name": "X-Powered-By"
                },
                {
                  "value": "*",
                  "name": "Access-Control-Allow-Origin"
                },
                {
                  "value": "application/json; charset=utf-8",
                  "name": "Content-Type"
                },
                {
                  "value": "45",
                  "name": "Content-Length"
                },
                {
                  "value": "W/\"2d-/U3CkZJ+iXHlvjSpUlcM3iOFwfE\"",
                  "name": "ETag"
                },
                {
                  "value": "Mon, 11 Mar 2024 06:17:55 GMT",
                  "name": "Date"
                },
                {
                  "value": "keep-alive",
                  "name": "Connection"
                },
                {
                  "value": "timeout=5",
                  "name": "Keep-Alive"
                }
              ]
            },
            "request": {
              "body": {
                "request_query": "mutation RESERVE($count: Int!) {\n  reserve(count: $count) {\n    ids\n    __typename\n  }\n}\n",
                "session_variables": {
                  "x-hasura-role": "admin"
                },
                "input": {
                  "count": 162
                },
                "action": {
                  "name": "reserve"
                }
              },
              "transformed_request": null,
              "url": "http://host.docker.internal:3006/api/reserved",
              "headers": [
                {
                  "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
                  "name": "X-Forwarded-User-Agent"
                },
                {
                  "value": "localhost:8080",
                  "name": "X-Forwarded-Host"
                },
                {
                  "value": "a8124b02-16de-4a86-a4ec-0fe8f479c06b",
                  "name": "x-request-id"
                }
              ]
            }
          },
          "path": "$",
          "code": "unexpected"
        },
        "message": "internal error"
      }
    ],
    "protocolErrors": [],
    "clientErrors": [],
    "networkError": null,
    "message": "internal error"
  }
]
  error : Error: Import error: internal error
Error: Import error: internal error
    at file:///home/runner/work/deeplinks/deeplinks/migrations/1664940577200-tsx.js:34:15
    at Generator.next (<anonymous>)
    at fulfilled (file:///home/runner/work/deeplinks/deeplinks/migrations/1664940577200-tsx.js:4:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Process completed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions