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

[#5286] Add explicit rule engine instance to irule invocation. #5287

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

cbcunc
Copy link
Contributor

@cbcunc cbcunc commented Dec 19, 2023

Pull Request Checklist:

  • Positive Test Case Written by Dev

pre-existing: https://github.com/hydroshare/hydroshare/blob/master/hs_core/tests/api/native/test_bagit.py#L16

  • Automated Testing
  • Sufficient User and Developer Documentation
  • Passing Jenkins Build
  • Peer Code review and approval

Positive Test Case

  1. pre-existing: https://github.com/hydroshare/hydroshare/blob/master/hs_core/tests/api/native/test_bagit.py#L16

@cbcunc cbcunc self-assigned this Dec 19, 2023
Copy link
Member

@trel trel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will do exactly what you are looking for.

Does it pass/run successfully?

devincowan
devincowan previously approved these changes Dec 19, 2023
@devincowan
Copy link
Contributor

@cbcunc looks good thank you
just need to fix the linting
http://ci.hydroshare.org:8080/job/hydroshare-pull-requests/6975/artifact/pylint.out/*view*/

devincowan
devincowan previously approved these changes Dec 20, 2023
Copy link
Contributor

@devincowan devincowan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed the linting fix just to get the PR build running

@cbcunc
Copy link
Contributor Author

cbcunc commented Jan 29, 2024

@trel All the tests that invoke the rule fail with

django_irods.icommands.SessionException: (SessionException(...), "Error processing IRODS request: -1. stderr follows:\n\nb' ERROR: parseMsInputParam: inpParam hydroshare/irods/ruleGenerateBagIt_HS.r format error\\n ERROR: Invalid input parameter list specification\\nUse -h for help.\\n'")

and I am not understanding why.

@trel
Copy link
Member

trel commented Jan 29, 2024

Ah, I think it expects each space-delimited argument to irule to be a separate parameter to self.session.run()...

Like this...

self.session.run("irule", None, "-r", "irods_rule_engine_plugin-irods_rule_language-instance", "-F",
                         rule_name, input_path, input_resource)

@cbcunc
Copy link
Contributor Author

cbcunc commented Jan 29, 2024

Possibly. I'll try that. I'm curious that the last three arguments aren't positional. self.session.run is a call into django_irods that Jason wrote.

@cbcunc
Copy link
Contributor Author

cbcunc commented Jan 29, 2024

Ah, yeah, we already tried that in the very first commit. The arguments are positional. 99fa4f0

@cbcunc
Copy link
Contributor Author

cbcunc commented Jan 29, 2024

I will try it again, though, as it looks like it should work:

def run(self, icommand, data=None, *args):

@trel
Copy link
Member

trel commented Jan 29, 2024

Right, there are other calls in that file that have differing number of arguments.

@cbcunc
Copy link
Contributor Author

cbcunc commented Jan 30, 2024

@trel So now that each we're back to each space-delimited argument to irule is a separate parameter, this error on every every test involving this generated rule. @devincowan Can you confirm that this error has not been occurring to block PRs previously?

Error Message

(SessionException(...), "Error processing IRODS request: -1. stderr follows:\n\nb' ERROR: Cannot open input file  . errno = 2\\n'")

Stacktrace

Traceback (most recent call last):
  File "/hydroshare/hs_core/hydroshare/hs_bagit.py", line 102, in create_bagit_files_by_irods
    istorage.runBagitRule(bagit_rule_file, bagit_input_path, bagit_input_resource)
  File "/hydroshare/django_irods/storage.py", line 135, in runBagitRule
    self.session.run("irule", None, "-r", "irods_rule_engine_plugin-irods_rule_language-instance", "-F ",
  File "/hydroshare/django_irods/icommands.py", line 182, in run
    raise SessionException(proc.returncode, stdout, stderr)
django_irods.icommands.SessionException: (SessionException(...), "Error processing IRODS request: 1. stderr follows:\n\nb' ERROR: Cannot open input file  . errno = 2\\n'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/local/lib/python3.9/unittest/case.py", line 592, in run
    self._callTestMethod(testMethod)
  File "/usr/local/lib/python3.9/unittest/case.py", line 550, in _callTestMethod
    method()
  File "/hydroshare/hs_core/tests/api/native/test_bagit.py", line 54, in test_bag_creation_and_deletion
    status = create_bag_by_irods(self.test_res.short_id)
  File "/usr/local/lib/python3.9/site-packages/celery/local.py", line 188, in __call__
    return self._get_current_object()(*a, **kw)
  File "/usr/local/lib/python3.9/site-packages/celery/app/task.py", line 392, in __call__
    return self.run(*args, **kwargs)
  File "/hydroshare/hs_core/tasks.py", line 766, in create_bag_by_irods
    create_bagit_files_by_irods(res, istorage)
  File "/hydroshare/hs_core/hydroshare/hs_bagit.py", line 109, in create_bagit_files_by_irods
    raise SessionException(-1, '', ex.stderr)
django_irods.icommands.SessionException: (SessionException(...), "Error processing IRODS request: -1. stderr follows:\n\nb' ERROR: Cannot open input file  . errno = 2\\n'")

@devincowan
Copy link
Contributor

@cbcunc I can confirm that this error has not been blocking PRs recently

@trel
Copy link
Member

trel commented Jan 30, 2024

errno 2 is No such file or directory

so... which file doesn't exist?

@devincowan
Copy link
Contributor

closing as no longer necessary after 2.14.1 release of hydroshare, we no longer use the irods microservice for quota tracking in the datazone

@devincowan devincowan closed this Jun 5, 2024
@devincowan devincowan reopened this Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants