这是indexloc提供的服务,不要输入任何密码
Skip to content

Event trigger fails with error: payload decode failed while fetching MSSQL events #9293

@ccalvarez

Description

@ccalvarez

Version Information

Server Version: 2.16.0
CLI Version (for CLI related issue): not CLI related

Environment

OSS

What is the current behaviour?

We have a Hasura instance connected to a Microsoft SQL Server 2016 (MSSQL) database configured with Modern_Spanish_CI_AS collation.

In this databases we have tables which contain Spanish characters (á, é, í, ñ...).

We created an Event Trigger that listens to updates on one of those tables. When the updated row contains one of those special characters, the trigger returns this message, doesn't execute the webhook, and stays in Pending status:

{"detail":{"code":"unexpected","error":"payload decode failed while fetching MSSQL events","path":"$"},"level":"error","timestamp":"2022-12-12T16:30:31.406+0000","type":"event-trigger"}

If we remove all the Spanish characters, delete all the SQL Server tables under hdb_catalog schema, and retry updating a row, the event trigger executes successfully, and changes to Delivered status; so we are sure that the special characters are causing the issue.

What is the expected behaviour?

The event trigger executes the configured webhook without errors, and change to Delivered status.

How to reproduce the issue?

  1. Create a MSSQL database with Modern_Spanish_CI_AS collation
  2. Create a table with some varchar(n) columns
  3. Populate the table with strings that contain Spanish characters (á, é, í, ó, ú, ñ, Ñ)
  4. In Hasura, create an Event Trigger that listens to updates on any column of the table
  5. Update the column value

Screenshots or Screencast

image

image

image

Please provide any traces or logs that could help here.

Any possible solutions/workarounds you're aware of?

The error is raised in this sentence:

encodePayload payload =
      onLeft
        (J.eitherDecode payload)
        (\_ -> throw500 $ T.pack "payload decode failed while fetching MSSQL events")

The line of code is:

There is a related issue in which it seems that a similar bug was solved in the release 2.5.0:

#8747

Keywords

MSSQL, event trigger, payload decode

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions