2017年10月30日 星期一

Synology gitlab return 502

之前在群暉的NAS上有安裝gitlab的套件用來練習git的操作。
一陣子沒有使用後,今天打算把資料push到gitlab上後卻得到502的錯誤訊息。
不只是push時遇到這個錯誤,打開gitlab網頁介面也遇到同樣的錯誤訊息。



NAS的gitlab是使用docker來安裝與使用的。
首先先看看gitlab實際執行時是否有吐出相關的錯誤訊息。
開啟DSM主選單 --> Docker --> 容器 --> Synology_gitlab --> 點選上方的詳細資料
開啟詳細資料後,切換到日誌這個標籤。
此時會看到如下的內容:

2017-10-30 14:31:18,472 INFO spawned: 'unicorn' with pid 1464
2017-10-30 14:31:19,474 INFO success: unicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-10-30 14:31:20,003 INFO exited: unicorn (exit status 1; not expected)
2017-10-30 14:31:21,006 INFO spawned: 'unicorn' with pid 1467
2017-10-30 14:31:22,008 INFO success: unicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-10-30 14:31:22,556 INFO exited: unicorn (exit status 1; not expected)
一直顯示unicorn process反覆running、exited,每次的pid都不一樣
這裡筆者是參考網路上的做法,將unicorn的pid file刪除掉。
要刪除pid file,首先要切換到docker容器的終端介面去。
回到Docker的詳細資料視窗,點選剛才日誌標籤旁邊的終端機標籤即可。
接下來輸入以下指令來刪除pid file:
rm /home/git/gitlab/tmp/pids/unicorn.pid
等個幾分鐘之後,gitlab就可以正常登入,同時也可以push change了。


Reference: http://blog.stead.id.au/2017/03/synology-gitlab-error-502.html



沒有留言:

張貼留言