עדכון בדפדפן לעומת טרמינל

Is it the same process to update Discourse via the browser, or via Terminal using the ./launcher rebuild app?
If so, any advantages of one over the other, other than being able to update plugins individually?

I’m no expert in this, so I’m sorry if I’m saying something that doesn’t make sense.

I’m asking this, because it’s the second time I try to update via the browser and it gets stuck. The first time it started and got stuck in the middle of the updating process, and then last night (2nd time) I hit the update button, went to bed, and this morning it hadn’t even begin. I had to Cancel and restart.

לייק 1

Use the UI when possible to minimise downtime (few seconds)

Occasionally some forms of update (e.g. update postgres version) require a command line update. This is necessary on those occasions but does lead to some downtime on standard install. Usually about 20 minutes. Pick an off-peak period.

Those occasions should be obvious from the UI.

If you want to add or remove a plugin, you will need to use the console rebuild.

3 לייקים

As I’m updating now, I noticed that the forum is still working, but sometimes a bit slower. This is good compared to using Terminal, which seems to completely make the forum not work. Thanks for clarifying this.

Even for a non-expert like myself? I mean, will it say something that shows me I should use Terminal instead?

Technologically speaking, do you think this will eventually change one day where we can do everything in the browser? I don’t know the technicalities of this process, that’s why I’m asking.

לייק 1

It crashed again…
Spinning up 1 Unicorn worker(s) that were stopped initially

ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL Command was killed with SIGKILL (Forced termination): ember build -prod Docker Manager: FAILED TO UPGRADE

Is this something I will face often? What could be causing this and how to fix it?

I suspect it will always be like this on the standard install.

You can find resources on here to configure a “we’re offline, come back later screen” to mitigate those 20 minutes, but it’s not the standard install and I would suggest you keep things simple and easily supported.

I saw that a few days ago, but it was indeed very complex for me.

I just posted the errors I’m seeing when trying to update now. It crashed again. It’s on my previous reply.

So after it crashed, I clicked the button to restart updating and it’s stuck on this again, which is what happened last night:

Here’s what I noticed, but don’t know if it’s a coincidence: when it gets stuck on that state where nothing happens, I click Reset Update. Try to restart, nothing happens. Then I go back to the page with all the updates, and click the Update button. This time, it starts the update. Not sure if there’s something broken in the code that after a reset, the button to restart, doesn’t actually do anything? I have no clue, but I’m just sharing my experience.

Now it’s updating again, after I did what I just described.

I’m confused now… it crashed again, but when I refreshed the browser it said that Discourse was at the newest version…
When I went to the main updates page where the plugins are, it indeed showed Discourse as being updated :thinking:

Try creating a swap:

It seems that this error message has been very common lately, and was always fixed by creating swap. I don’t know why since Discourse’s official requirements have not changed.

2 לייקים

I’ve seen this word before, but I have no idea what it is and what it is for.

Thank you for sharing that link. I will definitely do that and if I encounter any issue, I will share it.

When I go to DigitalOcean, I see this for my droplet:
image

So I “qualify” for that swapfile process you shared, right? Because my server is <= 2GB of RAM.

לייק 1

If it’s less than 2GB, I would recommended creating a swapfile. Mine is 1GB so I definitely needed one.

From my understanding, swap basically takes some storage and converts it to use as more memory.

2 לייקים

אז ./discourse-setup אמור היה ליצור Swap אוטומטית. אני לא מאוד משכיל בארקדות ניהול המערכות ולכן אשאיר לאחרים לספר יותר על כך.

עם זאת, למרות שיש יותר מהמינימום הדרוש, משתמשים נתקלו בבעיה זו, לכן זה נראה משהו מוזר.

לגבי העדכון מהממשק, מצאתי אותו קצת לא אמין לאורך השנים. אני לא בטוח למה, נראה שלעיתים זה נכשל בלי סיבה ברורה כאשר בנייה מחדש מצליחה.

3 לייקים

Is there a way, via Terminal, to see if there is one already? (Maybe this answers my question? I’m not well versed in the arcanes of system administration)

Ok, so I guess I’m not alone here.

I’m a bit confused… using Terminal are those 2 different things? Update and Rebuild? Because I’ve been using just ./launcher rebuild app and that always works.

לייק 1

Ok thank you. That helps!

2 לייקים

סליחה, התכוונתי מהממשק, תיקנתי את הפוסט שלה. :חייך:

2 לייקים

Oh ok, now it makes sense :slight_smile:
Yes, that’s my experience as well.
The downside is that the rebuild completely shuts down the forum, which is not ideal, but oh well… we gotta do what we gotta do.

לייק 1

I asked Claude about my question if there’s a way to check if there’s a swap file and this is what I got:

UPDATE

Without expertise in this, I used Claude and ChatGPT to help me figure things out. So, as suggested, I went the swapfile route, but as it was pointed out, maybe I had already a swapfile based on how I installed Discourse. To make sure I did, I ran

sudo swapon --show

in Terminal and I got this:

image

So I looked at the “USED” column and thought: “well, if the swapfile is used to help things run smoother when RAM is not enough, but it says the swapfile is using 1.9GB out of 2GB, that will not help

So I asked ChatGPT if I could just clear/empty the swapfile and I got this command:

sudo swapoff -a && sudo swapon -a

Ran it, let it do its thing and ran the other one again:

sudo swapon --show

Now I see this:
image

So I guess that it’s good to go through this process of cleaning/emptying the swapfile once in a while?

Worth trying to increase your swap:

2 לייקים

שחזור משורת הפקודה צורך פחות זיכרון RAM.

עם התקנה של שני מכולות, يمكنك לבנות מכולה חדשה בזמן שהישנה ממשיכה לפעול (אם יש לך מספיק RAM). זה מאפשר לך מִעט זמן השבתה.

אתה צריך לעשות שחזור משורת הפקודה לפעמים כי הספריות היסודיות צריכות להתעדכן ולא ניתן לעשות זאת מה-UX.

אתה יכול

cd /var/discourse
grep swap discourse-setup

כדי לראות את הפקודות שהיא מבצעת ליצירת ה-swap. אם תריץ swapoff (כך שהקובץ לא יהיה בשימוש יותר) אתה יכול להריץ את הפקודות שיוצרות את הקובץ (fsallocate) ולהגדילו, אם רצוי, ולעשות את הפורמט ל-swap (mkswap) ואז swapon -a להפעלת אותו מחדש.

אם יש לך הרבה תוספים, כנראה שתצטרך סך הכל 5 או 6 ג’יגה בייט.

4 לייקים