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.
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.
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.
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.
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
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.
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.
Oh ok, now it makes sense
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.
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:
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:
So I guess that it’s good to go through this process of cleaning/emptying the swapfile once in a while?
עם התקנה של שני מכולות, يمكنك לבנות מכולה חדשה בזמן שהישנה ממשיכה לפעול (אם יש לך מספיק RAM). זה מאפשר לך מִעט זמן השבתה.
אתה צריך לעשות שחזור משורת הפקודה לפעמים כי הספריות היסודיות צריכות להתעדכן ולא ניתן לעשות זאת מה-UX.
אתה יכול
cd /var/discourse
grep swap discourse-setup
כדי לראות את הפקודות שהיא מבצעת ליצירת ה-swap. אם תריץ swapoff (כך שהקובץ לא יהיה בשימוש יותר) אתה יכול להריץ את הפקודות שיוצרות את הקובץ (fsallocate) ולהגדילו, אם רצוי, ולעשות את הפורמט ל-swap (mkswap) ואז swapon -a להפעלת אותו מחדש.
אם יש לך הרבה תוספים, כנראה שתצטרך סך הכל 5 או 6 ג’יגה בייט.