2024年7月5日 星期五

ActiveRecord::DatabaseConnectionError: There is an issue connecting to your database with your username/password, username: gitlab.

問題症狀

Gitlab V16.11.5 (docker) 升級到 V17.0.3 出現 postgresql錯誤。錯誤內容是使用gitlab進行postgresql操作時,沒有回應。


解決辦法

造成原因是技術紅利用完了,原本的v16版本用的是postgresql v13跟v14。到了Gitlab V17時,全面改用了postgresql v14。這需要轉換。

不過之前我在進行從v11升到v16過程中,有一次postgresql v13轉到v14的過程出問題,導致接下來Gitlab進行postgresql轉換時被legancy資料卡住。

解決辦法很簡單,先把lagency資料刪除,Gitlab就能進行postgresql轉換:


1. 先開啟容器(如果就已經知道路徑也可以直接在該資料夾底下刪除,這邊統一用容器比較知道路徑)(請依照自身容器狀況修改docker參數)

sudo docker run -it --privileged -v /home/markliou/temp/cri-gitlab/volume1/cri-gitlab/config:/etc/gitlab -v /home/markliou/temp/cri-gitlab/volume1/cri-gitlab/data:/var/opt/gitlab -p 8443:443 gitlab/gitlab-ce:17.0.3-ce.0 bash


2. 刪除postgresql的legency

rm -fr /var/opt/gitlab/postgresql/data.14

然後進行database升級

gitlab-ctl reconfigure

gitlab-ctl pg-upgrade


最後重啟gitlab docker就可以了(重啟時,gitlab會自動進行gitlab-ctl reconfigure)





iscsi 連線問題筆記

如果要進行umount但是出現target buzy sudo fuser -km 掛載點 sudo umount 掛載點 iSCSI重啟 sudo open-iscsi restart  掛載lun iscsiadm -m discovery -t sendtargets -p...