AnatolyUss / nmig

NMIG is a database migration tool, written in Node.js and highly inspired by FromMySqlToPostgreSql.
GNU General Public License v3.0
451 stars 83 forks source link

error: canceling statement due to statement timeout #108

Open bradley-varol opened 1 year ago

bradley-varol commented 1 year ago

I am receiving this error when migrating a table containing ~6 million records. I also see the following error when migrating a table with ~40k records that contains a BLOB column.

Any obvious reason i'm seeing a timeout and the error below?

    --[NMIG loadData] Loading the data into "public"."waveforms" table...
    --[populateTableWorker] error: canceling statement due to statement timeout

    SQL: COPY "public"."waveforms" FROM STDIN DELIMITER ',' CSV;

    --[populateTableWorker] Error loading table data:
SELECT `id` AS `id`,`track_id` AS `track_id`,HEX(`array`) AS `array` FROM `waveforms`;
/Users/bradleyvarol/Desktop/nmig/node_modules/pg-copy-streams/copy-from.js:120
    this.connection.stream.write(lenBuffer)
                    ^

TypeError: Cannot read properties of null (reading 'stream')
    at CopyStreamQuery.flushChunk (/Users/bradleyvarol/Desktop/nmig/node_modules/pg-copy-streams/copy-from.js:120:21)
    at CopyStreamQuery.flush (/Users/bradleyvarol/Desktop/nmig/node_modules/pg-copy-streams/copy-from.js:101:17)
    at CopyStreamQuery._writev (/Users/bradleyvarol/Desktop/nmig/node_modules/pg-copy-streams/copy-from.js:57:19)
    at doWrite (node:internal/streams/writable:409:12)
    at clearBuffer (node:internal/streams/writable:564:5)
    at onwrite (node:internal/streams/writable:464:7)
    at Object.onceWrapper (node:events:627:28)
    at Socket.emit (node:events:513:28)
    at afterWrite (node:internal/streams/writable:495:12)
    at onwrite (node:internal/streams/writable:480:7)

Node.js v18.15.0

    --[NMIG runLoaderProcess] For now inserted: 0 rows
    --[NMIG runLoaderProcess] Total rows to insert into "public"."waveforms": 0