Problem with database: FATAL 1: cannot find attribute 24 of relation

Started by Tauren Millsover 24 years ago9 messagesgeneral
Jump to latest
#1Tauren Mills
tauren@servlets.net

Sorry for cross-posting this to both admin and general. I first posted to
admin, but as I'm desperate here and there is more activity in the general
list, I'm now posting it here as well.

---

Help!

One of my customers is having a problem with their database causing all of
their sites to be down right now. The problem seems to effect only their
database, not any other databases on the server. Here is the output when
connecting to it:

[root@s1 data]# psql -U postgres dans_pgsql
Password:
Asql: FATAL 1: cannot find attribute 24 of relation

I've searched the email archives as well as deja.com, but cannot find this
error message mentioned anywhere. Does anyone know what it means? I've
tried restarting postgres. Can anyone help suggest what I can do to get
this database working again?

I have backups of all raw files on the server, but the customer has not done
a dump of their database recently. I rather doubt that restoring their
database from tape would replace it in a consistent state. Any thoughts on
this as well?

One more thing...

The vacuum command is giving the same error:

[root@s1 data]# vacuumdb -v -U postgres dans_pgsql
Password:
Asql: FATAL 1: cannot find attribute 24 of relation
vacuumdb: vacuum dans_pgsql failed

Is there another way to fix a corrupt database (assuming that is what the
problem here is)?

Thanks,
Tauren

#2Justin Clift
justin@postgresql.org
In reply to: Tauren Mills (#1)
Re: Problem with database: FATAL 1: cannot find attribute 24

Hi Tauren,

Have you found the solution for this yet?

It really sounds like part of your customer's database has been deleted
or gone missing.

Which version of PostgreSQL are you using, and which operating system is
it on?

:-)

Regards and best wishes,

Justin Clift

Tauren Mills wrote:

Sorry for cross-posting this to both admin and general. I first posted to
admin, but as I'm desperate here and there is more activity in the general
list, I'm now posting it here as well.

---

Help!

One of my customers is having a problem with their database causing all of
their sites to be down right now. The problem seems to effect only their
database, not any other databases on the server. Here is the output when
connecting to it:

[root@s1 data]# psql -U postgres dans_pgsql
Password:
Asql: FATAL 1: cannot find attribute 24 of relation

I've searched the email archives as well as deja.com, but cannot find this
error message mentioned anywhere. Does anyone know what it means? I've
tried restarting postgres. Can anyone help suggest what I can do to get
this database working again?

I have backups of all raw files on the server, but the customer has not done
a dump of their database recently. I rather doubt that restoring their
database from tape would replace it in a consistent state. Any thoughts on
this as well?

One more thing...

The vacuum command is giving the same error:

[root@s1 data]# vacuumdb -v -U postgres dans_pgsql
Password:
Asql: FATAL 1: cannot find attribute 24 of relation
vacuumdb: vacuum dans_pgsql failed

Is there another way to fix a corrupt database (assuming that is what the
problem here is)?

Thanks,
Tauren

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

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi

#3Tauren Mills
tauren@servlets.net
In reply to: Justin Clift (#2)
Re: Problem with database: FATAL 1: cannot find attribute 24

Hi Justin,

Thanks for the reply. Unfortunately, I still haven't solved the problem,
but do have slightly more info now.

We are getting this error message whenever we try to connect using psql, the
\c command in psql, the pg_dump command, the vacuum command, or the JDBC
driver:

FATAL 1: cannot find attribute 24 of relation ^MA

I'm wondering if the database somehow got a table or some relation named ^MA
(or rather, carriage-return, capital A) that is causing the postgresql
backend to choke.
The only place that I see this error message issued is in
src/backend/utils/cache/relcache.c.

Do you mean that one of the raw database files would have been deleted? My
customer has no access to that directory and I really don't think that I did
anything to it. Or do you mean something else?

Any suggestions you have would be very appreciated!

Thanks,
Tauren

Show quoted text

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org]On Behalf Of Justin Clift
Sent: Sunday, September 16, 2001 3:31 AM
To: Tauren Mills; PostgreSQL General Mailing List
Subject: Re: [GENERAL] Problem with database: FATAL 1: cannot find
attribute 24

Hi Tauren,

Have you found the solution for this yet?

It really sounds like part of your customer's database has been deleted
or gone missing.

Which version of PostgreSQL are you using, and which operating system is
it on?

:-)

Regards and best wishes,

Justin Clift

Tauren Mills wrote:

Sorry for cross-posting this to both admin and general. I

first posted to

admin, but as I'm desperate here and there is more activity in

the general

list, I'm now posting it here as well.

---

Help!

One of my customers is having a problem with their database

causing all of

their sites to be down right now. The problem seems to effect

only their

database, not any other databases on the server. Here is the

output when

connecting to it:

[root@s1 data]# psql -U postgres dans_pgsql
Password:
Asql: FATAL 1: cannot find attribute 24 of relation

I've searched the email archives as well as deja.com, but

cannot find this

error message mentioned anywhere. Does anyone know what it means? I've
tried restarting postgres. Can anyone help suggest what I can do to get
this database working again?

I have backups of all raw files on the server, but the customer

has not done

a dump of their database recently. I rather doubt that restoring their
database from tape would replace it in a consistent state. Any

thoughts on

this as well?

One more thing...

The vacuum command is giving the same error:

[root@s1 data]# vacuumdb -v -U postgres dans_pgsql
Password:
Asql: FATAL 1: cannot find attribute 24 of relation
vacuumdb: vacuum dans_pgsql failed

Is there another way to fix a corrupt database (assuming that

is what the

problem here is)?

Thanks,
Tauren

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

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

#4Martijn van Oosterhout
kleptog@svana.org
In reply to: Tauren Mills (#3)
Re: Problem with database: FATAL 1: cannot find attribute 24

On Sun, Sep 16, 2001 at 08:23:57PM -0700, Tauren Mills wrote:

We are getting this error message whenever we try to connect using psql, the
\c command in psql, the pg_dump command, the vacuum command, or the JDBC
driver:

FATAL 1: cannot find attribute 24 of relation ^MA

Looks like corruption.

An idea. Kill off the postmaster, then start postgres directly from the
command line (I beleive it's just ./postgres [dbname]). That should get you
in because i think it's one of the queries psql sends on startup that fouls
up.

Anyway, once you have a prompt, type:

select * from pg_class;

and

select * from pg_attribute where attnum = 24;

Look for corruption and other strange data.

HTH,
--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/

Show quoted text

Magnetism, electricity and motion are like a three-for-two special offer:
if you have two of them, the third one comes free.

#5Tauren Mills
tauren@servlets.net
In reply to: Martijn van Oosterhout (#4)
Re: Problem with database: FATAL 1: cannot find attribute 24

Thanks for the assistance! Unfortunately, I still can't get in the way you
suggest. I wasn't able to start postgres by simply typing "postgres
[dbname]", but here is what I did do. First, I stop PostgreSQL (installed
from an RPM):

[root@s1 init.d]# /etc/rc.d/init.d/postgresql stop
$Stoping postgresql service: [ OK ]

Then, I su to the postgres user:

[root@s1 init.d]# su - postgres

Then, I try running postgres like this:

bash$ postgres -d 5 -D /var/lib/pgsql/data dans_pgsql
invoking IpcMemoryCreate(size=1015808)
DEBUG: database system was shut down at 2001-09-17 11:22:37 PDT
DEBUG: CheckPoint record at (0, 305239168)
DEBUG: Redo record at (0, 305239168); Undo record at (0, 0); Shutdown TRUE
DEBUG: NextTransactionId: 3285885; NextOid: 498209
DEBUG: database system is in production state
FindExec: searching PATH ...
ValidateBinary: can't stat "/bin/postgres"
FindExec: found "/usr/bin/postgres" using PATH
DEBUG: connection: host=(null) user=postgres database=dans_pgsql
DEBUG: InitPostgres
AATAL 1: cannot find attribute 24 of relation
DEBUG: proc_exit(1)
DEBUG: shmem_exit(1)
DEBUG: shutting down
DEBUG: database system is shut down
DEBUG: exit(1)
bash$ exit

Any more suggetions?

Thanks again!
Tauren

Show quoted text

-----Original Message-----
From: Martijn van Oosterhout [mailto:kleptog@svana.org]
Sent: Sunday, September 16, 2001 9:07 PM
To: Tauren Mills
Cc: Justin Clift; PostgreSQL General Mailing List
Subject: Re: [GENERAL] Problem with database: FATAL 1: cannot find
attribute 24

On Sun, Sep 16, 2001 at 08:23:57PM -0700, Tauren Mills wrote:

We are getting this error message whenever we try to connect

using psql, the

\c command in psql, the pg_dump command, the vacuum command, or the JDBC
driver:

FATAL 1: cannot find attribute 24 of relation ^MA

Looks like corruption.

An idea. Kill off the postmaster, then start postgres directly from the
command line (I beleive it's just ./postgres [dbname]). That
should get you
in because i think it's one of the queries psql sends on startup
that fouls
up.

Anyway, once you have a prompt, type:

select * from pg_class;

and

select * from pg_attribute where attnum = 24;

Look for corruption and other strange data.

HTH,
--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/

Magnetism, electricity and motion are like a three-for-two

special offer:

if you have two of them, the third one comes free.

#6Tauren Mills
tauren@servlets.net
In reply to: Martijn van Oosterhout (#4)
Re: Problem with database: FATAL 1: cannot find attribute 24

One more thing...

I'm running version 7.1.2 installed from RPM on a Red Hat 6.2 server.

Tauren

Show quoted text

-----Original Message-----
From: Martijn van Oosterhout [mailto:kleptog@svana.org]
Sent: Sunday, September 16, 2001 9:07 PM
To: Tauren Mills
Cc: Justin Clift; PostgreSQL General Mailing List
Subject: Re: [GENERAL] Problem with database: FATAL 1: cannot find
attribute 24

On Sun, Sep 16, 2001 at 08:23:57PM -0700, Tauren Mills wrote:

We are getting this error message whenever we try to connect

using psql, the

\c command in psql, the pg_dump command, the vacuum command, or the JDBC
driver:

FATAL 1: cannot find attribute 24 of relation ^MA

Looks like corruption.

An idea. Kill off the postmaster, then start postgres directly from the
command line (I beleive it's just ./postgres [dbname]). That
should get you
in because i think it's one of the queries psql sends on startup
that fouls
up.

Anyway, once you have a prompt, type:

select * from pg_class;

and

select * from pg_attribute where attnum = 24;

Look for corruption and other strange data.

HTH,
--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/

Magnetism, electricity and motion are like a three-for-two

special offer:

if you have two of them, the third one comes free.

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tauren Mills (#5)
Re: Problem with database: FATAL 1: cannot find attribute 24

"Tauren Mills" <tauren@servlets.net> writes:

Then, I try running postgres like this:
bash$ postgres -d 5 -D /var/lib/pgsql/data dans_pgsql
AATAL 1: cannot find attribute 24 of relation

Since there aren't any system catalogs with as many as 24 columns, the
problem is clearly a level or two down from where the error is being
reported. Try running that standalone backend under gdb with a
breakpoint set at elog, and get a stack trace when the error is reached.
(Note that each of the "debug" messages also goes through elog, so the
first elog entry is not the one you want.)

You might have to recompile with debugging symbols enabled to get any
useful information from gdb.

regards, tom lane

#8Tauren Mills
tauren@servlets.net
In reply to: Tom Lane (#7)
Re: Problem with database: FATAL 1: cannot find attribute 24

Hi Tom,

Thanks for the help! I'm afraid I do not know how to do this. Is there
somewhere that specifically explains how to run a standalone backend under
gdb? How would I set a breakpoint at elog or get a stack trace? Does the
RPM version of Postgres include debugging symbols, or would I need to
compile a separate version?

Thanks!
Tauren

Show quoted text

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Monday, September 17, 2001 1:35 PM
To: Tauren Mills
Cc: Martijn van Oosterhout; Justin Clift; PostgreSQL General Mailing
List
Subject: Re: [GENERAL] Problem with database: FATAL 1: cannot find
attribute 24

"Tauren Mills" <tauren@servlets.net> writes:

Then, I try running postgres like this:
bash$ postgres -d 5 -D /var/lib/pgsql/data dans_pgsql
AATAL 1: cannot find attribute 24 of relation

Since there aren't any system catalogs with as many as 24 columns, the
problem is clearly a level or two down from where the error is being
reported. Try running that standalone backend under gdb with a
breakpoint set at elog, and get a stack trace when the error is reached.
(Note that each of the "debug" messages also goes through elog, so the
first elog entry is not the one you want.)

You might have to recompile with debugging symbols enabled to get any
useful information from gdb.

regards, tom lane

#9Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tauren Mills (#8)
Re: Problem with database: FATAL 1: cannot find attribute 24

"Tauren Mills" <tauren@servlets.net> writes:

Thanks for the help! I'm afraid I do not know how to do this. Is there
somewhere that specifically explains how to run a standalone backend under
gdb? How would I set a breakpoint at elog or get a stack trace?

You should look at the gdb documentation, but running a standalone
backend under gdb isn't hard:

gdb path-to-postgres-executable

gdb> break elog
gdb> run command-line-arguments-for-standalone-backend
...
... break at elog
...
gdb> bt (backtrace)
gdb> cont (continue till next breakpoint)

gdb> quit (when done)

Does the RPM version of Postgres include debugging symbols,

Not sure, but I doubt it. If you don't see a symbolic backtrace
including routine names and argument values, then you haven't got
debugging symbols. In particular, if you can't see the string
being passed to elog then you'll have trouble telling which breakpoint
stop is the interesting one ...

regards, tom lane