​pg_basebackup: could not send replication command “START_REPLICATION”: ERROR: replication slot “SOME_NAME” does not exist

Categorías:

Buenas,

El error que se muestra a continuación es un error que se presentó en Postgresql versión 10. El error indica que no existe un slot con ese nombre, por tanto el sistema continúa con la replicación y luego que termina de pasar todos los datos genera un error de code 1.

 

[root@repanalitica ~]# date; pg_basebackup -h 192.168.10.235 -U repuser -X stream -S replica1 -v -R -W -D /var/lib/pgsql/10/data ; date
Password: 
pg_basebackup: initiating base backup, waiting for checkpoint to complete
pg_basebackup: checkpoint completed
pg_basebackup: write-ahead log start point: 17454/AB000028 on timeline 1
pg_basebackup: starting background WAL receiver
pg_basebackup: could not send replication command "START_REPLICATION": ERROR:  replication slot "replica1" does not exist
pg_basebackup: write-ahead log end point: 1745C/37BC8CA8
pg_basebackup: waiting for background process to finish streaming ...
pg_basebackup: child process exited with exit code 1
pg_basebackup: removing data directory "/var/lib/pgsql/10/data"
Fri Aug 25 00:02:42 -05 2023
[root@repanalitica ~]#

Por tanto, si ocurre este mensaje de error, es mejor suprimir la opción -S y dejar el comando se la siguiente forma

 

[root@repanalitica 10]# date; pg_basebackup -h 192.168.10.235 -U repuser -X stream  -v -R -W -D /var/lib/pgsql/10/data ; date
Tue Aug 29 18:49:59 -05 2023
Password: 
pg_basebackup: initiating base backup, waiting for checkpoint to complete
pg_basebackup: checkpoint completed
pg_basebackup: write-ahead log start point: 175B4/BE000060 on timeline 1
pg_basebackup: starting background WAL receiver
pg_basebackup: write-ahead log end point: 175DC/71D14BC0
pg_basebackup: waiting for background process to finish streaming ...
pg_basebackup: base backup completed
Wed Aug 30 03:55:31 -05 2023
[root@repanalitica 10]#

Como se puede apreciar, el comando se ejecutó de forma exitosa y se replicaron 1.8 Tb de datos. Por eso el tiempo de inicio marca 18:49 y el tiempo de fin marca 03:55

Eso es todo por hoy.