Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection not working with iRODS 4.2.2 #27

Closed
emedernach opened this issue Dec 12, 2017 · 9 comments
Closed

Collection not working with iRODS 4.2.2 #27

emedernach opened this issue Dec 12, 2017 · 9 comments
Milestone

Comments

@emedernach
Copy link

Hello,

We have upgraded to the latest iRODS version 4.2.2 and we now have problems with collections in metalnx. The collection link loops on itself and we have these errors on irods logs:

Dec 12 10:54:28 pid:14474 NOTICE: SQL Error message: [MySQL][ODBC 5.2(w) Driver][mysqld-5.5.56-MariaDB]You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ON USER_GROUP_MAIN.user_id = R_USER_GROUP.group_user_id JOIN R_OBJT_ACCESS ON R_' at line 1
Dec 12 10:54:28 pid:14474 NOTICE: chlSpecificQuery cmlGetFirstRowFromSql failure -806000
Dec 12 10:54:28 pid:14474 NOTICE: _rsSpecificQuery: specificQuery status = -806000
Dec 12 10:54:28 pid:14474 NOTICE: rsSpecificQuery: rcSpecificQuery failed, status = -806000

@michael-conway
Copy link
Contributor

michael-conway commented Dec 12, 2017 via email

@emedernach
Copy link
Author

Ok, Thanks for your explanations.

@sgworth
Copy link
Contributor

sgworth commented Dec 12, 2017 via email

@michael-conway
Copy link
Contributor

michael-conway commented Dec 12, 2017 via email

@sgworth
Copy link
Contributor

sgworth commented Dec 12, 2017 via email

@michael-conway
Copy link
Contributor

michael-conway commented Dec 12, 2017 via email

@emedernach
Copy link
Author

I checked the content of mysql.properties file and it seems correct.

Here is the SQL query resulting in an error:

SELECT R_USER_MAIN.user_name, R_USER_MAIN.user_id, R_OBJT_ACCESS.access_type_id, R_USER_MAIN.user_type_name, R_USER_MAIN.zone_name, R_COLL_MAIN.coll_name,
 USER_GROUP_MAIN.user_name, R_COLL_MAIN.coll_name
FROM R_USER_MAIN AS USER_GROUP_MAIN JOIN R_USER_GROUP
 JOIN R_USER_MAIN ON R_USER_GROUP.user_id = R_USER_MAIN.user_id
                  ON USER_GROUP_MAIN.user_id = R_USER_GROUP.group_user_id
 JOIN R_OBJT_ACCESS ON R_USER_GROUP.group_user_id = R_OBJT_ACCESS.user_id
 JOIN R_COLL_MAIN ON R_OBJT_ACCESS.object_id = R_COLL_MAIN.coll_id
WHERE R_COLL_MAIN.coll_name = ? AND R_USER_MAIN.user_name = ? 
ORDER BY R_COLL_MAIN.coll_name, R_USER_MAIN.user_name, _OBJT_ACCESS.access_type_id DESC ;

The error is at the 2nd 'ON' for the R_USER_MAIN join.

@michael-conway
Copy link
Contributor

Hey @emedernach I suspect we're mixing up two different database access services. One is the metalnx database itself, which as @sgworth points out goes through hibernate, and the database properties etc can switch dialects between postres and mysql. The other database is the actual iRODS iCAT database. That's what 'specific query' does, it is a direct issuance of SQL queries against that iRODS iCAT, not through hibernate, but through the iRODS protocol.

The statement above is a select against the iRODS iCAT, not metalnx. If you are going against mysql or maria it may be a syntax error between the different database flavors. That's what I ran into and started working on a way to have a different set of specific queries for the different iCAT dbs. Those queries are built here https://github.com/Metalnx/metalnx-web/blob/master/src/emc-metalnx-services/src/main/java/com/emc/metalnx/services/irods/CollectionServiceImpl.java

So that's what I had started to do over in the DICE-UNC code fork, add a client hints capability to ask iRODS what flavor of iCAT it was using and be able to get different flavors of specific query for each target database. So perhaps that query can just be tuned in the code in that one place for maria and you'd be done, but I'm hoping longer term to just memorialze any variances in a MySQL versus Postgres specific query service and select them via a factory method based on the target iCAT.

I -think- that's the issue here. Cheers MC

michael-conway pushed a commit that referenced this issue Jan 29, 2018
michael-conway added a commit that referenced this issue Jan 29, 2018
michael-conway pushed a commit that referenced this issue Jan 29, 2018
michael-conway pushed a commit that referenced this issue Jan 29, 2018
michael-conway pushed a commit that referenced this issue Jan 29, 2018
michael-conway pushed a commit that referenced this issue Jan 29, 2018
michael-conway pushed a commit that referenced this issue Jan 29, 2018
michael-conway pushed a commit that referenced this issue Jan 29, 2018
michael-conway pushed a commit that referenced this issue Jan 29, 2018
michael-conway pushed a commit that referenced this issue Jan 29, 2018
michael-conway pushed a commit that referenced this issue Jan 29, 2018
michael-conway pushed a commit that referenced this issue Jan 29, 2018
michael-conway pushed a commit that referenced this issue Jan 29, 2018
michael-conway pushed a commit that referenced this issue Jan 29, 2018
michael-conway pushed a commit that referenced this issue Jan 29, 2018
michael-conway pushed a commit that referenced this issue Jan 30, 2018
michael-conway pushed a commit that referenced this issue Jan 30, 2018
michael-conway pushed a commit that referenced this issue Jan 31, 2018
michael-conway pushed a commit that referenced this issue Feb 2, 2018
michael-conway pushed a commit that referenced this issue Feb 2, 2018
michael-conway pushed a commit that referenced this issue Feb 2, 2018
michael-conway pushed a commit that referenced this issue Feb 2, 2018
michael-conway pushed a commit that referenced this issue Feb 2, 2018
@michael-conway
Copy link
Contributor

Closing for now. NB the master now has a SpecificQueryProvider https://github.com/irods-contrib/metalnx-web/blob/master/src/emc-metalnx-services/src/main/java/com/emc/metalnx/services/irods/utils/SpecificQueryProvider.java that can be extended to allow pluggable specific query support for databases other than Postgres. The default postgres provider is implemented.

@trel trel added this to the 2.0.0 milestone Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants