Update in browser vs Terminal

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 Like

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 Likes

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 Like

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 Likes

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 Like

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 Likes

Then ./discourse-setup should have created a swap automatically. I’m not well versed in the arcanes of system administration so I’ll let others tell more about this.

That said, even with more than the requirements, users have come across this issue, so there’s something fishy.

As for the update from the interface, I’ve found it a bit unreliable over the years. I’m not sure why, it seems it sometimes fails without obvious reason when a rebuild works.

3 Likes

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 Like

Ok thank you. That helps!

2 Likes

Sorry, I meant from the interface, I’ve corrected my post. :slight_smile:

2 Likes

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 Like

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 Likes

Rebuild from the command line takes less ram.

With a two container install, you can build a new container while the old one continues to work (if you have enough ram). That gives you little downtime.

You have to do a command line rebuild sometimes because underlying libraries need to be updated and those can’t be done from the ux.

You can

cd /var/discourse
grep swap discourse-setup

to see the commands that it does to create the swap. If you run swapoff (so that the file is no longer busy) you can then run the commands that create the file (fsallocate) making it bigger, if desired, and format it as swap (mkswap) and then swapon -a to turn it back on.

If you’ve got many plugins you likely need a total of 5 or 6gb.

4 Likes