Git-Auto-Deploy icon indicating copy to clipboard operation
Git-Auto-Deploy copied to clipboard

using @reboot with crontab

Open Seridyan opened this issue 4 years ago • 1 comments

When I use crontab to start GAD at reboot, I can't connect to the Gitlab repository. If I manually start GAD in the terminal, everything works as it should. I am using a raspberry pi 3 model A+. Here is the log output:

2020-12-03 11:38:57,765 [INFO ] Initializing repository "my repository" 2020-12-03 11:38:58,542 [INFO ] ssh: connect to host x.x.x.x port 22: Network is unreachable 2020-12-03 11:38:58,543 [INFO ] fatal: Could not read from remote repository. 2020-12-03 11:38:58,544 [INFO ]
2020-12-03 11:38:58,544 [INFO ] Please make sure you have the correct access rights 2020-12-03 11:38:58,544 [INFO ] and the repository exists. 2020-12-03 11:38:58,545 [ERROR] Command 'git fetch origin' failed with exit code 128 2020-12-03 11:38:58,545 [ERROR] Unable to init repository "my repository" 2020-12-03 11:38:59,489 [CRITI] Unable to activate SSL: File does not exist: /home/pi/cert.pem 2020-12-03 11:38:59,537 [CRITI] Unable to start HTTP server: [Errno 99] Cannot assign requested address

Seridyan avatar Dec 03 '20 17:12 Seridyan

The solution to my problem was to add a delay before executing GAD in a script and then call the script in crontab.

sleep 10
python -m gitautodeploy --daemon-mode --config config.json

Seridyan avatar Dec 03 '20 19:12 Seridyan