Hi everyone, I've been trying to daemonize workers...
# ask-community
h
Hi everyone, I've been trying to daemonize workers on windows for automate runs and restarts. I use NSSM to create a service with path on a cmd file that run "cmd.exe /K "D:\QA\anaconda3\Scripts\activate.bat D:\QA\anaconda3 && conda activate D:\Database\envs & prefect worker start --pool "AG" --type process" But for some reason, the service doesn't poll the prefect cloud. Meanwhile, when I run this command line on a CMD then everything is fine. I fount this in the error log: sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked 2023-12-25 043835.968: [SQL: INSERT INTO worker (name, last_heartbeat_time, work_pool_id, id, created, updated) VALUES (:name, :last_heartbeat_time, :work_pool_id, :id, :created, :updated) ON CONFLICT (work_pool_id, name) DO UPDATE SET last_heartbeat_time = :param_1] .... 2023-12-25 043835.968: (Background on this error at: https://sqlalche.me/e/20/e3q8) Can anyone please help me on this??
1
I found the problem. Since the window services is using a different user from the user I'm currently using, It requires a new log in information in order to poll the tasks. So I just add the login command with an api key and workspace name in the cmd file and it works flawlessly