Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If the theme is missing, admin crashes #981

Closed
pmgarman opened this issue Oct 7, 2013 · 14 comments
Closed

If the theme is missing, admin crashes #981

pmgarman opened this issue Oct 7, 2013 · 14 comments
Assignees
Labels
bug [triage] something behaving unexpectedly
Milestone

Comments

@pmgarman
Copy link
Contributor

pmgarman commented Oct 7, 2013

(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.
@JohnONolan
Copy link
Member

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

@pmgarman
Copy link
Contributor Author

pmgarman commented Oct 8, 2013

@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?

@sebgie
Copy link
Contributor

sebgie commented Oct 8, 2013

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.

@BiosElement
Copy link

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.

@matsilva
Copy link

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.

@halfdan
Copy link
Contributor

halfdan commented Oct 27, 2013

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

@halfdan
Copy link
Contributor

halfdan commented Oct 27, 2013

@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.

@BiosElement
Copy link

@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.

@matsilva
Copy link

@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.

@matsilva
Copy link

Attempt to reproduce**

@ghost ghost assigned ErisDS Nov 28, 2013
@ErisDS
Copy link
Member

ErisDS commented Dec 9, 2013

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

@ErisDS
Copy link
Member

ErisDS commented Dec 15, 2013

This seems to be resolved now.

@alcance
Copy link

alcance commented Jun 2, 2017

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.

@Stono
Copy link

Stono commented Jul 6, 2017

@alcance you saved my ass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly
Projects
None yet
Development

No branches or pull requests

9 participants