CPU spikes due to updates/rebuilds

I just had the oddest experience doing a simple reboot of my Amazon Lightsail instance.

  1. Did the reboot… waited for restart.
  2. Got “502 Gateway Error - Nginx” error message screen on some (I assume uncached) pages). Waited a bit…
  3. Did a discourse rebuild via shell.
  4. Got an error message that rebuild failed.
  5. Use ./discourse-doctor - Also failed.
  6. Disabled non-official plugins and rebuilt - Also failed.

Thought I was screwed. And while doing more research checked the forum again only to find it working okay. Which makes zero sense considering discourse doc’s immediate response was WARNING! App not even running! :slight_smile:

My theory is that this might be more do do with Amazon’s burstable limits that anything else. Being that the reboot may have strained the server and that was causing some initial issue with the 502s, but certainly the rebuild shot my server up to 70-80% of burst limits and maybe there was no system resources to run the rebuild scripts?

So my ultimate question is (as this has been something plaguing the update rebuild process), is there a way to limit the update scripts load on the server and not have it freak out? I mean this is an 8GB Ram instance so it’s not that weak, etc.

Thanks… and now I have taken 2 Ativan for no reason. :smiley:

It’s hard to tell from your description. What errors are you getting when you rebuild?

I try another update soon and update this. I didn’t save the log file and running updates spikes my burst zone pretty badly (especially after running it 3 times), so I needed to wait a day or so to get my burst levels back up.

This seems to be the culprit.

Seeding default
*** Bundling assets. This will take a while *** 
$ RUBY_GC_MALLOC_LIMIT_MAX=20971520 RUBY_GC_OLDMALLOC_LIMIT_MAX=20971520 RUBY_GC_HEAP_GROWTH_MAX_SLOTS=50000 RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=0.9  bundle exec rake themes:update assets:precompile
Updating Dark...
Failed to update Dark
about.json contains invalid values: Maximum discourse version is invalid

And now my forum is completely down and 500 erroring. :frowning:

Why would that happen? I would have thought the update only replaces the current working forum once the process is finalized and doesn’t run into issues?

I don’t know about your original issue, but this is your current issue: Failed to Bootstrap, due to discourse-alt-logo theme component

You should be able to

 ./launcher start app

then go and delete the bad theme component.

But isn’t dark a system theme component? How could a system theme component be causing that kind of issue?

But thanks I will probably be able to fix the issue now that I know what’s going on.

The theme component is deprecated and Discourse refuses to use it.

BUt if you do a ./launcher rebuild app then it takes down the container to build the new one (because it’s using the same database files). If the build fails, then you need to restart the container to get it running again.

Yeah I noted the update actually was complete on all the other elements once I deleted the Dark and Alternate Logos components everything was updated in the update screen.

1 Like