I also had this situation. I completely forbade the computer from sleeping.
-
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
-
sudo nano /etc/systemd/logind.conf
find the lines there (or add them to the end) so that they look like this (without the # sign in front):
HandleSuspendKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
Ctrl+O,Enter,Ctrl+X
restart the service:
sudo systemctl restart systemd-logind