mvniekerk / tokio-cron-scheduler

Schedule tasks on Tokio using cron-like annotation
Apache License 2.0
529 stars 59 forks source link

missing whitespace in PostgreSQL query when updating ticks #42

Closed grottohub closed 1 year ago

grottohub commented 1 year ago

I encountered this issue when adding a Postgres metadata store to my cronjobs. I'm using postgres:15.1 as a base for my Dockerfile.

via runtime logs:

[2023-02-13 11:09:39][tokio_cron_scheduler::postgres::metadata_store][ERROR] Error updating next and last tick Error { kind: Db, cause: Some(DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E42601), message: "trailing junk after parameter at or near \"$2W\"", detail: None, hint: None, position: Some(Original(40)), where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("scan.l"), line: Some(1188), routine: Some("scanner_yyerror") }) }
[2023-02-13 11:09:39][tokio_cron_scheduler::scheduler][ERROR] Could not set next and last tick UpdateJobData

via container logs:

database-1  | 2023-02-13 19:09:39.924 UTC [1867] ERROR:  trailing junk after parameter at or near "$2W" at character 40
database-1  | 2023-02-13 19:09:39.924 UTC [1867] STATEMENT:  UPDATE job SET next_tick=$1, last_tick=$2WHERE id = $3

tested adding the whitespace to a local fork and it fixed the issue