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

Problem in parse_jobs_list_output in class ShellIO #22

Closed
FabiPi3 opened this issue Sep 19, 2023 · 4 comments · Fixed by #23
Closed

Problem in parse_jobs_list_output in class ShellIO #22

FabiPi3 opened this issue Sep 19, 2023 · 4 comments · Fixed by #23

Comments

@FabiPi3
Copy link
Collaborator

FabiPi3 commented Sep 19, 2023

I tried to use the local runner in my new project and got the following error message:

Command is:

jf project check -w example_local

Error message is (after adding a print in the source code, the --full-exc flag does not help?):

Error while testing worker:
 Traceback (most recent call last):
  File "/Users/fabianpeschel/code/QToolKit/src/qtoolkit/io/shell.py", line 230, in parse_jobs_list_output
    shell_job_state = ShellState(data[3])
  File "/Users/fabianpeschel/miniconda3/envs/excworkflow/lib/python3.10/enum.py", line 385, in __call__
    return cls.__new__(cls, value)
  File "/Users/fabianpeschel/miniconda3/envs/excworkflow/lib/python3.10/enum.py", line 710, in __new__
    raise ve_exc
ValueError: 'S+' is not a valid ShellState

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/fabianpeschel/code/jobflow-remote/src/jobflow_remote/config/helper.py", line 161, in check_worker
    qm.get_jobs_list()
  File "/Users/fabianpeschel/code/jobflow-remote/src/jobflow_remote/remote/queue.py", line 204, in get_jobs_list
    return self.scheduler_io.parse_jobs_list_output(
  File "/Users/fabianpeschel/code/QToolKit/src/qtoolkit/io/shell.py", line 234, in parse_jobs_list_output
    raise OutputParsingError(msg)
qtoolkit.core.exceptions.OutputParsingError: Unknown job state S+ for job id 1442

This comes from the following output of the command ps -o pid,user,etime,state,comm:

  PID USER              ELAPSED STAT COMM
 1442 fabianpeschel 14-07:08:54 S+   -zsh
81288 fabianpeschel 01-08:41:00 S    -zsh
89417 fabianpeschel    08:56:19 S    -zsh
89427 fabianpeschel    08:56:15 S+   /Users/fabianpeschel/miniconda3/envs/excforjup/bin/python
85691 fabianpeschel 01-04:26:07 S+   -zsh
58649 fabianpeschel 06-05:34:07 Ss+  /bin/zsh
36512 fabianpeschel 10-09:55:09 S+   -zsh
20263 fabianpeschel 12-10:01:09 Ss+  /bin/zsh
21470 fabianpeschel 12-09:07:12 Ss+  /bin/zsh
58655 fabianpeschel 06-05:34:03 Ss+  /bin/zsh
58668 fabianpeschel 06-05:33:52 Ss   /bin/zsh
58693 fabianpeschel 06-05:33:23 S+   /Users/fabianpeschel/miniconda3/envs/excworkflow/bin/python
58701 fabianpeschel 06-05:33:22 Z+   <defunct>
92245 fabianpeschel    06:46:58 Ss+  /bin/zsh
64804 fabianpeschel 05-08:20:38 S+   -zsh
92788 fabianpeschel    06:42:38 Ss+  /bin/zsh

Problematic is the status, which is in the current implementation only allowed to be single character indicating the status. But on my local mac, more characters appear indicating session leaders and foreground processes (described here: https://www.computerhope.com/unix/ups.htm).

The additional info could be simply ignored by changing line 228 in io/shell.py:

shell_job_state = ShellState(data[3][0])

@Developers: If I would like to open pull requests, how to do it best?

@gpetretto
Copy link
Contributor

Thanks for pointing this out! Indeed I also have some jobs with those kind of states on my mac. I never realized since I did not get them when I tried to run locally.

Since according to the link you posted the symbols like s or + are just modifiers, your solution seems valid. You can proceed to open a PR if you are willing to.

@FabiPi3
Copy link
Collaborator Author

FabiPi3 commented Sep 20, 2023

It seems like I do not the access rights to push to this repo. Do I need to fork it? Please tell me how to proceed.

@gpetretto
Copy link
Contributor

Indeed you will need to create a fork, commit your changes there and then create a PR from your fork to the develop branch of this repository.

You can find more details on github's documentation. For example:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork

@FabiPi3
Copy link
Collaborator Author

FabiPi3 commented Sep 20, 2023

Opened #23 to solve the issue

@gpetretto gpetretto linked a pull request Sep 20, 2023 that will close this issue
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 a pull request may close this issue.

2 participants