GreenScheduler / cats

CATS: the Climate-Aware Task Scheduler :cat2: :tiger2: :leopard:
https://greenscheduler.github.io/cats/
MIT License
50 stars 8 forks source link

bug: scheduling a command fails #93

Closed mkbane closed 4 months ago

mkbane commented 5 months ago

Presuming order of parameters should not matter, here's a bug:

mkb@deb12:~/src/mmu-linux/mmu-bin$ ~/.local/bin/cats -d 1 --loc M13 -c date -s at WARNING:root:config file not found WARNING:root:Unspecified carbon intensity forecast service, using carbonintensity.org.uk Best job start time: 2024-04-23 16:31:20.222906+01:00 Traceback (most recent call last): File "/home/mkb/.local/bin/cats", line 8, in sys.exit(main()) ^^^^^^ File "/home/mkb/.local/pipx/venvs/climate-aware-task-scheduler/lib/python3.11/site-packages/cats/init.py", line 265, in main schedule_at(output, args.command.split()) File "/home/mkb/.local/pipx/venvs/climate-aware-task-scheduler/lib/python3.11/site-packages/cats/init.py", line 198, in schedule_at output = subprocess.check_output( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/subprocess.py", line 466, in check_output return run(popenargs, stdout=PIPE, timeout=timeout, check=True, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/subprocess.py", line 548, in run with Popen(popenargs, **kwargs) as process: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/subprocess.py", line 1024, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'at'

mkbane commented 5 months ago

actually, this error was since the "at" command was not found on the system. Installing "at" fixes the error but "FileNotFoundError" is potentially misleading?

abhidg commented 5 months ago

@mkbane thanks, will add a user friendly error message for this case