IQSS / dataverse-docker

Dataverse 6.2 on Docker with integrated services called "Archive in a box" and could be used both as demo and production system and easily integrated with other services.
57 stars 45 forks source link

Internal Server Error - (dataverse column "uri" does not exist) #18

Closed HasanKhatib closed 5 years ago

HasanKhatib commented 5 years ago

After adding a new version of dataverse.war to dataverse-docker/dataversedock/dv/deps and re-run the image, I get this error:

Internal Server Error - An unexpected error was encountered, no more information is available.

Screenshot from 2019-05-11 07-33-09

From the glassfish logs, the problem is with a missing database column

Local Exception Stack: 
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: ERROR: column "requestor_id" does not exist
  Position: 65
Error Code: 0
Call: SELECT ID, EMAILED, OBJECTID, READNOTIFICATION, SENDDATE, TYPE, REQUESTOR_ID, USER_ID FROM USERNOTIFICATION WHERE (USER_ID = ?) ORDER BY SENDDATE DESC
    bind => [1 parameter bound]
Query: ReadAllQuery(referenceClass=UserNotification sql="SELECT ID, EMAILED, OBJECTID, READNOTIFICATION, SENDDATE, TYPE, REQUESTOR_ID, USER_ID FROM USERNOTIFICATION WHERE (USER_ID = ?) ORDER BY SENDDATE DESC")

I tried the solution stated in Troubleshooting page from the dataverse guide, but it seems that the dbUser don't has permission to perform this solution in the docker instance.

ERROR: must be owner of relation datasetfieldtype

pdurbin commented 5 years ago

@HasanKhatib hi! I'm not sure what your immediate goals are but if you would like to play around with the latest version of Dataverse (4.14 came out yesterday) you could try cloning the main "dataverse" repo an following this README: https://github.com/IQSS/dataverse/tree/v4.14/conf/docker-aio . If you have any trouble with this, please open an issue over in the main "dataverse" repo. Thanks!

If your goal is to continue with dataverse-docker and you want to run a newer version of Dataverse, I would suggest opening an issue about this in this repo. (To add "requestor_id", "uri" and other columns added in 4.10 one would need to run https://github.com/IQSS/dataverse/blob/v4.14/scripts/database/upgrades/upgrade_v4.9.4_to_v4.10.sql but in more recent versions, we have switched to Flyway.)

pdurbin commented 5 years ago

We switched to Flyway in Dataverse 4.12.

For 4.11 and older to have to follow instructions in release notes for each version and database migrations are not automated: http://guides.dataverse.org/en/4.11/installation/upgrading.html

Once you get to 4.12, Flyway will take care of database migrations (but you should still follow other parts of release notes, of course): http://guides.dataverse.org/en/4.12/installation/upgrading.html

4tikhonov commented 5 years ago

Hi @HasanKhatib, you're welcome to create pull request if you've managed to update dataverse-docker repo to the latest version.

poikilotherm commented 5 years ago

And if you are feeling lucky and want to go to an all new Kubernetes adventure park, you might take a look at https://github.com/IQSS/dataverse-kubernetes. :wink:

Will upload new images containing 4.14 within the next hours...

4tikhonov commented 5 years ago

Hi @poikilotherm, please let me know after you'll manage to update Docker images, I want to use them also for our multilingual DataverseEU instance.

poikilotherm commented 5 years ago

@4tikhonov new tagged images are online :smile:

HasanKhatib commented 5 years ago

To solve this issue I went the solution provided by @mheppler

## use the db container /bin/bash to perform theses commands:
sudo psql -U dvnapp -d dvndb -c "ALTER TABLE datasetfieldtype ADD COLUMN uri text;"
sudo psql -U dvnapp -d dvndb -c "ALTER TABLE metadatablock ADD COLUMN namespaceuri text;"

Thanks @poikilotherm, of course I will :+1: