Swar-Chia-Plot-Manager icon indicating copy to clipboard operation
Swar-Chia-Plot-Manager copied to clipboard

unix_process_priority: -20 gets PermissionError: [Errno 13] Permission denied

Open InvaderDolan opened this issue 3 years ago • 8 comments

Hi. I am installed newest version of Swar Chia Plot Manager and tried to put maximum priority to plotting jobs on my Ubuntu by setting the value to -20, but I've got this error while starting the manager:

2021-05-28 11:48:21 [INFO]: Setting priority level: -20
Traceback (most recent call last):
  File "/home/invader/Swar-Chia-Plot-Manager/venvswar/lib/python3.8/site-packages/psutil/_pslinux.py", line 1576, in wrapper
    return fun(self, *args, **kwargs)
  File "/home/invader/Swar-Chia-Plot-Manager/venvswar/lib/python3.8/site-packages/psutil/_pslinux.py", line 1992, in nice_set
    return cext_posix.setpriority(self.pid, value)
PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/invader/Swar-Chia-Plot-Manager/stateless-manager.py", line 94, in <module>
    jobs, running_work, next_job_work, next_log_check = monitor_jobs_to_start(
  File "/home/invader/Swar-Chia-Plot-Manager/plotmanager/library/utilities/jobs.py", line 258, in monitor_jobs_to_start
    job, work = start_work(
  File "/home/invader/Swar-Chia-Plot-Manager/plotmanager/library/utilities/jobs.py", line 327, in start_work
    psutil.Process(pid).nice(nice_val)
  File "/home/invader/Swar-Chia-Plot-Manager/venvswar/lib/python3.8/site-packages/psutil/__init__.py", line 724, in nice
    self._proc.nice_set(value)
  File "/home/invader/Swar-Chia-Plot-Manager/venvswar/lib/python3.8/site-packages/psutil/_pslinux.py", line 1578, in wrapper
    raise AccessDenied(self.pid, self._name)
psutil.AccessDenied: psutil.AccessDenied (pid=260185)

Setting value to 0 solved the error, but I still want to put maximum value to plotting jobs. Thanks.

InvaderDolan avatar May 28 '21 08:05 InvaderDolan

The user you are using in Linux probably doesn't have the required permissions to modify the priority of that task.

cherymann avatar May 30 '21 18:05 cherymann

The user you are using in Linux probably doesn't have the required permissions to modify the priority of that task.

This user is the only user in the system and has root privileges. But thank you, I'll check it and write here if it works.

InvaderDolan avatar May 30 '21 18:05 InvaderDolan

Try this: run at -15 sudo python manager.py restart (if that doesnt work "su -" then "python manager.py restart") make sure root has a .chia folder in their home dir with the private keys added.

DonielMoins avatar May 31 '21 13:05 DonielMoins

Try this: run at -15 sudo python manager.py restart (if that doesnt work "su -" then "python manager.py restart") make sure root has a .chia folder in their home dir with the private keys added.

Thank you, I will try it shortly. Will come back if problem solved.

InvaderDolan avatar Jun 03 '21 22:06 InvaderDolan

Try this: run at -15 sudo python manager.py restart (if that doesnt work "su -" then "python manager.py restart") make sure root has a .chia folder in their home dir with the private keys added.

So, su - was not working at first giving su: authentication failure. To fix that, I set up password for root by sudo passwd root. Then, I could cd Swar directory and restart the manager. I set -20 and didn't get any error. Will check if it really works when manager will start a new job.

Thank you so much!

P.S. sudo python manager.py restart don't work at all and requires to make a lot of things to make it happen. Giving password to root and then execute under root is much easier.

InvaderDolan avatar Jun 03 '21 22:06 InvaderDolan

Try this: run at -15 sudo python manager.py restart (if that doesnt work "su -" then "python manager.py restart") make sure root has a .chia folder in their home dir with the private keys added.

The manager under root is not starting up the new jobs at all. I have double checked it.

InvaderDolan avatar Jun 03 '21 23:06 InvaderDolan

The same problem!

CXMANDTXW avatar Jun 04 '21 17:06 CXMANDTXW

Kill manager. kill ALL chia processes. reboot. then start chia farmer as root. make sure to copy your .chia to /root/.chia before anything you might have to export your mnemonic key then import it running either Sudo on every command OR preferably su - then as root, start the manager.

DonielMoins avatar Jun 04 '21 17:06 DonielMoins