You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the COPY command references a non existent table whilst attempting to process a CSV file posted by the form component, SQLPage produces an error and stops responding to further requests and needs to be restarted.
To Reproduce
The following code invokes the error:
-- temporary table 'csv_tmp'
create temporary table if not exists csv_tmp(csv text);
delete from csv_tmp;
-- the copy command below will fail as the temporary table 'csv_tmp_1' does not exist (it should be 'csv_tmp')
-- this triggers a SQL/SQLPage error; it appears that when the COPY command triggers an error of any sort SQLPage process stops responding
copy csv_tmp_1 (csv) from 'recon_csv_file_input' DELIMITER '*' CSV;
Actual behavior
A standard SQLPage error is produced and displayed.
When clicking on or selecting another link within SQLPage the process is no longer reachable.
The act of requesting another page (after the COPY error) causes the process to panic and stop responding.
2025-01-24 05:03:28 thread 'actix-rt|system:0|arbiter:2' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-core-oldapi-0.6.38/src/postgres/message/data_row.rs:23:20: 2025-01-24 05:03:28 index out of bounds: the len is 1 but the index is 1
The SQLPage instance then needs to be restarted.
Screenshots
Attached.
Expected behavior
SQLPage should continue to respond as it does with any other error.
Version information
OS: MacOS Sequoia 15.2
Database: PostgreSQL 16.4
SQLPage Version: v0.32.1
Both SQLPage and PostgreSQL running as docker containers
grodger
changed the title
SQLPage process stops responding after executing a COPY command that error - thread 'actix-rt|system:0|arbiter:2' panicked at ...
SQLPage process stops responding after executing a COPY command that errors - thread 'actix-rt|system:0|arbiter:2' panicked at ...
Jan 24, 2025
In the meantime, you should be able to work around the problem by closing the connection after the error from on_reset.sql, to prevent a subsequent select to occur on the corrupted connection.
## on_reset.sql
You can also use this script to close database connections that are in an undesirable state, such as being in a transaction that was left open. To close a connection, write a select statement that returns a single row with a single boolean column named is_healthy, and set it to false.
In the meantime, you should be able to work around the problem by closing the connection after the error from on_reset.sql, to prevent a subsequent select to occur on the corrupted connection.
## on_reset.sql
You can also use this script to close database connections that are in an undesirable state, such as being in a transaction that was left open. To close a connection, write a select statement that returns a single row with a single boolean column named is_healthy, and set it to false.
Introduction
When the COPY command references a non existent table whilst attempting to process a CSV file posted by the form component, SQLPage produces an error and stops responding to further requests and needs to be restarted.
To Reproduce
Actual behavior
A standard SQLPage error is produced and displayed.
When clicking on or selecting another link within SQLPage the process is no longer reachable.
The act of requesting another page (after the COPY error) causes the process to panic and stop responding.
2025-01-24 05:03:28 thread 'actix-rt|system:0|arbiter:2' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-core-oldapi-0.6.38/src/postgres/message/data_row.rs:23:20: 2025-01-24 05:03:28 index out of bounds: the len is 1 but the index is 1
The SQLPage instance then needs to be restarted.
Screenshots
Attached.
Expected behavior
SQLPage should continue to respond as it does with any other error.
Version information
Additional context
SQLPagePanic.log
The text was updated successfully, but these errors were encountered: