Forum OpenACS Q&A: File storage/CR anomaly after upgrade.

We have an instance of OACS/.LRN at UC3M which was recently upgraded to OACS 5.3 and PostgreSQL 8.1 (was 7.4).

Everything seemed to work fine, but now two anomalies surfaced when handling files in the file-storage.

* When deleting a version of a file, it complains that there is no such function content_revision__del(integer). When connecting to the DB with psql, the function appears as defined, I'm even able to execute the query to delete a revision by typing "select content_revision__del(22332)". There is no way to delete a versin.

* When deleting a file (not a version), it shows the message:
ERROR: Referential Integrity: attempting to delete live_revision: 333640

We have a second instance that although from a different starting point (different OACS and PSQL versions) was upgraded to the same version as this first instance and the anomaly does not appear.

Any clue about where to start looking would be deeply appreciated.

Regards.

Collapse
Posted by Patrick Giagnocavo on
Hi Abelardo

Were you able to verify that the PG8.1 postgresql.conf has the compatibility options that OACS needs?

I think that these are the missing options needed, that are not present in the default PG8.1 config:

add_missing_from = on
default_with_oids = on
regex_flavor = extended

Collapse
Posted by Abelardo Pardo on
Patrick.

Yes, I checked and those options are in place.

Thanks for the lead.

Collapse
Posted by Gustaf Neumann on
Abelardo,

let us try to do this stepwise. You said:

* When deleting a version of a file, it complains that there is no such function content_revision__del(integer). When connecting to the DB with psql, the function appears as defined, I'm even able to execute the query to delete a revision by typing "select content_revision__del(22332)". There is no way to delete a versin.

Are you sure, you are connecting from your openacs installation and from psql to the same database of the same postgres installation (i assume, you have a postgres 7.4 and a postgres 8.1 installation)?

Collapse
Posted by Abelardo Pardo on
Gustaf,

You were right. I had both PgSQL 7.4 and 8.1 running in parallel and the psql client connected to the wrong database. I had to add a -p :port: to make sure I talked to the right server and the right path to make sure the psql client was chosen correctly (I have both executables but only one of them in my path). I am now connected to the 8.1 server with the 8.1.9 psql client.

After connecting to the right database, I see that the function that appears in the exception (content__revision_del(integer)) is not defined or at least it doesn't appear when typing:

psql> \df content_revision__del

In the second instance running out of the same server, but with a different database, the function content_revision__del does appear when \df is executed in the psql client.

If I manually source the file where such function is defined (acs-content-repository/sql/postgresql/content-revision.sql) the operation is then performed with no exception.

The second anomaly though, deleting a file instead of a revision is still appearing with the same message:

"ERROR: Referential Integrity: attempting to delete live_revision: 347357

The acs-content-repository.info shows version 5.3.2.

Collapse
Posted by Dave Bauer on
This was fixed in an upgrade way back in 5.2

http://cvs.openacs.org/cvs/openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.2.0b9-5.2.0b10.sql?rev=1.2&view=log

You need to make sure your content_item__del unsets live and latest revision.

Collapse
Posted by Abelardo Pardo on
Dave.

You were right. I found the glitch. It was related to the upgrade scripts that were not executed properly. I executed them and the anomaly went away.

Thanks.