pyslurm icon indicating copy to clipboard operation
pyslurm copied to clipboard

list db jobs broken - cannot create accounting_storage context

Open Whitehorse2 opened this issue 3 years ago • 4 comments

Details

  • Slurm Version: 20.11.8-1
  • Python Version: python3.8
  • Cython Version: cython3 0.29.14
  • PySlurm Branch: 20.11.8-1
  • Linux Distribution: Ubuntu 20.04

Issue

Unable to receive accounting storage data with example file listdb_jobs.py.

python: error: cannot create accounting_storage context for (null)
python: error: cannot create accounting_storage context for (null)
Error:b'No error'
python: error: cannot create accounting_storage context for (null)

I can retrieve jobs data over sacct and jobs_list.py, but the list db output is required

Whitehorse2 avatar Apr 04 '22 19:04 Whitehorse2

Hi,

this is likely due to a missing call to the slurm_init() function. In Slurm 20.11 they introduced this in the C-API, and a call to this function is required before interacting with certain parts of the API (for example, slurmdbd related stuff).

It was only introduced here in pyslurm with the upgrade to 21.08 recently. However, we can just backport this functionality for 20.11. I'll see if I can get a PR for this ready tomorrow.

tazend avatar Apr 04 '22 20:04 tazend

@tazend Thanks for looking at the issue. Let me know when the pre release is ready, I would like to test it asap.

Whitehorse2 avatar Apr 06 '22 11:04 Whitehorse2

Hi @Whitehorse2

I have backported the necessary functions. If you want, you can test it with this branch here

This Branch also includes a few more commits that came after the initial 20.11.8-1 release (mostly changes related to dropping python2 support)

On my side, fetching slurmdbd jobs now works again with slurm_init(). (slurm_init will be called automatically when the pyslurm module is loaded, so you don't have to do anything prior)

tazend avatar Apr 06 '22 17:04 tazend

@tazend It works, thank you very much!

Whitehorse2 avatar Apr 06 '22 18:04 Whitehorse2