Ik blijf foutmeldingen krijgen bij het updaten

Hoe vaak ik ook probeer te updaten, ik krijg altijd de melding Sorry, there was an error updating Discourse. Please check the logs below. wanneer ik via de browser update. Ik moet altijd terugvallen op Terminal en dat is niet goed, want dan moet ik mijn forum altijd ongeveer 30 minuten offline hebben.

Als iemand me hierbij kan helpen, zou dat gewaardeerd worden.

Fouten:

Samenvatting
********************************************************
*** Please be patient, next steps might take a while ***
********************************************************
Cycling Unicorn, to free up memory
Restarting unicorn pid: 603
Waiting for Unicorn to reload.
Waiting for Unicorn to reload..
Waiting for Unicorn to reload...
Waiting for Unicorn to reload....
Waiting for Unicorn to reload.....
Waiting for Unicorn to reload......
Waiting for Unicorn to reload.......
Waiting for Unicorn to reload........
Waiting for Unicorn to reload.........
Waiting for Unicorn to reload..........
Waiting for Unicorn to reload...........
Waiting for Unicorn to reload............
Waiting for Unicorn to reload.............
Waiting for Unicorn to reload..............
Waiting for Unicorn to reload...............
Waiting for Unicorn to reload................
Waiting for Unicorn to reload.................
Waiting for Unicorn to reload..................
Waiting for Unicorn to reload...................
Waiting for Unicorn to reload....................
Waiting for Unicorn to reload.....................
Waiting for Unicorn to reload......................
Waiting for Unicorn to reload.......................
Waiting for Unicorn to reload........................
Waiting for Unicorn to reload.........................
Waiting for Unicorn to reload..........................
Waiting for Unicorn to reload...........................
Waiting for Unicorn to reload............................
Waiting for Unicorn to reload.............................
Waiting for Unicorn to reload..............................
Waiting for Unicorn to reload...............................
$ cd /var/www/discourse && git reset --hard HEAD@{upstream}
HEAD is now at fe1b1edba FIX: removes + from RTE toggle tooltip (#33542)
$ bundle install --retry 3 --jobs 4
Bundle complete! 143 Gemfile dependencies, 190 gems now installed.
Gems in the groups 'test' and 'development' were not installed.
Bundled gems are installed into ./vendor/bundle
3 installed gems you directly depend on are looking for funding.
  Run `bundle fund` for details
$ if [ -f yarn.lock ]; then yarn install; else CI=1 pnpm install; fi
Scope: all 16 workspace projects
Lockfile is up to date, resolution step is skipped
Already up to date

Done in 9.1s using pnpm v9.15.6
$ LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all
discourse-adplugin is already at latest compatible version
discourse-categories-suppressed is already at latest compatible version
discourse-doc-categories is already at latest compatible version
Invalid version list in /var/www/discourse/plugins/discourse-landing-pages
discourse-landing-pages is already at latest compatible version
discourse-solved is already at latest compatible version
docker_manager is already at latest compatible version
$ SKIP_POST_DEPLOYMENT_MIGRATIONS=1 bundle exec rake multisite:migrate
Multisite migrator is running using 1 threads

Migrating default
Seeding default
*** Bundling assets. This will take a while *** 
$ bundle exec rake themes:update assets:precompile
Updating themes with concurrency: 10
[db:default] 'New Topic Header Button' -  checking...
[db:default] 'New Topic Header Button' -  up to date
[db:default] 'Category Banners' -  checking...
[db:default] 'Category Banners' -  up to date
[db:default] 'Clickable Topic' -  checking...
[db:default] 'Clickable Topic' -  up to date
[db:default] 'Tag Banners' -  checking...
[db:default] 'Tag Banners' -  up to date
[db:default] 'Breadcrumb Links' -  checking...
[db:default] 'Breadcrumb Links' -  up to date
[db:default] 'Welcome Link Banner' -  checking...
[db:default] 'Welcome Link Banner' -  up to date
[db:default] 'Tag Icons' -  checking...
[db:default] 'Tag Icons' -  up to date
[db:default] 'Social Share' -  checking...
[db:default] 'Social Share' -  up to date
[db:default] 'Navigation Menu Display Control' -  checking...
[db:default] 'Navigation Menu Display Control' -  up to date
[db:default] 'DiscoTOC' -  checking...
Node.js heap_size_limit is less than 2048MB. Setting --max-old-space-size=2048 and CHEAP_SOURCE_MAPS=1
Existing build is not reusable.
- Existing: {"ember_env"=>"production", "core_tree_hash"=>"c71c1ad482ff7f24c3ad3a76d5a521861f29e1fb"}
- Current: {"ember_env"=>"production", "core_tree_hash"=>"d026d5621e9421eaf67123aab7361a44f0fa9c31"}
Running full core build...
Building
Environment: production
The setting 'staticAddonTrees' will default to true in the next version of Embroider and can't be turned off. To prepare for this you should set 'staticAddonTrees: true' in your Embroider config.
The setting 'staticAddonTestSupportTrees' will default to true in the next version of Embroider and can't be turned off. To prepare for this you should set 'staticAddonTestSupportTrees: true' in your Embroider config.
building...
...[ConfigLoader]
...[Babel: @embroider/macros > applyPatches]
...[Babel: pretty-text > applyPatches]
...[Babel: @ember/legacy-built-in-components > applyPatches]
...[Babel: ember-source > applyPatches]
[BABEL] Note: The code generator has deoptimised the styling of /var/www/discourse/app/assets/javascripts/discourse/ember/ember-template-compiler.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /var/www/discourse/app/assets/javascripts/discourse/ember/ember.js as it exceeds the max of 500KB.
...[Babel: @glimmer/component > applyPatches]
...[Babel: @ember/render-modifiers > applyPatches]
...[Babel: dialog-holder > applyPatches]
...[Babel: ember-this-fallback > applyPatches]
...[Babel: ember-buffered-proxy > applyPatches]
...[Babel: ember-cache-primitive-polyfill > applyPatches]
...[Babel: float-kit > applyPatches]
...[Babel: select-kit > applyPatches]
...[@embroider/compat/app]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
undefined
 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command was killed with SIGKILL (Forced termination): ember build -prod
/var/www/discourse/script/assemble_ember_build.rb:103:in `system': Command failed with exit 1: pnpm (RuntimeError)
	from /var/www/discourse/script/assemble_ember_build.rb:103:in `<main>'
Docker Manager: FAILED TO UPGRADE
#&lt;RuntimeError: RuntimeError&gt;
/var/www/discourse/plugins/docker_manager/lib/docker_manager/upgrader.rb:211:in `run'
/var/www/discourse/plugins/docker_manager/lib/docker_manager/upgrader.rb:112:in `upgrade'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:19:in `block in <main>'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:6:in `fork'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:6:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/commands/runner/runner_command.rb:44:in `load'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/commands/runner/runner_command.rb:44:in `block in perform'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/commands/runner/runner_command.rb:70:in `conditional_executor'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/commands/runner/runner_command.rb:43:in `perform'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/thor-1.3.2/lib/thor/command.rb:28:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/thor-1.3.2/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/command/base.rb:178:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/thor-1.3.2/lib/thor.rb:538:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/command/base.rb:73:in `perform'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/command.rb:71:in `block in invoke'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/command.rb:149:in `with_argv'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/command.rb:69:in `invoke'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/commands.rb:18:in `<main>'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:69:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:69:in `block (2 levels) in replace_require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:18:in `<main>'
Spinning up 1 Unicorn worker(s) that were stopped initially

U moet een groter swapbestand maken.
Ik had hetzelfde probleem. Dit heeft het opgelost.

1 like

Kunt u uitleggen hoe? Ik ben daar niet bekend mee. Ik herinner me dat iemand erover sprak, maar ik denk niet dat ik iets heb veranderd (nou ja, blijkbaar heb ik dat waarschijnlijk niet gedaan en dat is wat dit veroorzaakt).
Dank u

I recommend upgrading from the command line

cd /var/discourse
./launcher rebuild app

You might still have memory problems. If that fails, include the error and the output of

free -h

EDIT: Oops. Sorry, I didn’t read carefully enough:

Add swap is what to do. The way that I do it is

cd /var/discourse
grep swap discourse-setup

Then you can see the commands that discourse-setup uses to create the swap space.

Then you can do something like

./launcher stop app # if you don't you probably can't turn off swap
swapoff /swapfile # now you found the name of the file was /swapfile
fallocate -l -4GB /swapfile # adjusted from the one in the output
mkswap /swapfile # this "formats" the swap partiion

You can skip the other stuff about adding it to fstab and such, and just turn it back on:

swapon /swapfile
./launcher start app

Then you can check with

free -h

If you have no swap file, then you can run ./discourse-setup and it’ll add it for you and you can control-c when it starts asking you questions.

2 likes

Gebruik Google of YouTube:
“Linux swap file”

1 like

Here’s Digital Oceans guide:

You usually need to add as much swap as you have RAM.

1 like

https://meta.discourse.org/search?context=topic&context_id=373634&q=Node.js%20heap_size_limit%20is%20less%20than%202048MB&skip_context=true

1 like

Updates
After a few conversations with Claude, here’s what’s happening:

I initially had this

sudo swapon --show
NAME      TYPE SIZE USED PRIO
/swapfile file   2G   1G   -2

That was still causing the error.

So I was able to increase it to 4GB, I believe:

sudo swapon --show
NAME      TYPE SIZE   USED PRIO
/swapfile file   4G 714.4M   -2

Now, here’s what’s strange: while I was doing this, I went back to the update page and to my surprise, everything was updated…
How is that possible, if it was showing me that error? :confused:

Anyway, I now at least understand that a swapfile is related to disk space, not RAM. I’m using DigitalOcean’s droplet 1GB RAM, 25GB disk.

So I guess having the 4GB swapfile is ok for now?
But still, why did it update, even after showing me that error?

A swapfile is a way to use some of your disk space as very, very slow RAM, so it’s related to both disk space and RAM.

25GB is just barely enough space. You’ll need to do a ./launcher cleanup before pretty much every command line upgrade.

1 like

What I meant was that, when I saw discussions about it, when people said “create a 2GB swapfile” I thought it was related to the amount of RAM, so in my case, I would not be able to do it, because I only have 1GB of RAM. Now, I understand that the swapfile, is in fact disk space, almost like creating a small partition. So, yes, they are related, because they “communicate” with each other when necessary, but I was being more literal with my comment.

That’s all I can afford at the moment and since I still have no real community, that’s enough. I will upgrade as the community grows.

So, you’re saying that before each update, even when using the admin panel to update, I should run ./launcher cleanup via Terminal?

No. Using the admin panel doesn’t make docker make more images it’s not using, but you may not have enough memory (ram plus swap) to do the upgrade from the admin panel.

Dit is allemaal een beetje verwarrend voor mij…
Sommige mensen zeiden dat ze hetzelfde probleem hadden als ik, en dat het maken van het 2GB swapfile hen hielp. Ik heb nu het 4GB swapfile gemaakt, maar dat was nadat ik had geüpdatet, dus ik zal moeten wachten op een nieuwe update om het te testen.

Dus, bijvoorbeeld, zou het goed genoeg zijn als ik zou upgraden naar 2GB RAM, zelfs als de schijfruimte nog steeds 25GB is?

Ik ben hier nog maar net mee begonnen, dus mijn excuses als dit voor de meesten te vanzelfsprekend is. Ik probeer er gewoon achter te komen terwijl ik ermee bezig ben.

1GB machine met 4GB swap zou voldoende moeten zijn.

Ik zou persoonlijk minimaal 2GB met 2GB swap aanbevelen om te beginnen, maar je voldoet aan de gepubliceerde minimale vereisten van een standaardinstallatie.

Ik zou verdergaan en het gebruiken en pas upgraden als je merkt dat dingen te traag zijn.

Je zou nu geen problemen met het geheugen moeten hebben.

2 likes

Except, as you said, HDD will be full quite fast, and cleanup is must to do no matter how much there is RAM.

Bedankt. Voorlopig wil ik gewoon inhoud beginnen toe te voegen en wat gebruikers toevoegen totdat het logisch is om te upgraden.

Off-topic, maar nog steeds gerelateerd aan de schijfruimte: toen ik alles doornam, merkte ik dat ik ongeveer 18 GB gebruikte en toen ik ChatGPT vroeg, zei het dat het normaal was dat Discourse zoveel ruimte innam?

Zo ja, dan zou mijn 25 GB server 18 GB gebruiken voor de installatie + 4 GB voor het swapbestand, waardoor ik niet veel ruimte overhoud. Kunt u dit bevestigen?

Ik ga niet in debat met je robot.

Je hebt gelijk dat de 4 GB uit je beschikbare schijfruimte zal komen (uiteraard).

2 likes

Ik heb zojuist alle mappen gecontroleerd en gemerkt dat 12 GB door deze map wordt gebruikt:

/var/lib/docker/overlay2/

Wat is dit en is het mogelijk om het te verkleinen door mogelijk onnodige bestanden te verwijderen?

Perhaps see previous thread
Discourse upgrade fails due to insufficient disk space on 25G droplet

Perhaps also this thread

1 like

Maybe someone could say something like:

Without any extra context, that initial comment was not very helpful for me. I wasn’t expecting Discourse to use 18GB of disk space when other platforms like phpBB are way lighter (not being an expert, I have no clue why one platform is lighter than the other, but they are different, apparently). So when you said that 25GB is barely enough space without adding more context to it, while there’s nothing on the official installation page that says that Discourse will maybe that N gigs of space, I assumed that the default Digital Ocean 1GB RAM with 25GB was more than enough and maybe bigger communities would struggle with just 25GB. Since mine is just in the beginning, I didn’t see disk space as an issue.

Hope that makes sense.

1 like