cytadela8
cytadela8•12mo ago

Postgresql job crashing native worker

I believe I managed to accidently create a postgresql job/script that crashes the windmill native workers. I think its due to the select returning quite big numbers. I'm getting this log in my worker:
thread 'tokio-runtime-worker' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/rust_decimal-1.32.0/src/str.rs:30:15:

called `Result::unwrap()` on an `Err` value: CapacityError: insufficient capacity

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tokio-runtime-worker' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/rust_decimal-1.32.0/src/str.rs:30:15:

called `Result::unwrap()` on an `Err` value: CapacityError: insufficient capacity

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Other SQLs work fine
4 Replies
rubenf
rubenf•12mo ago
can you convert it to a string and show the number ::TEXT to cast it
cytadela8
cytadela8•12mo ago
Probably, the numberic returned is: numeric(200,100) Just one thing, how do I now cancel those jobs 😆 nevermind I think I found it in "runs" tab This is the output of SQL with ::text:
[
{
"v": "0.8972893123623996450000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"v": "18496191.0938273558472515010000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"v": "0.0000010072129479590000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"v": "5785.9894851029402240710000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"v": "89.5859188649154960020000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"v": "5207.1010952374697528700000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
]
[
{
"v": "0.8972893123623996450000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"v": "18496191.0938273558472515010000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"v": "0.0000010072129479590000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"v": "5785.9894851029402240710000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"v": "89.5859188649154960020000000000000000000000000000000000000000000000000000000000000000000000000000000000"
},
{
"v": "5207.1010952374697528700000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
]
Without ::text the job freezes and native worker containers restart
rubenf
rubenf•12mo ago
Interesting, that's enough for us to reproduce it thanks for the report. We have a bit of backlog for customers first but when we have a cycle free we will fix it
cytadela8
cytadela8•12mo ago
OK, thanks for the quick workaround 🙂