graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

Event Trigger does not work after CLI Metadata & Migrate Initialization

Open chris-hasura opened this issue 3 years ago • 4 comments

Version Information

Server Version: v2.8.0 CLI Version (for CLI related issue): v2.8.0

Environment

Local MacOS (Intel)

What is the expected behaviour?

Event trigger should work after using CLI:

hasura metadata apply
hasura migrate apply
hasura metadata apply

The insert event trigger should fire when a record is inserted into the related table.

Keywords

event trigger metadata migration

What is the current behaviour?

The event trigger is created, but the event trigger (insert) does not fire when a record is inserted.

This may be related to #8376

How to reproduce the issue?

Please see the instructions in this repo

Screenshots or Screencast

See repo above

Please provide any traces or logs that could help here.

Running the example in the repo above will create logs that could help

Any possible solutions?

The following steps fix the problem and create a working event trigger

hasura metadata apply
hasura migrate apply
hasura metadata clear
hasura metadata apply

Can you identify the location in the source code where the problem exists?

No

If the bug is confirmed, would you be willing to submit a PR?

N/A

chris-hasura avatar Jun 24 '22 13:06 chris-hasura

Same bug exists on 2.8.4 & 2.10.0. This is a severe issue since makes cli-migrations-v3 image kind of useless when having triggers set.

ilijaNL avatar Aug 16 '22 11:08 ilijaNL

I'm having the same error with hasura/graphql-engine:v2.8.4.cli-migrations-v3 Docker image. It's a severe issue because triggers are not created on startup

ilbertt avatar Aug 27 '22 14:08 ilbertt

The bug applies to versions > 2.8 Have tried all versions from 2.9.1 -> 2.11.1 and all exhibit the same behaviour.

The workaround mentioned above does work, but I needed to add a hasura metadata reload command as well in order for metadata to be consistent.

malsharman avatar Sep 09 '22 02:09 malsharman

Thanks for reporting the issue. We're actively working on a fix and this will be resolved soon.

pranshi06 avatar Oct 17 '22 05:10 pranshi06

Closed via 8dab7df16924a5c3bf28f90c392752638942e5b3

pranshi06 avatar Dec 13 '22 08:12 pranshi06