Can't delete deprecated theme component from CLI - failed to bootstrap

I do know that it’s because of Alternative Logos:

I, [2021-06-25T11:00:32.360020 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile'
Failed to update Alternative Logos
about.json contains invalid values: Maximum discourse version is invalid
/var/www/discourse/app/models/remote_theme.rb:169:in `update_from_remote'
/var/www/discourse/lib/tasks/themes.rake:61:in `block (2 levels) in <main>'

I had this component, but because discourse is down I can’t access admin panel to delete this. How can I delete that theme component from command line?

I’m not sure what cleanup does to stopped containers, but you might just ./launcher start app and disable the culprit ( in https://your.domain/admin/customize/themes ) ?

Do you mean the plugins in the app.yml ?

Yup.

I do know that it’s because of Alternative Logos:

I, [2021-06-25T11:00:32.360020 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile'
Failed to update Alternative Logos
about.json contains invalid values: Maximum discourse version is invalid
/var/www/discourse/app/models/remote_theme.rb:169:in `update_from_remote'
/var/www/discourse/lib/tasks/themes.rake:61:in `block (2 levels) in <main>'

I had this component, but because discourse is down I can’t access admin panel to delete this. How can I delete that theme component from command line? I can;t rebuild or start the app, so that’s a bummer.

So:

  • I can’t rebuild because Alternative Logos has about.json max version that I’m above
  • I can’t delete Alternative Logos component without entering the app
  • I can’t enter the app because I can’t rebuild it

Is there any way to do something here? I want to get rid of Alternative Logos component.

Can’t you just start the app, without rebuilding it?

./launcher start app

Unable to find image 'local_discourse/app:latest' locally
docker: Error response from daemon: pull access denied for local_discourse/app, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.

Not really unfortunately

Then maybe git pull but perhaps wait for the cavalry :sweat_smile: (I see Jay replying…)

Nope, git pull does nothing.

Have you tried

  ./launcher start app

Though if you did a ./launcher cleanup while the old container was down and don’t have a container to start then you are in something of a pickle. Is that what you did? It looks like what you did.

I think that it’s a bug that a bad theme component would make it impossible to upgrade, so perhaps a solution will be forthcoming.

I think you could modify the database to remove the theme component, but if you don’t have a container running to let you access the database, I’m not quite sure how you’d do that.

My only other emergency ASAP solution would be to see if you could restore the existing database on a clean installation.

Perhaps you can restore the database to a clean install (maybe it’ll ignore the broken theme?), then delete your database and rebuild a new empty database with upgraded discourse, then restore the database from the remote clean installation.

Another solution would be to create a database-only image and use SQL to remove the broken theme component.

2 Likes

I guess I’m gonna do a fresh install, restore from backup from (and in this .sql backup file I’m gonna make changes to Alternative Logos.

It is a really bad situation though that if a component breaks discourse rebuild you don’t have any other option but reinstall from fresh.

2 Likes

Ok, so the solution was to set up a fresh discourse installation, restore from backup and then delete component that was causing an issue.

3 Likes

I ran into a similar situation this morning, but I was able to simply restart the app.

My site has about 10 themes, all of which have been using the Alternative Logos Component since every theme uses different colored logos to match its color scheme. I see where I can now input the dark theme logos in the site settings. However, if I delete this deprecated component, then where do I add all the other custom logos for the other themes?

I think that the problem is just in the about.json file and that you can fork the theme component to make your own version. But I haven’t looked closely or tried it myself.