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

Days cannot be correctly closed with lstosa v0.10.8 #276

Closed
marialainez opened this issue Feb 7, 2024 · 1 comment · Fixed by #277
Closed

Days cannot be correctly closed with lstosa v0.10.8 #276

marialainez opened this issue Feb 7, 2024 · 1 comment · Fixed by #277

Comments

@marialainez
Copy link
Collaborator

marialainez commented Feb 7, 2024

With version 0.10.8 of lstosa, autocloser gives the following error:

 File "/fefs/aswg/software/conda/envs/osa-v0.10/lib/python3.11/site-packages/osa/scripts/closer.py", line 159, in post_process
    longterm_job_id = daily_datacheck(daily_longterm_cmd(list_job_id))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/fefs/aswg/software/conda/envs/osa-v0.10/lib/python3.11/site-packages/osa/scripts/closer.py", line 492, in daily_datacheck
    job_id = job.stdout.strip()
            ^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'strip'

2024-02-07 17:02:01,791 WARNING [root] (autocloser.main): Could not close the day for LST1!

For this reason, the DL1 files are not merged (as DL1 merging is done afterward) and the day is not closed correctly.

@morcuended
Copy link
Member

The problem is that daily_longterm is running the subprocess simply as .run(cmd, check=True) and the stdout is not being captured, hence the error in job_id = job.stdout.strip()

job = subprocess.run(cmd, check=True)

should be instead:

    job = subprocess.run(
        cmd,
        encoding="utf-8",
        capture_output=True,
        text=True,
        check=True,
    )

So the stdout of the job output is captured.

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