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

syntax error with kv_store plugin.publickeys #52

Open
headyj opened this issue Feb 6, 2024 · 4 comments
Open

syntax error with kv_store plugin.publickeys #52

headyj opened this issue Feb 6, 2024 · 4 comments

Comments

@headyj
Copy link

headyj commented Feb 6, 2024

Hello,

I'm trying to migrate from SQLite to Postgres using this tool, but I have the following error:

INFO[2024-02-06T11:49:48+01:00] ✅ hex-encoded data values wrapped for insertion 
FATAL[2024-02-06T12:56:45+01:00] ❌ pq: syntax error at or near ")" INSERT INTO "kv_store" VALUES(22,0,'plugin.publickeys','key-********',replace(replace('-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nVersion: OpenPGP.js v4.10.1\r\nComment: https://openpgpjs.org*********==\r\n=DNbR\r\n-----END PGP PUBLIC KEY BLOCK-----\r\n','\r',char(13)),'\n',chr(10)),'2023-08-28 07:39:10','2023-08-28 07:39:20.062750226+00:00') - failed to import dump file to Postgres. 

I checked the dump done by the tool, and it seems that there's in fact a syntax error at this line

I think in theory I could just remove this entry but I guess the tool is doing some other logic and not only loading the sql file into postgres as I have an error at Grafana startup if I just remove this line from the sql and import the rest manually using psql:

grafana Error: ✗ Datasource provisioning error: pq: invalid input syntax for type integer: "false"

I'm using the latest version of the tool with Grafana v10.3.1 on Kubernetes v1.27 (AWS)

@simplyrahul1
Copy link

+1 I'm also facing this issue .. anybody able be resolve it?

@IgorOhrimenko
Copy link

This code #47 fix the problem.

@maximdogonov
Copy link

+1 I'm also facing this issue

@wbh1
Copy link
Owner

wbh1 commented Aug 22, 2024

I've merged #47 mentioned by @IgorOhrimenko and created a new release: https://github.com/wbh1/grafana-sqlite-to-postgres/releases/tag/v2.2.5

Please let me know if that works for you :)

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

5 participants