Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
vitalf03
Contributor III
Contributor III

PostgreSQL Error: state found as 'already active' while expected as 'inactive'

Hello.

I am performing a PostgreSQL ---> Oracle synchronization and it is returning the following error:

vitalf03_0-1696962483840.png

 

This task has only CDC configuration, when performing a "Reload Target" the table loaded successfully. subsequently, the task returned this error above, what should I do?

The task was performed correctly before, for many days.

Labels (1)
9 Replies
john_wang
Support
Support

Hello @vitalf03 ,

Thanks for reaching out to Qlik Community!

It's hard to tell this time from the error messages only. we'd like to suggest:

1. In source endpoint Properties --> Advanced --> enable "WAL heartbeat". The default Heartbeat frequency is 5 minutes

2. Please check the server side configuration, especially wal_sender_timeout , set it to 0 if possible to see if problem solved

3. If problem persists, please set SOURCE_CAPTURE to Verbose and reproduce the error, we'd like to check further again via support ticket (please do not upload the attachments here as it's public to all visitors).

Hope this helps.

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
JoshAtBeijer
Contributor II
Contributor II

We also encounter this error,

we have set wal_sender_timeout to 1h instead of 0 and enabled heartbeat but still encounter this error?
Did it get resolved for the owner of this post?


john_wang
Support
Support

Hello @JoshAtBeijer 

Thanks for following up.

This typically occurs when a logical replication slot is already in use — meaning there is an active replication connection using that slot — and another process or client attempts to use it simultaneously.

This may occurs if Replication client crashed or disconnected ungracefully, or multiple tasks are trying to use the same slot concurrently.

You may check the slot status while your current Replicate task is stopped:

SELECT * FROM pg_replication_slots WHERE slot_name = '<your_slot_name>';

Hope this helps.

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
JoshAtBeijer
Contributor II
Contributor II

What cause the logical replication slot to be already in use? How to solve the ground issue?
Right now we have one task replicating directly from PSQL as the source to MSSQL. If the MSSQL server, the destination have downtime, let say 30 minutes once every weekend or something I guess it could cause this issue? is that correct?


We have set max slots to 10 and we have two task from two different qlik replicate instances reading from same source, I belive both use different slot. We also have some other sources writing to this PSQL server. Is there any guide on how to replicate from PSQL with recommended configurations? Should a logstream also be used but I belive we get same or other issue when doing full loads.

john_wang
Support
Support

Hello @JoshAtBeijer ,

If you could run the SQL and let us know which programs are using the slot concurrently, it would help us better understand the issue.

thanks,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
JoshAtBeijer
Contributor II
Contributor II

uploaded it as CSV,

00006852: 2025-05-27T02:16:02:41767 [SOURCE_CAPTURE ]E: Slot 'p_db_dwh_to_db_c_00016384_848dc45c_fb9c_dc4e_b315_13f4188d0ab0' state found as 'already active' while expected as 'inactive'. [1020461] (postgres_endpoint_capture.c:352) 00006852: 2025-05-27T02:16:02:57373 [SOURCE_CAPTURE ]T: Error executing source loop [1020461] (streamcomponent.c:1945) 00006852: 2025-05-27T02:16:02:57373 [SOURCE_CAPTURE ]T: Stream component 'st_0_p_db_dwh' terminated [1020461] (subtask.c:1643) 00006852: 2025-05-27T02:16:02:57373 [SOURCE_CAPTURE ]T: Entering 'postgres_endpoint_free_imp' (postgres_endpoint_imp.c:1152) 00006972: 2025-05-27T02:16:02:57373 [TASK_MANAGER ]I: Task error notification received from subtask 0, thread 0, status 1020461 (replicationtask.c:3631) 00006852: 2025-05-27T02:16:02:57373 [SOURCE_CAPTURE ]E: Error executing source loop [1020461] (streamcomponent.c:1945) 00006852: 2025-05-27T02:16:02:57373 [TASK_MANAGER ]E: Stream component failed at subtask 0, component st_0_p_db_dwh [1020461] (subtask.c:1474) 00006852: 2025-05-27T02:16:02:57373 [SOURCE_CAPTURE ]E: Stream component 'st_0_p_db_dwh' terminated [1020461] (subtask.c:1643) 00006972: 2025-05-27T02:16:02:57373 [TASK_MANAGER ]W: Task 'p_db_dwh_to_db_ccm' encountered a fatal error (repository.c:6359)

john_wang
Support
Support

Hello @JoshAtBeijer ,

Thanks for the following up.

From the Excel file the slot status 'active' is 'FALSE', it indicates the task is stopped while the query is executing.

john_wang_0-1748616445419.png

How about if you startup the task in this scenario?

If the error persists, I'd like to suggest you opening a support ticket, Our support team will be more than happy to assist you.

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
JoshAtBeijer
Contributor II
Contributor II

We usally get this message if we try to start it, this is from another day and to temporary solve it then we have to do a full load.

Spoiler
00002236: 2025-04-25T12:59:42 [SOURCE_CAPTURE ]E: Failure in sending START_REPLICATION command "START_REPLICATION SLOT "p_db_dwh_to_db_c_00016384_848dc45c_fb9c_dc4e_b315_13f4188d0ab0" LOGICAL 00000040/02CD84A0 ("include-timestamp" 'on')": ERROR: can no longer get changes from replication slot "p_db_dwh_to_db_c_00016384_848dc45c_fb9c_dc4e_b315_13f4188d0ab0" DETAIL: This slot has been invalidated because it exceeded the maximum reserved size. [1] (postgres_endpoint_wal_engine.c:567) 00002236: 2025-04-25T12:59:42 [SOURCE_CAPTURE ]I: End of CDC / CAPTURE events for POSTGRES endpoint. (postgres_endpoint_capture.c:557) 00002236: 2025-04-25T12:59:42 [SOURCE_CAPTURE ]I: CAPTURE ended with exceptions. (postgres_endpoint_capture.c:564) 00002236: 2025-04-25T12:59:42 [SOURCE_CAPTURE ]E: WAL stream loop ended abnormally. (STATUS_PROTOCOL_ERROR) [1020452] (postgres_endpoint_wal_engine.c:1485) 00002236: 2025-04-25T12:59:42 [SOURCE_CAPTURE ]E: WAL reader terminated with irrecoverable error. [1020452] (postgres_endpoint_capture.c:532) 00004328: 2025-04-25T12:59:42 [TASK_MANAGER ]I: Task error notification received from subtask 0, thread 0, status 1020452 (replicationtask.c:3631) 00002236: 2025-04-25T12:59:42 [SOURCE_CAPTURE ]E: Error executing source loop [1020452] (streamcomponent.c:1945) 00002236: 2025-04-25T12:59:42 [TASK_MANAGER ]E: Stream component failed at subtask 0, component st_0_p_db_dwh [1020452] (subtask.c:1474) 00002236: 2025-04-25T12:59:42 [SOURCE_CAPTURE ]E: Stream component 'st_0_p_db_dwh' terminated [1020452] (subtask.c:1643) 00004328: 2025-04-25T12:59:42 [TASK_MANAGER ]W: Task 'p_db_dwh_to_db_ccm' encountered a fatal error (repository.c:6359)

 I can create a support task and then referer to this post.

john_wang
Support
Support

Thank you for your support @JoshAtBeijer !

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!