Gitlab After deleting the log, gitlab cannot be accessed, prompt 499

gitlab 15.1.3 os:Ubuntu 20.04

The actions performed are as follows:

rm -rf /var/log/gitlab/*
gitlab-ctl restart

The gitlab url cannot be accessed, and all requests to view the log nginx are 499。

I tried restarting gitlab and reconfigure again

I would suggest running:

gitlab-ctl reconfigure

to get all your log directories back. You shouldn’t have deleted your log files and directories the way you did it. If anything you should have deleted the files only.

Restored after reconfigure. After about half an hour, it continued to return to 499 and could not be accessed.
I have also changed to use the official logrotate to deal with it now.
I am curious, why a log directory can cause inaccessibility.

Well if you delete the directories and Gitlab wants to create files in places that don’t exist, it’s gonna fail. Gitlab logs rotate by default anyway. Didn’t have to do anything special at all.

Be careful using logrotate, if you don’t set file permissions correct on the logs files you will break it again. You should leave this to the gitlab application to take care of.