ERROR: cache lookup for userid 26 failed

Started by Vilson fariasalmost 25 years ago8 messagesgeneral
Jump to latest
#1Vilson farias
vilson.farias@digitro.com.br

Greetings,

Does anyone know what is this error?

ERROR: cache lookup for userid 26 failed

Some system tables are inacessible in my database but I can access others. I tried to check pg_tables, but it's blocked :

persona=> select * from pg_tables;
ERROR: cache lookup for userid 26 failed
persona=>

The table pg_class tells me that I'm the user of the table (me, postgres user), but always I get this msg. What can be done to kick it out?

persona=> select * from pg_class
persona-> ;
relname | reltype | relowner | relam | relpages | reltuples | rell
ongrelid | relhasindex | relisshared | relkind | relnatts | relchecks | reltriggers | reluk
eys | relfkeys | relrefs | relhaspkey | relhasrules | relacl
---------------------------------+---------+----------+-------+----------+-----------+-----
---------+-------------+-------------+---------+----------+-----------+-------------+------
----+----------+---------+------------+-------------+--------
pg_type | 71 | 26 | 0 | 2 | 122 |
0 | t | f | r | 16 | 0 | 0 |
0 | 0 | 0 | f | f |
pg_attribute | 75 | 26 | 0 | 6 | 461 |
0 | t | f | r | 15 | 0 | 0 |
0 | 0 | 0 | f | f |
pg_proc | 81 | 26 | 0 | 26 | 1083 |
0 | t | f | r | 16 | 0 | 0 |
0 | 0 | 0 | f | f |

tele_fidel_hierarq | 0 | 26 | 0 | 176 | 6592 |
0 | t | f | r | 7 | 0 | 1 |
0 | 0 | 0 | f | f |
tipo_atendimento | 0 | 26 | 0 | 10 | 1000 |
0 | t | f | r | 3 | 0 | 2 |
0 | 0 | 0 | f | f |
(69 rows)

My linux users are ok. Postgres has 26 as user_id.

[postgres@bxsgalena postgres]$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
...
postgres:x:26:26:PostgreSQL Server:/home/postgres:/bin/bash

[postgres@bxsgalena postgres]$ cat /etc/group
root:x:0:root
...
postgres:x:26:

The database was working very well, but I don't know what was done to it, because another guy did the last maintenance.

