Git פגום במהלך בנייה מחדש של אפליקציית ה-launcher

לאחר שדרוג docker_manager דרך ה-API (שנראה שעבר כשורה), לוח הבקרה של מנהל המערכת הציג פשוט דף ריק, גם אם שאר הפורום נראה שעובד.

כדי לפתור זאת, נאלצתי להריץ:

./launcher rebuild app

עם זאת, במהלך התהליך הזה, הוא נתקל בשגיאות:

I, [2025-07-14T08:54:06.062789 #1]  INFO -- : 
> cd /var/www/discourse && sudo -H -E -u discourse bash -c '
  set -o errexit
  if [ $(git rev-parse --is-shallow-repository) == "true" ]; then
      git remote set-branches --add origin main
      git remote set-branches origin tests-passed
      git fetch --depth 1 origin tests-passed
  else
      git fetch --tags --prune-tags --prune --force origin
  fi
'
error: packfile .git/objects/pack/pack-581fe47ace192793da04d01989a4d1a7f0e6103c.pack does not match index
error: packfile .git/objects/pack/pack-581fe47ace192793da04d01989a4d1a7f0e6103c.pack does not match index
error: packfile .git/objects/pack/pack-581fe47ace192793da04d01989a4d1a7f0e6103c.pack does not match index
error: packfile .git/objects/pack/pack-581fe47ace192793da04d01989a4d1a7f0e6103c.pack does not match index

… והודעת error: packfile פשוט ממשיכה להיות מוצפת עד להפסקה.

כפי שזה נראה, מאגר ה-git הפך לפגום. אבל איזה מאגר git?
אין לי אפילו תיקיית /var/www/discourse, אז אני מניח שזה נמצא בתוך volume של קונטיינר?

אני קצת מבולבל. תודה על העזרה!

What do you mean by that?

Normally you’d update docker_manager via the UI.

אוי! טעות שלי. התכוונתי לממשק משתמש, לא ל-API. אני אערוך את זה מיד.

לייק 1

I tried to have resolved it by starting and entering the app container:

./launcher start app
./launcher enter app

Then I verified that the error occurred when calling the git command as the user discourse:

cd /var/www/discourse
sudo -H -E -u discourse bash -c 'git fetch --tags --prune-tags --prune --force origin'

Resulting in:

error: packfile .git/objects/pack/pack-581fe47ace192793da04d01989a4d1a7f0e6103c.pack does not match index
error: packfile .git/objects/pack/pack-581fe47ace192793da04d01989a4d1a7f0e6103c.pack does not match index
error: packfile .git/objects/pack/pack-581fe47ace192793da04d01989a4d1a7f0e6103c.pack does not match index
etc..

I tried to resolve it by renaming discourse and clone a new one:

cd /var/www
mv discourse discourse-old
git clone https://github.com/discourse/discourse.git
chown -R discourse:discourse discourse

Once cloned, tried to run the git fetch again with no errors!

cd /var/www/discourse
sudo -H -E -u discourse bash -c 'git fetch --tags --prune-tags --prune --force origin'

But as I exited the container shell and tried to rebuild again with ./launcher rebuild app, I got the same error.

Does the ./launcher rebuild app use a different container than ./launcher enter app enters?

לייק 1

כן, ישנם שני מפלסים של git, אחד בחוץ.

השגיאה שלך אכן מופיעה בתוך הקונטיינר… מוזר מאוד!

סוף סוף הצלחתי לגרום לזה לעבוד!
אני חושב שזה היה שילוב בין git פגום לבין התוצאה של שדרוג docker קודם. פתרתי זאת על ידי גיזום כל מכלי ה-docker והתמונות:

cd /opt/discourse
./launcher stop app
docker container prune
docker image prune -a
./launcher rebuild app

זה הניב/הסתיים עם:

שדרוג הושלם
----------------
סטטיסטיקות אופטימייזר אינן מועברות על ידי pg_upgrade.
לאחר שתתחיל את השרת החדש, שקול להפעיל:
    /usr/lib/postgresql/15/bin/vacuumdb --all --analyze-in-stages

הפעלת סקריפט זה תמחק את קבצי הנתונים של האשכול הישן:
    ./delete_old_cluster.sh
-------------------------------------------------------------------------------------
שדרוג של POSTGRES הושלם

מאגר הנתונים הישן 13 מאוחסן ב- /shared/postgres_data_old

כדי להשלים את השדרוג, בצע בנייה מחדש באמצעות:

./launcher rebuild app
-------------------------------------------------------------------------------------

על ידי הפעלת הבנייה מחדש שוב, זה התחיל לעבוד במלואו:

./launcher rebuild app
לייק 1