Ghost: If the theme is missing, admin crashes

Created on 7 Oct 2013  路  14Comments  路  Source: TryGhost/Ghost

(On the latest nightly)

If you remove or rename a theme's directory and then restart Ghost everything is blank. Template issues like this should probably not crash the backend, letting the user go in and pick a new theme.

http://c.pmgr.mn/AgWF

Terminal Output

ERROR: The currently active theme GhostBacker is missing.


ERROR: The currently active theme GhostBacker is missing.
ErrorPage
Ghost caught a processing error in the middleware layer.

Error: The currently active theme GhostBacker is missing.
    at Object.errors.throwError (/home/pmgarman/ghost/core/server/errorHandling.js:26:19)
    at Object.errors.logAndThrowError (/home/pmgarman/ghost/core/server/errorHandling.js:69:14)
    at Object.manageAdminAndTheme [as handle] (/home/pmgarman/ghost/core/server.js:214:24)
    at next (/home/pmgarman/ghost/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at next (/home/pmgarman/ghost/node_modules/express/node_modules/connect/lib/proto.js:165:78)
    at next (/home/pmgarman/ghost/node_modules/express/node_modules/connect/lib/proto.js:165:78)
    at next (/home/pmgarman/ghost/node_modules/express/node_modules/connect/lib/proto.js:165:78)
    at Object.favicon [as handle] (/home/pmgarman/ghost/node_modules/express/node_modules/connect/lib/middleware/favicon.js:77:7)
    at next (/home/pmgarman/ghost/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at Object.logger (/home/pmgarman/ghost/node_modules/express/node_modules/connect/lib/middleware/logger.js:156:5) 


ERROR: Theme error template not found
Add an error.hbs template to the theme for customised errors.
bug

Most helpful comment

I downloaded casper theme, added some js files and then uploaded again. My instance is in Heroku, i think the dyno just deleted the files and now ghost cannot find it. I am getting:

500 The currently active them casper-2 is missing.

I cannot access the admin in order to change it. What can I do?

UPDATE I was able to access the admin using: https://*/ghost/1/, then just activated previous theme.

All 14 comments

There shouldn't be any UI to handle this - but it should attempt to fallback to a default theme.

@JohnONolan Agreed that a UI isn't needed to handle this, but the admin shouldn't die when the theme is missing. All that needs to happen is not crash and allow the user to go pick their new theme or even just hit save where it would go back to the default theme.

Should Ghost still run on the frontend without the theme falling back to the default? or throw the error that the theme wasn't found?

Then what to do if the default theme isn't there?

I have to double check, but as far as I know the fallback if the activeTheme is not found is to capser. If no theme is found the application doesn't start. It is currently not possible to start without a valid theme. Making this possible would require some investigation. I think that starting without a theme would make sense if there is a way to upload themes using the GUI.

In addition to the original post, the admin UI also crashes if a plugin theme has capital letters in it's folder name. Note that the theme is still detected by Ghost and allows you to choose it, which makes this a particularly annoying bug.

This happen to me as well, I changed the casing of the active theme and admin crashed.
Just so everyone knows, to fix this, rename the theme back to the original and restart ghost.

@BiosElement / @matsilva: On which OS are you? It works fine for me on Linux/Mac.

@pmgarman Everything works for me on current master (deleted theme, restarted Ghost, backend works and allows me to select new theme). Can you re-evaluate the issue? Otherwise I would vote for closing this as fixed/worksforme.

@halfdan I'm running Linux. It does appear to have been fixed and in-fact does not crash and works fine with Caps. I believe this has been fixed at some point.

@halfdan Mac OS X Maverick.
I haven't tested it since my last comment, if I have time I will update and reproduce the error.

Attempt to reproduce**

I can no longer reproduce this, unless partials are involved. Leaving it open until @Gotvich's #1606 is merged.

This seems to be resolved now.

I downloaded casper theme, added some js files and then uploaded again. My instance is in Heroku, i think the dyno just deleted the files and now ghost cannot find it. I am getting:

500 The currently active them casper-2 is missing.

I cannot access the admin in order to change it. What can I do?

UPDATE I was able to access the admin using: https://*/ghost/1/, then just activated previous theme.

@alcance you saved my ass.

Was this page helpful?
0 / 5 - 0 ratings