That's all for now. Thanks in advance and my best regards!

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Vilson farias (#1)
Re: ERROR: cache lookup for userid 26 failed

"Vilson farias" <vilson.farias@digitro.com.br> writes:

Does anyone know what is this error?
ERROR: cache lookup for userid 26 failed

Evidently pg_shadow has no entry with usesysid 26. Add it back...

regards, tom lane

#3Vilson farias
vilson.farias@digitro.com.br
In reply to: Vilson farias (#1)
Still getting problems with -cache lookup for userid 26 failed-

How do you mean, Tom?

"Vilson farias" <vilson.farias@digitro.com.br> writes:

Does anyone know what is this error?
ERROR: cache lookup for userid 26 failed

Evidently pg_shadow has no entry with usesysid 26. Add it back...

regards, tom lane

I dont have a pg_shadow file, I use a passwd file instead. Inside passwd there is only one line :
postgres:LtOj6bwu7TF7k

My pg_hba.conf :
local all trust
host all 127.0.0.1 255.255.255.255 trust
host all 192.168.160.0 255.255.255.0 password passwd
host all 192.168.162.0 255.255.255.0 password passwd

My /etc/passwd :
postgres:x:26:26:PostgreSQL Server:/home/postgres:/bin/bash

My /etc/group
postgres:x:26:

And if this is a passwd (pg_shadow) error, why can I access some tables and other not?

persona=> select * from pg_class
persona-> ;
relname | reltype | relowner | relam | relpages | reltuples | rell
ongrelid | relhasindex | relisshared | relkind | relnatts | relchecks | reltriggers | reluk
eys | relfkeys | relrefs | relhaspkey | relhasrules | relacl
---------------------------------+---------+----------+-------+----------+-----------+-----
---------+-------------+-------------+---------+----------+-----------+-------------+------
----+----------+---------+------------+-------------+--------
pg_type | 71 | 26 | 0 | 2 | 122 |
0 | t | f | r | 16 | 0 | 0 |
0 | 0 | 0 | f | f |
pg_attribute | 75 | 26 | 0 | 6 | 461 |
0 | t | f | r | 15 | 0 | 0 |
0 | 0 | 0 | f | f |
pg_proc | 81 | 26 | 0 | 26 | 1083 |
0 | t | f | r | 16 | 0 | 0 |
0 | 0 | 0 | f | f |

tele_fidel_hierarq | 0 | 26 | 0 | 176 | 6592 |
0 | t | f | r | 7 | 0 | 1 |
0 | 0 | 0 | f | f |
tipo_atendimento | 0 | 26 | 0 | 10 | 1000 |
0 | t | f | r | 3 | 0 | 2 |
0 | 0 | 0 | f | f |
(69 rows)

Regards,

Jos� Vilson de Mello de Farias
D�gitro Tecnologia Ltda - Brazil

----- Original Message -----
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vilson farias <vilson.farias@digitro.com.br>
Cc: <pgsql-general@postgresql.org>
Sent: Segunda-feira, 18 de Junho de 2001 16:57
Subject: Re: [GENERAL] ERROR: cache lookup for userid 26 failed

#4Vilson farias
vilson.farias@digitro.com.br
In reply to: Vilson farias (#1)
Re: Still getting problems with -cache lookup for userid 26 failed- (PART 2)

Sorry, I do have a pg_shadow file, but it's empty.

I have a pg_pwd too with this text inside :
[postgres@bxsgalena data]$ cat pg_pwd
postgres 0 x x x x 1 \N

What is it used for? I couldn't find info about this file in html docs. I have another postgre installed here and in that machine (working very well) pg_pwd is empty.

Regards.

Show quoted text

How do you mean, Tom?

"Vilson farias" <vilson.farias@digitro.com.br> writes:

Does anyone know what is this error?
ERROR: cache lookup for userid 26 failed

Evidently pg_shadow has no entry with usesysid 26. Add it back...

regards, tom lane

I dont have a pg_shadow file, I use a passwd file instead. Inside passwd there is only one line :
postgres:LtOj6bwu7TF7k

My pg_hba.conf :
local all trust
host all 127.0.0.1 255.255.255.255 trust
host all 192.168.160.0 255.255.255.0 password passwd
host all 192.168.162.0 255.255.255.0 password passwd

My /etc/passwd :
postgres:x:26:26:PostgreSQL Server:/home/postgres:/bin/bash

My /etc/group
postgres:x:26:

And if this is a passwd (pg_shadow) error, why can I access some tables and other not?

persona=> select * from pg_class
persona-> ;
relname | reltype | relowner | relam | relpages | reltuples | rell
ongrelid | relhasindex | relisshared | relkind | relnatts | relchecks | reltriggers | reluk
eys | relfkeys | relrefs | relhaspkey | relhasrules | relacl
---------------------------------+---------+----------+-------+----------+-----------+-----
---------+-------------+-------------+---------+----------+-----------+-------------+------
----+----------+---------+------------+-------------+--------
pg_type | 71 | 26 | 0 | 2 | 122 |
0 | t | f | r | 16 | 0 | 0 |
0 | 0 | 0 | f | f |
pg_attribute | 75 | 26 | 0 | 6 | 461 |
0 | t | f | r | 15 | 0 | 0 |
0 | 0 | 0 | f | f |
pg_proc | 81 | 26 | 0 | 26 | 1083 |
0 | t | f | r | 16 | 0 | 0 |
0 | 0 | 0 | f | f |

tele_fidel_hierarq | 0 | 26 | 0 | 176 | 6592 |
0 | t | f | r | 7 | 0 | 1 |
0 | 0 | 0 | f | f |
tipo_atendimento | 0 | 26 | 0 | 10 | 1000 |
0 | t | f | r | 3 | 0 | 2 |
0 | 0 | 0 | f | f |
(69 rows)

Regards,

Jos� Vilson de Mello de Farias
D�gitro Tecnologia Ltda - Brazil

----- Original Message -----
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vilson farias <vilson.farias@digitro.com.br>
Cc: <pgsql-general@postgresql.org>
Sent: Segunda-feira, 18 de Junho de 2001 16:57
Subject: Re: [GENERAL] ERROR: cache lookup for userid 26 failed

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Vilson farias (#3)
Re: Still getting problems with -cache lookup for userid 26 failed-

"Vilson farias" <vilson.farias@digitro.com.br> writes:

Evidently pg_shadow has no entry with usesysid 26. Add it back...

I dont have a pg_shadow file, I use a passwd file instead.

Yes, you do have a pg_shadow table. If you think you can have PG users
who aren't listed in pg_shadow, you've just found out differently.

regards, tom lane

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Vilson farias (#4)
Re: Re: Still getting problems with -cache lookup for userid 26 failed- (PART 2)

"Vilson farias" <vilson.farias@digitro.com.br> writes:

I have a pg_pwd too with this text inside :
[postgres@bxsgalena data]$ cat pg_pwd
postgres 0 x x x x 1 \N

What is it used for?

pg_pwd is a plain-ASCII dump of the pg_shadow table. It's used by the
postmaster (since the postmaster can't read database tables by itself).
AFAIR it's only used if you specify password auth based on the pg_shadow
password.

However, you need to have pg_shadow entries for all your PG users
regardless of what your connection authorization setup may be.
relowner and so forth are supposed to be references to pg_shadow rows.

regards, tom lane

#7Vilson farias
vilson.farias@digitro.com.br
In reply to: Vilson farias (#1)
Re: Re: Still getting problems with -cache lookup for userid 26 failed- (PART 2)

Greetings again,

I'm still getting problems, could you give me some more info about how can I change pg_shadow?

persona=> insert into pg_shadow values('postgres', 26, 't', 't', 't', 't', '', NULL);
ERROR: pg_shadow: Permission denied.

persona=> select * from pg_shadow;
ERROR: pg_shadow: Permission denied.

persona=> select * from pg_user;
ERROR: cache lookup for userid 26 failed

persona=> alter user postgres CREATEUSER;
ERROR: ALTER USER: permission denied

After all that errors, I killed postmaster and started a single postgres process, with -O activated and still nothing.

[postgres@bxsgalena postgres]$ postgres -d $PGDATA -O persona
010619.15:47:26.088 [0] DEBUG: Data Base System is starting up at Tue Jun 19 15:47:26 2001
010619.15:47:26.088 [0] DEBUG: Data Base System was interrupted being in production at Tue Jun 19 15:46:46 2001
010619.15:47:26.110 [0] DEBUG: Data Base System is in production state at Tue Jun 19 15:47:26 2001

POSTGRES backend interactive interface
$Revision: 1.155.2.1 $ $Date: 2000/08/30 21:19:32 $

backend> select * from pg_shadow
010619.15:47:42.213 [0] ERROR: pg_shadow: Permission denied.
010619.15:47:42.213 [0] ERROR: pg_shadow: Permission denied.
backend>

Regards,

Jos� Vilson de Mello de Farias
D�gitro Tecnologia Ltda - Brazil

----- Original Message -----
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vilson farias <vilson.farias@digitro.com.br>
Cc: <pgsql-general@postgresql.org>
Sent: Ter�a-feira, 19 de Junho de 2001 12:48
Subject: Re: [GENERAL] Re: Still getting problems with -cache lookup for userid 26 failed- (PART 2)

Show quoted text

"Vilson farias" <vilson.farias@digitro.com.br> writes:

I have a pg_pwd too with this text inside :
[postgres@bxsgalena data]$ cat pg_pwd
postgres 0 x x x x 1 \N

What is it used for?

pg_pwd is a plain-ASCII dump of the pg_shadow table. It's used by the
postmaster (since the postmaster can't read database tables by itself).
AFAIR it's only used if you specify password auth based on the pg_shadow
password.

However, you need to have pg_shadow entries for all your PG users
regardless of what your connection authorization setup may be.
relowner and so forth are supposed to be references to pg_shadow rows.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

#8Vilson farias
vilson.farias@digitro.com.br
In reply to: Vilson farias (#1)
Cache lookup problems dont go away

Greetings again,

I'm still getting problems, could you give me some more info about how can I change pg_shadow? I tried lots of ways and nothing works, because it seens to be unaccessible.

persona=> insert into pg_shadow values('postgres', 26, 't', 't', 't', 't', '', NULL);
ERROR: pg_shadow: Permission denied.

persona=> select * from pg_shadow;
ERROR: pg_shadow: Permission denied.

persona=> select * from pg_user;
ERROR: cache lookup for userid 26 failed

persona=> alter user postgres CREATEUSER;
ERROR: ALTER USER: permission denied

After all that errors, I killed postmaster and started a single postgres process, with -O activated and still nothing.

[postgres@bxsgalena postgres]$ postgres -d $PGDATA -O persona
010619.15:47:26.088 [0] DEBUG: Data Base System is starting up at Tue Jun 19 15:47:26 2001
010619.15:47:26.088 [0] DEBUG: Data Base System was interrupted being in production at Tue Jun 19 5:46:46 2001
010619.15:47:26.110 [0] DEBUG: Data Base System is in production state at Tue Jun 19 15:47:26 2001

POSTGRES backend interactive interface

$Revision: 1.155.2.1 $ $Date: 2000/08/30 21:19:32 $

backend> select * from pg_shadow
010619.15:47:42.213 [0] ERROR: pg_shadow: Permission denied.
010619.15:47:42.213 [0] ERROR: pg_shadow: Permission denied.
backend>

Regards,

Jos� Vilson de Mello de Farias
D�gitro Tecnologia Ltda - Brazil

Show quoted text

----- Original Message -----
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vilson farias <vilson.farias@digitro.com.br>
Cc: <pgsql-general@postgresql.org>
Sent: Ter�a-feira, 19 de Junho de 2001 12:48
Subject: Re: [GENERAL] Re: Still getting problems with -cache lookup for userid 26 failed- (PART 2)

"Vilson farias" <vilson.farias@digitro.com.br> writes:

I have a pg_pwd too with this text inside :
[postgres@bxsgalena data]$ cat pg_pwd
postgres 0 x x x x 1 \N

What is it used for?

pg_pwd is a plain-ASCII dump of the pg_shadow table. It's used by the
postmaster (since the postmaster can't read database tables by itself).
AFAIR it's only used if you specify password auth based on the pg_shadow
password.

However, you need to have pg_shadow entries for all your PG users
regardless of what your connection authorization setup may be.
relowner and so forth are supposed to be references to pg_shadow rows.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly