Ghost: New instance - Error prevents Theme change (Validation (FieldIsRequired) failed for ref)

Issue Summary

New installation on a brand new server. Error appears while trying to apply a (any) theme.

Screenshot 2021-11-05 at 23 30 15
[2021-11-05 22:18:20] INFO "GET /ghost/api/canary/admin/themes/" 200 63ms
[2021-11-05 22:18:21] ERROR "POST /ghost/api/canary/admin/themes/install/?source=github" 422 14ms

NAME: ValidationError
MESSAGE: Validation (FieldIsRequired) failed for ref

level: normal

ValidationError: Validation (FieldIsRequired) failed for ref
    at /var/www/ghost/versions/4.22.0/core/server/api/shared/validators/input/all.js:39:25
    at /var/www/ghost/versions/4.22.0/node_modules/lodash/lodash.js:4967:15
    at baseForOwn (/var/www/ghost/versions/4.22.0/node_modules/lodash/lodash.js:3032:24)
    at /var/www/ghost/versions/4.22.0/node_modules/lodash/lodash.js:4936:18
    at Function.forEach (/var/www/ghost/versions/4.22.0/node_modules/lodash/lodash.js:9410:14)
    at validate (/var/www/ghost/versions/4.22.0/core/server/api/shared/validators/input/all.js:37:7)
    at Object.all (/var/www/ghost/versions/4.22.0/core/server/api/shared/validators/input/all.js:97:32)
    at allShared (/var/www/ghost/versions/4.22.0/core/server/api/shared/validators/handle.js:35:37)
    at /var/www/ghost/versions/4.22.0/node_modules/@tryghost/promise/lib/sequence.js:10:31
    at tryCatcher (/var/www/ghost/versions/4.22.0/node_modules/bluebird/js/release/util.js:16:23)
    at Object.gotValue (/var/www/ghost/versions/4.22.0/node_modules/bluebird/js/release/reduce.js:168:18)
    at Object.gotAccum (/var/www/ghost/versions/4.22.0/node_modules/bluebird/js/release/reduce.js:155:25)
    at Object.tryCatcher (/var/www/ghost/versions/4.22.0/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/var/www/ghost/versions/4.22.0/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/var/www/ghost/versions/4.22.0/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromiseCtx (/var/www/ghost/versions/4.22.0/node_modules/bluebird/js/release/promise.js:641:10)

To Reproduce

Goto {hostname}/ghost/#/settings/design/change-theme/Journal then click on “Use Journal” at the top right of the screen

/var/www/ghost$ ghost doctor
✔ Checking system Node.js version - found v14.18.1
✔ Checking logged in user
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking system compatibility
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_aviational-net
Instance is currently running
ℹ Validating config [skipped]
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
✔ Checking systemd unit file
✔ Checking systemd node version - found v14.18.1

Technical details:

  • Ghost Version: v4.22.0 / Cli: v1.18.0
  • Node Version: v14.18.1
  • Browser/OS: Chrome 95.0.4638.69 (Official Build) (arm64) / ubuntu0.20.04.1
  • Database: 8.0.27-0ubuntu0.20.04.1

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 4
  • Comments: 17 (5 by maintainers)

Most upvoted comments

I was able to pinpoint the issue. Once I disabled the ClearURLs extension, the error disappeared. Does changing themes require sending a querystring by any chance?

Yes, a query param (?ref=) is required for theme installation in Admin - thanks for the feedback, and I’m pleased you resolved your issue.

I’ll close this for now as the previous report was over 6 months ago, but happy to reopen if anyone else is still experiencing the same problem.

Had this problem but as mentioned, it came from the ClearURLs extension.

I wouldn’t consider this issue solved. Switching to Chromium is a workaround, but users shouldn’t have to change their browsers to perform a common action like switching a theme.

Yes, a query param (?ref=) is required for theme installation in Admin - thanks for the feedback, and I’m pleased you resolved your issue.

I’ll close this for now as the previous report was over 6 months ago, but happy to reopen if anyone else is still experiencing the same problem.

Your tip about a vanilla browser worked for me! I’m a Firefox user and it wasn’t working. I disabled all my extensions and the built-in tracking protection, but still no luck. Installed Chromium (shudder) and everything works fine. Not a solution, per se, but a good workaround while the Ghost team investigates.

@ShivanS93 FYI you can download other Themes from the internet and upload them. Then, under Advanced in the Theme selection area you can switch between the themes you have uploaded yourself. That way you won’t be stuck on Casper if you don’t want to be.