After some ideal time, getting 500 error when pulling/pushing to gitlab and for every first time, it work then the for second time

Intermittent 500 error after migration from physical to azure VM. After some ideal time when pulling/pushing to gitlab, I get an error every first time, it work then the second time.
Same with gui web access, refresh after some ideal time, shows 500 error, and immediately after second refresh, it works