irods-contrib / metalnx-web

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

Export CSV from Metadata search omits the first row #319

Closed hanytran closed 1 year ago

hanytran commented 1 year ago

Hi, I'm not sure if this issue has been reported somewhere else. The csv file doesn't have the first row of the search result in metadata search. My solution was changing 1 to 0 in line 227 of file MetadataController.java. It seems this makes exporting start from 1 instead of 0. Please let me know if that's a good fix.

https://github.com/irods-contrib/metalnx-web/blob/main/src/metalnx-web/src/main/java/com/emc/metalnx/controller/MetadataController.java

trel commented 1 year ago

Appears to have last been touched in https://github.com/irods-contrib/metalnx-web/commit/d6727bf066aa5cc502a8f1abcb45ee8fa816cb7d as part of related/similar fix/discussion of https://github.com/irods-contrib/metalnx-web/issues/195

But we didn't touch the 1.

trel commented 1 year ago

Can you share an example search result set, both the metalnx view and the associated csv download?

hanytran commented 1 year ago

Here you are.

Screenshot from 2022-09-01 15-36-40

Screenshot from 2022-09-01 15-37-15

trel commented 1 year ago

Very good - thanks.

hanytran commented 1 year ago

And this is after fixed.

Screenshot from 2022-09-01 15-44-50

korydraughn commented 1 year ago

Based on the images, it looks like you're running an old version of Metalnx.

I could not reproduce this issue in Metalnx v2.5.0 or v2.6.0. Please try upgrading to one of those versions and let us know how it goes.

hanytran commented 1 year ago

Hi, are you using iRODS 4.3? Because I could not find the docker image for 4.3, I'm using iRODS 4.2.5 and this version doesn't work with Metalnx 2.5 or 2.6 in metadata search function (I didn't debug yet), so I downgraded to 2.4 and it works. Besides, I installed the Python Rule Engine to automatically extract metadata from uploaded files. I will check it again when I'm back to work and let you know.

BTW do we already have a Dockerfile for iRODS 4.3?

korydraughn commented 1 year ago

If you want to run iRODS 4.3.0 for experimental purposes, you can do that through the testing environment here:

That repository is what we use to quickly stand up various versions of iRODS in various ways. It contains several docker files and docker compose projects. Below is the link to the projects directory where the docker files are stored:

I'd recommend using the python scripts as documented on the README to experiment with iRODS 4.3.0 first. Once you've done that, you can take what you've learned and apply it to a production deployment.

@alanking gave a talk about the development environment and testing environment at this year's UGM. You can watch the video here:

korydraughn commented 1 year ago

There's also the development environment. That repo contains docker files for compiling and running iRODS too. However, the focus of that repo is for development and so it is not as easy/automated as the testing environment. See the README for more details.

Again, the YouTube video I mentioned in the previous comment covers both repos.

hanytran commented 1 year ago

Thanks for the hints, I will check them all.

hanytran commented 1 year ago

@korydraughn, in metadata search, have you ever met the error when there are files having common attributes and owned by 2 different users. Once one of them tries to search, no results return because it failed at getting permission in MetadataService of metalnx. Error message: "Could not get permissions for current user: unable to find file under path" iCommand in docker container is working just fine. Screenshot from 2022-09-06 10-22-35

korydraughn commented 1 year ago

I have not seen that before. Please create a new issue and we'll investigate it.

hanytran commented 1 year ago

Could you reproduce that error or just because of my setup?

korydraughn commented 1 year ago

Without looking into things further, my guess is you don't have permission to read the parent collection of the data object.

Given that I've verified that later versions of Metalnx correctly export the search results and downgrading works for you, I'm going to close this issue.