Brian Roepke
01/22/2023, 1:15 PMJeff Hale
01/22/2023, 2:33 PMBrian Roepke
01/22/2023, 2:55 PMJeff Hale
01/22/2023, 3:15 PMBrian Roepke
01/22/2023, 3:16 PMBrian Roepke
01/23/2023, 4:40 PMExecStart=/usr/local/bin/prefect
- how can I validate the proper path. When looking where prefect is installed it's here: /home/prefect/.local/lib/python3.7/site-packages
Brian Roepke
01/23/2023, 4:41 PMBrian Roepke
01/23/2023, 4:59 PMprefect
user I can run the prefect command and the help shows up just fin - prefect seems to be installed and working well.Brian Roepke
01/23/2023, 8:55 PM[ec2-user@ip-10-0-0-28 ~]$ sudo systemctl status prefect-agent
● prefect-agent.service - Prefect Agent
Loaded: loaded (/etc/systemd/system/prefect-agent.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Mon 2023-01-23 21:07:17 UTC; 21min ago
Process: 5064 ExecStart=/.local/bin/prefect agent start -q lambda-tmdb (code=exited, status=203/EXEC)
Main PID: 5064 (code=exited, status=203/EXEC)
Jan 23 21:07:17 ip-10-0-0-28.ec2.internal systemd[1]: prefect-agent.service: main process exited, code=exited, st...EXEC
Jan 23 21:07:17 ip-10-0-0-28.ec2.internal systemd[1]: Unit prefect-agent.service entered failed state.
Jan 23 21:07:17 ip-10-0-0-28.ec2.internal systemd[1]: prefect-agent.service failed.
Jan 23 21:07:17 ip-10-0-0-28.ec2.internal systemd[1]: prefect-agent.service holdoff time over, scheduling restart.
Jan 23 21:07:17 ip-10-0-0-28.ec2.internal systemd[1]: Stopped Prefect Agent.
Jan 23 21:07:17 ip-10-0-0-28.ec2.internal systemd[1]: start request repeated too quickly for prefect-agent.service
Jan 23 21:07:17 ip-10-0-0-28.ec2.internal systemd[1]: Failed to start Prefect Agent.
Jan 23 21:07:17 ip-10-0-0-28.ec2.internal systemd[1]: Unit prefect-agent.service entered failed state.
Jan 23 21:07:17 ip-10-0-0-28.ec2.internal systemd[1]: prefect-agent.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
Jeff Hale
01/24/2023, 5:20 AMFor thisThis is a little confusing - that directory in the Discourse post is created automatically for the user that was named “prefect” when that user was created . It’s not related to where the library was installed. @Ryan Peden - might be best to change the name to another user in the example. I can do it if you don’t mind.- how can I validate the proper path. When looking where prefect is installed it’s here:…ExecStart=/usr/local/bin/prefect
Ryan Peden
01/24/2023, 5:28 AM/usr/local/bin/prefect
path is where the prefect
executable gets installed when you run pip install prefect
on the system's built-in Python.
It'll be a different path if you're using a venv or conda environment, but I don't think a different user account would result in a location other than /usr/local/bin/prefect
on its own.Ryan Peden
01/24/2023, 5:28 AMwhich prefect
Jeff Hale
01/24/2023, 5:32 AMBrian Roepke
01/24/2023, 3:04 PMprefect
PIP
$ pip --version
pip 22.3.1 from /home/prefect/.local/lib/python3.7/site-packages/pip (python 3.7)
Python
$ python --version
Python 3.7.16
Brian Roepke
01/24/2023, 3:05 PM$ prefect --version
2.7.9
and
$ which prefect
~/.local/bin/prefect
Brian Roepke
01/24/2023, 3:06 PM$ pwd
/home/prefect/.local/bin
Brian Roepke
01/24/2023, 3:07 PMcd /etc/systemd/system
sudo vim prefect-agent.service
Brian Roepke
01/24/2023, 3:07 PM[Unit]
Description=Prefect Agent
[Service]
User=prefect
WorkingDirectory=/home/prefect
ExecStart=/.local/bin/prefect agent start -q lambda-tmdb
Restart=always
[Install]
WantedBy=multi-user.target
Brian Roepke
01/24/2023, 3:07 PMRyan Peden
01/24/2023, 3:08 PMBrian Roepke
01/24/2023, 3:09 PMBrian Roepke
01/24/2023, 3:09 PMBrian Roepke
01/24/2023, 3:09 PMExecStart=/home/prefect/.local/bin/prefect agent start --work-queue "lambda-tmdb"
Brian Roepke
01/24/2023, 3:09 PM/home/prefect/
Ryan Peden
01/24/2023, 3:10 PMBrian Roepke
01/24/2023, 3:10 PMBrian Roepke
01/24/2023, 3:10 PMBrian Roepke
01/24/2023, 3:12 PMWill Truong
03/22/2023, 7:05 AMWill Truong
03/22/2023, 7:07 AMWill Truong
03/22/2023, 7:45 AMcd /etc/systemd/system
sudo vim prefect-agent.service
it shows this, do you guys think it is the problem?Will Truong
03/23/2023, 2:07 AMRyan Peden
03/23/2023, 2:16 AMcp prefect-agent.service ~/prefect-agent.service
Then, see what's in the file by running cat prefect-agent.service
.
If it contains what you expect, delete the swapfile by running rm prefect-agent.service.swp
. If it looks like changes are missing, run vim prefect-agent.service
again and press R to recover the changes that didn't get saved last time you edited the file.Will Truong
03/23/2023, 2:33 AMsystemctl status prefect-agent.service
it show this. Maybe Docker is the problem?Will Truong
03/23/2023, 2:42 AMRyan Peden
03/23/2023, 3:06 AM/var/run/docker.sock
exist? Also, are you running prefect-agent.service
as root? If not, you'll need to make sure the account that runs the service is part of the docker
group.Will Truong
03/23/2023, 3:20 AMRyan Peden
03/23/2023, 5:46 AMprefect
user to the docker
user group. Depending in your Linux distro and how you installed Docker, the group might already exist.
If not, you can add it by running sudo groupadd docker
. Then, you can add the Prefect user to the group by running sudo usermod -aG docker prefect
.Will Truong
03/23/2023, 7:47 AMWill Truong
03/24/2023, 3:54 AM