W
WindmillDavid Zhang

Postgres err: insufficient data left in message

I'm not sure how to approach debugging this issue For this query and inputs (in screenshot) I'm getting the error: ExecutionErr: error during execution of the script: db error: ERROR: insufficient data left in message
-- $1 user_guid
-- $2 network
-- $3 asset
-- $4 direction
-- $5 count_limit
-- $6 amount_limit
-- $7 amount_minimum
INSERT INTO stably.limit_user (
user_guid,
network,
asset,
direction,
count_limit,
amount_limit,
amount_minimum
)
VALUES (
$1::UUID,
$2::VARCHAR,
$3::VARCHAR,
$4::VARCHAR,
$5::INT,
$6::NUMERIC,
$7::NUMERIC
)
ON CONFLICT (user_guid, network, direction)
DO UPDATE SET
asset = EXCLUDED.asset,
direction = EXCLUDED.direction,
count_limit = EXCLUDED.count_limit,
amount_limit = EXCLUDED.amount_limit,
amount_minimum = EXCLUDED.amount_minimum;
-- $1 user_guid
-- $2 network
-- $3 asset
-- $4 direction
-- $5 count_limit
-- $6 amount_limit
-- $7 amount_minimum
INSERT INTO stably.limit_user (
user_guid,
network,
asset,
direction,
count_limit,
amount_limit,
amount_minimum
)
VALUES (
$1::UUID,
$2::VARCHAR,
$3::VARCHAR,
$4::VARCHAR,
$5::INT,
$6::NUMERIC,
$7::NUMERIC
)
ON CONFLICT (user_guid, network, direction)
DO UPDATE SET
asset = EXCLUDED.asset,
direction = EXCLUDED.direction,
count_limit = EXCLUDED.count_limit,
amount_limit = EXCLUDED.amount_limit,
amount_minimum = EXCLUDED.amount_minimum;
I've tried running this exact same query with the same arguments in another Postgres client (screenshot) but the query runs successfully. I've tried changing the casting syntax but there's too many permutations to try. Is there a way to get more context on the error somehow? There's nothing useful in the logs either
No description
No description
DZ
David Zhang41d ago
Here's a CREATE statement for anyone that wants to try to reproduce
CREATE TABLE
stably.limit_user (
user_guid uuid NOT NULL,
network character varying(50) NOT NULL,
asset character varying(50) NULL,
direction character varying(10) NOT NULL,
count_limit integer NULL,
amount_limit numeric(36, 18) NULL,
amount_minimum numeric(36, 18) NULL
);

ALTER TABLE
stably.limit_user
ADD
CONSTRAINT limit_user_pkey PRIMARY KEY (direction)
CREATE TABLE
stably.limit_user (
user_guid uuid NOT NULL,
network character varying(50) NOT NULL,
asset character varying(50) NULL,
direction character varying(10) NOT NULL,
count_limit integer NULL,
amount_limit numeric(36, 18) NULL,
amount_minimum numeric(36, 18) NULL
);

ALTER TABLE
stably.limit_user
ADD
CONSTRAINT limit_user_pkey PRIMARY KEY (direction)
R
rubenf40d ago
thanks, we will take a look @Hugo
HC
Hugo C.40d ago
Hi @David Zhang i've tried just now and it works as expected so i can't reproduce. The error comes from the db and it could indicate that invalid data was sent What postgres version are you using?
DZ
David Zhang40d ago
15.3 using AWS Aurora I tried running the query using a DB client against the exact same DB and it worked, so I'm not sure if it's related to the DB, is there any other info I can help provide?
DZ
David Zhang40d ago
Actually I can no longer reproduce, when I run it with the same args it succeeds now, maybe there's state in the frontend that was being kept?
No description
HC
Hugo C.40d ago
my guess is that an unsupported invisible character has been passed in the parameters (see https://stackoverflow.com/questions/28308418/postgres-org-postgresql-util-psqlexception-error-insufficient-data-left-in-me) anyway let us know if it happens again
Stack Overflow
Postgres: org.postgresql.util.PSQLException: ERROR: insufficient da...
I read enough to know that this occurs when a string contains some characters that Postgres doesn't like. However, I cannot figure out if there is a way to validate strings before writing them. In
DZ
David Zhang40d ago
Interesting, I used the same method of inputing the values, the only thing I can think of is that I modified the input GUI to use enums for some of the strings, maybe some behavior related to when the enums are created initially vs when they're loaded later? But I'm not sure, just a guess, will update here if I ever run into this again
HC
Hugo C.40d ago
Oh maybe, 👍 thanks
Want results from more Discord servers?
Add your server
More Posts
Connect to Slack on multiple workspacesFollowing the directions here: https://www.windmill.dev/docs/core_concepts/error_handling#workspace-Workflows as Code | WindmillWe are releasing in beta Workflow as code for Python and Typescript. No more excuse to use Airflow o@Alper was a mistake, made it private@Alper was a mistake, made it privateRunning a job from inside a flowI'm trying to start a job from within a flow, right before the approval stage. For example: Flow AChanging input data type for PostgreSQL scriptsCurrently everything is just text type for input, and I have to cast them in the query, is there a wwe will probably build one in windmillwe will probably build one in windmillWhich deno version is used by worker ?Recently the 3rd party api server has updated its min TLS version I am using axios to call their apiSuggestions on folder structure1. Is it important to get folder structure right in the beginning? Will it be a pain to re-organize Connection aborted with the large request bodywith the large request body, it will happen the "Connection aborted" ``` def writeAiResultDoc(data)Updating the app UI from within a running scriptIs there a way to broadcast information from within a running script that I could propagate to the UCode completion is disabled in workspace settingsIs that because it's an EE feature or did I screw up running lsp? I'm running this myself (mimickinClarification on https://github.com/windmill-labs/windmill-community-integrations/issues/2I am thinking about attempting this issue, but I don't feel that I'm getting the full picture. Can aHow can we use inline script to get source for a download button?I'd like to deliver a file via API on a press of download button, is it possible? Is download buttonGet a image from an apiHello, we download a image from an api. And we want to send this image in slack channel The script Hi, yes, I was figuring out how I did itHi, yes, I was figuring out how I did it. As far as I remember, I installed the tailscale on the hos(sadly, I broke some eggs with the(sadly, I broke some eggs with the change above, if you upgraded in the last 2 days and were using tYou would use perpetual scripts for thatYou would use perpetual scripts for thatI will write a blog post asap on it, butI will write a blog post asap on it, but this weekend we achieved a very cool property for a distribwmill sync push errorHi, I'm hitting some cryptic errors trying to promote changes made on a `staging` workspace to a `prVisual bug after update from .208 to .250 to modal form buttonsHello, after instance update all my modal forms became like this, is there a quick fix, I don't want