How to fix systemd error: Failed to determine user credentials: No such process

Problem

You have a systemd service such as

[Unit]
Description=My Service

[Service]
ExecStart=/usr/bin/my-service
User=myuser

[Install]
WantedBy=multi-user.target

but in the log (systemctl status my-service) you see the following error:

Jun 19 18:41:36 mycomputer (nice)[1349797]: my-service.service: Failed to determine user credentials: No such process
Jun 19 18:41:36 mycomputer systemd[1]: my-service.service: Main process exited, code=exited, status=217/USER

Solution

The reason for this is quite simple: The user you specified in the User= directive does not exist on your system.

Check the user for spelling mistakes and verify it actually exists on the computer running the service.