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

Indexer crashing with invalid byte sequence for encoding UTF8 0x00 #446

Open
razgraf opened this issue Feb 4, 2025 · 0 comments
Open

Indexer crashing with invalid byte sequence for encoding UTF8 0x00 #446

razgraf opened this issue Feb 4, 2025 · 0 comments

Comments

@razgraf
Copy link

razgraf commented Feb 4, 2025

Bug Description

While trying to parse an event with string parameters, the indexer crashes with:

{
 "type": "PostgresError",
 "message": "invalid byte sequence for encoding  \"UTF8\": 0x00" 
}

Upon further investigation it looks like parameters of type string are extracted from events and padded with \x00 bytes which cannot be written to the database.

Image

The even in question is printing this struct from 0xd116c275541cdbe7594a202bd6ae4dbca4578462 on Sepolia.

Possible Fix

As temporary fix, we introduced a sanitization step before assigning the value of the event parameters to entities. By removing all the special characters (myString.replace(/\x00/g, "")) one can clean up the input prior to it reaching the database.

To Reproduce

The error can be reproduced in previous versions of @sablier/subgraphs by removing the sanitization step here.

Environment

The crash happens both locally and on the hosted environment.

Local:

  • Envio version: 2.12.3
  • Node version: 22.12.0
  • pnpm version: 9.12.3
  • Docker version: Client (27.4.0), Desktop (4.37.2)

Hosted Service:

  • Envio version: 2.12.3 (happening on earlier versions too)
  • Link to the deployed indexer: Older versions of sablier-labs/lockup-envio (production deployment here)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant