Thread: Error "public.powa_take_snapshot()" in PostgreSQL

Error "public.powa_take_snapshot()" in PostgreSQL

From
Pablo Delgado
Date:
I am observing this error in the log of my PostgreSQL 12:

2023-10-07 16:03:06 UTC:LOG:  POWA connected to database powa
2023-10-07 16:03:06 UTC:ERROR:  query returned more than one row
2023-10-07 16:03:06 UTC:HINT:  Make sure the query returns a single row, or use LIMIT 1.
2023-10-07 16:03:06 UTC:CONTEXT:  PL/pgSQL function powa_take_snapshot(integer) line 31 at SQL statement
        SQL statement "SELECT public.powa_take_snapshot()"
2023-10-07 16:03:06 UTC:LOG:  background worker "powa" (PID 34049) exited with exit code 1


This error prevents me from doing a pg_basebackup of my DB.

--
Un saludo, 

Pablo Delgado Flores
DBA Oracle · Desarrollador WordPress · Sysadmin

Re: Error "public.powa_take_snapshot()" in PostgreSQL

From
Ninad Shah
Date:
Hi Pablo,

This is not a PG in-built function. It seems like a user-defined one. You may need to troubleshoot the function.


Thanks,
Ninad



On Mon, Oct 9, 2023 at 4:01 PM Pablo Delgado <pabloj.df@gmail.com> wrote:
I am observing this error in the log of my PostgreSQL 12:

2023-10-07 16:03:06 UTC:LOG:  POWA connected to database powa
2023-10-07 16:03:06 UTC:ERROR:  query returned more than one row
2023-10-07 16:03:06 UTC:HINT:  Make sure the query returns a single row, or use LIMIT 1.
2023-10-07 16:03:06 UTC:CONTEXT:  PL/pgSQL function powa_take_snapshot(integer) line 31 at SQL statement
        SQL statement "SELECT public.powa_take_snapshot()"
2023-10-07 16:03:06 UTC:LOG:  background worker "powa" (PID 34049) exited with exit code 1


This error prevents me from doing a pg_basebackup of my DB.

--
Un saludo, 

Pablo Delgado Flores
DBA Oracle · Desarrollador WordPress · Sysadmin

Re: Error "public.powa_take_snapshot()" in PostgreSQL

From
Julien Rouhaud
Date:
Hi,

On Sat, Oct 07, 2023 at 11:54:15PM +0200, Pablo Delgado wrote:
> I am observing this error in the log of my PostgreSQL 12:
>
> 2023-10-07 16:03:06 UTC:LOG:  POWA connected to database powa
> 2023-10-07 16:03:06 UTC:ERROR:  query returned more than one row
> 2023-10-07 16:03:06 UTC:HINT:  Make sure the query returns a single row, or
> use LIMIT 1.
> 2023-10-07 16:03:06 UTC:CONTEXT:  PL/pgSQL function
> powa_take_snapshot(integer) line 31 at SQL statement
>         SQL statement "SELECT public.powa_take_snapshot()"
> 2023-10-07 16:03:06 UTC:LOG:  background worker "powa" (PID 34049) exited
> with exit code 1
>
> This error prevents me from doing a pg_basebackup of my DB.

For the archives sake, the same problem was also directly reported on the powa
bug tracker.  It turns out that there has apparently been some data corruption,
as there were 2 records having the same primary key.  Removing one of those
(and also updating the extension to ensure compatibility with other stat
extensions) fixed the problem.