irods-contrib / metalnx-web

Metalnx Web Application
https://metalnx.github.io/
BSD 3-Clause "New" or "Revised" License
36 stars 36 forks source link

Adding metadata does not work #337

Closed mpuskaric closed 1 year ago

mpuskaric commented 1 year ago

Hello,

A test setup with iRODS 4.3.0 and Metalnx 2.6.0, each running on a separate VM (Ubuntu 20.04), currently does not allow adding metadata over Metalnx GUI. The message states: "Metadata already exists.", although there is no metadata added

Metalnx log [2022-12-11 16:48:28] [info] 2022-12-11 16:48:28 ERROR MetadataServiceImpl:226 - Error trying to add metadata: org.irods.jargon.core.exception.JargonException: error code received from iRODS:-15000

iRODS log {"log_category":"legacy","log_facility":"local0","log_level":"info","log_message":"rsApiHandler: unpackStruct error for apiNumber 706, status = -15000","request_api_name":"MOD_AVU_METADATA_AN","request_api_number":706,"request_api_version":"d","request_client_user":"rods","request_host":"193.196.54.47","request_proxy_user":"rods","request_release_version":"rods3.2","server_host":"irods","server_pid":189246,"server_timestamp":"2022-12-11T16:54:51.123Z","server_type":"agent"}

iRODS -15000 Error states irods error: -15000 SYS_PACK_INSTRUCT_FORMAT_ERR

adding metadata using imeta works fine. ICAT is hosted on a separate VM. The Metalnx is compiled and deployed on a tomcat v9, so it's not running inside a container. IRODS-EXT is hosted on the same VM as the Metalnx. I also tried with the containerized deployment, but the issue is still there. Other functions such as user administration, uploading metadata templates or data works.

Postgres for the IRODS-EXT (PostgreSQL 12.12) shows the following:

2022-12-11 17:08:20.574 UTC [91785] irods@IRODS-EXT ERROR:  column t1.tgconstrname does not exist at character 113
2022-12-11 17:08:20.574 UTC [91785] irods@IRODS-EXT STATEMENT:  SELECT DISTINCT NULL::text as pnspname, NULL::text as fnspname, c1.relname as prelname, c2.relname as frelname, t1.tgconstrname, a.attnum as keyseq, ic.relname as fkeyname, t1.tgdeferrable, t1.tginitdeferred, t1.tgnargs,t1.tgargs, p1.proname as updaterule, p2.proname as deleterule  FROM pg_class c1  JOIN pg_index i ON (c1.oid=i.indrelid)  JOIN pg_class ic ON (i.indexrelid=ic.oid)  JOIN pg_attribute a ON (ic.oid=a.attrelid),  pg_class c2,  pg_trigger t1  JOIN pg_proc p1 ON (t1.tgfoid=p1.oid),  pg_trigger t2  JOIN pg_proc p2 ON (t2.tgfoid=p2.oid) WHERE (t1.tgrelid=c1.oid AND t1.tgisconstraint AND t1.tgconstrrelid=c2.oid AND p1.proname ~ '^RI_FKey_.*_upd$') AND (t2.tgrelid=c1.oid AND t2.tgisconstraint AND t2.tgconstrrelid=c2.oid AND p2.proname ~ '^RI_FKey_.*_del$') AND i.indisprimary AND c2.relname='metadata_fields' ORDER BY prelname,keyseq

Could this be somehow related with the already reported issue https://github.com/irods-contrib/metalnx-web/issues/197 ?

Thanks

alanking commented 1 year ago

I think you are right in saying that #197 is the same issue. It has been avoided up til now by pinning our postgres version to 11, it seems (https://github.com/irods-contrib/metalnx-web/issues/197#issuecomment-781671652). I was unable to find any claims about postgres dependency versions in this repo, but 12 seems to be too new for our current implementation.

I will defer to @trel or @korydraughn as to how to proceed.

mpuskaric commented 1 year ago

thanks for this. In the meantime, I was able to fix this by following[1], so the error does not appear anymore. However, the issue with adding metadata through Metalnx still exists.

[1] https://github.com/irods-contrib/metalnx-web/issues/197#issuecomment-781671652

korydraughn commented 1 year ago

I was unable to find any claims about postgres dependency versions in this repo, but 12 seems to be too new for our current implementation.

I doubt Metalnx declares a dependency on a specific version of Postgres. However, as mentioned in #197, removing the extra database should resolve the problem.

As for the metadata issue, we'll investigate and get a fix in as soon as we can.

mpuskaric commented 1 year ago

Just a short update, I tested the same Metalnx setup against iRODS 4.2.10 and adding metadata works fine.

trel commented 1 year ago

oh! that's new information - thanks.

JustinKyleJames commented 1 year ago

Added pull request DICE-UNC/jargon#417 in Jargon to fix this.