Can't change Ghost theme: Validation (FieldIsRequired) failed for ref

Hi there,

Just set up a fresh install of Ghost on a VPS.

All working fine except when I try to change to a different theme in the admin dashboard the theme does not change from the default Capser to Source which is what I want.

What is particularly weird is that the font changes if I switch to, say, ‘Taste’ theme, but nothing else does.

What I have tried

  • Restarting Ghost after changing the theme
  • Waiting a couple of hours after changing the theme
  • Accessing the site from different browsers and devices (Firefox, Librewolf, Vanadium, Edge) - including mobile
  • Manually uploading the theme
  • Searching for similar situations on this forum and online
  • Running ghost doctor
  • Activating different themes

Screenshot example
(Note the theme text in the bottom right)

Any errors in the browser console (press f12 to open)?

Any errors in Ghost’s logs on the server?

No errors in the browser console when I load the website. These errors are in the admin window for customising the theme:

downloadable font: Glyph bbox was incorrect (glyph ids 1 2 3 4 5 8 9 10 11 12 13 14 16 17 19 22 24 28 32 34 35 38 39 40 43 44 45 46 47 48 49 55 56 58 59 61 63 64 68 76 77 78 82 83 84 85 92 103 108 109 110 113 115 122 123 128 131 134 135 152 155 162 163 164 168 170 171 173 175 176 177 184 187 192 197 202 203 210 213 216 217 218 220 221 223 226 227 234 235 237 238 243 245 247 249 250 254 265 267 268 270 271 272 273 276 277 279 280 283 284 288 291 292 295 297 298 299 302 303 306 309 313 314 317 322 328 329 330 335 336 338 341 343 346 347 350 352 356 357 358 359 364 367 370 371 373 379 381 382 384 388 391 393 394 395 396 398 399 403 405 408 409 410 417 419 420 421 422 437 438 441 446 447 449 453 454 458 460 461 462 465 470 475 477 478 479 482 485 490 491 492 493 496 498 501 502 504 506 507 508 509 511 512 517) (font-family: "Font Awesome 6 Brands" style:normal weight:400 stretch:100 src index:0) source: https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/webfonts/fa-brands-400.woff2
InstallTrigger is deprecated and will be removed in the future. constants.js:50:15
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. srcdoc
Source map error: request failed with status 404
Resource URL: https://<snip>.com/ghost/assets/chunk.763.bd01d249eecdcce3856c.js
Source Map URL: chunk.763.bd01d249eecdcce3856c.map

Source map error: request failed with status 404
Resource URL: https://<snip>.com/ghost/assets/koenig-lexical/koenig-lexical.umd.js?v=c1a8c8a94f
Source Map URL: koenig-lexical.umd.js.map

Source map error: request failed with status 404
Resource URL: https://<snip>.com/ghost/assets/admin-x-settings/modals-ae924d1e.mjs
Source Map URL: modals-ae924d1e.mjs.map

Source map error: request failed with status 404
Resource URL: https://<snip>.com/ghost/assets/admin-x-settings/index-d4d158b7.mjs
Source Map URL: index-d4d158b7.mjs.map

Source map error: request failed with status 404
Resource URL: https://<snip>.com/ghost/assets/ghost-ea7a51891dfca9b7a04aacfffe7dea4e.js
Source Map URL: ghost-04d7dbe1591b23d98da6e61d0950e5ae.map

Source map error: request failed with status 404
Resource URL: https://<snip>.com/ghost/assets/vendor-43a631b7c834235c4ff0b2186b5ca27d.js
Source Map URL: vendor-d101e8f704a5e36b553c9b65b75cd58d.map

Source map error: request failed with status 404
Resource URL: https://<snip>.com/ghost/assets/admin-x-settings/index-8d67ef5d.mjs
Source Map URL: index-8d67ef5d.mjs.map

Source map error: request failed with status 404
Resource URL: https://<snip>.com/ghost/assets/chunk.524.c3472d95b4bd1a45a18d.js
Source Map URL: chunk.524.c3472d95b4bd1a45a18d.map

Source map error: Error: URL constructor:  is not a valid URL.
Resource URL: about:srcdoc
Source Map URL: 

Source map error: Error: request failed with status 404
Resource URL: https://<snip>.com/ghost/assets/admin-x-settings/modals-ae924d1e.mjs
Source Map URL: modals-ae924d1e.mjs.map

Source map error: Error: request failed with status 404
Resource URL: https://<snip>.com/ghost/assets/admin-x-settings/index-d4d158b7.mjs
Source Map URL: index-d4d158b7.mjs.map

Ghost server logs from production.error.log are here: https://send.vis.ee/download/66f50759149d30a9/#ECAR5VFU1UYbpEQCh0_gcQ

That’s just complaints about source maps, which can be ignored. I’m specifically looking for an error when you select a new theme to activate. Can you go through the activation process for a theme and see if you trigger anything?

From the logs you posted, I see this type of error repeatedly. I’ll paste it here for the convenience of those who come after, in hopes of making it easier to help you!

{"name":"Log","hostname":"travelwebsite","pid":71131,"level":50,"version":"5.80.2","req":{"meta":{"requestId":"df62256a-0e55-4791-ab39-74c5fbc8c36f","userId":"1"},"url":"/themes/install/?source=github","method":"POST","originalUrl":"/ghost/api/admin/themes/install/?source=github","params":{},"headers":{"x-forwarded-for":"103.137.14.180","x-forwarded-proto":"https","x-real-ip":"103.137.14.180","host":"philsmelbourne.com","connection":"close","content-length":"0","user-agent":"Mozilla/5.0 (X11; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0","accept":"*/*","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate, br","app-pragma":"no-cache","x-ghost-version":"5.80","referer":"https://philsmelbourne.com/ghost/","origin":"https://philsmelbourne.com","dnt":"1","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","cookie":"**REDACTED**"},"query":{"source":"github"}},"res":{"_headers":{"x-powered-by":"Express","content-version":"v5.80","vary":"Accept-Version, Origin, Accept-Encoding","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0","access-control-allow-origin":"https://philsmelbourne.com","content-type":"application/json; charset=utf-8","content-length":"231","etag":"W/\"e7-oM4luXmSnHrBN08/1Js4XChXoJU\""},"statusCode":422,"responseTime":"6ms"},"err":{"id":"f114fdc0-e1e1-11ee-a21c-09046dd9bf18","domain":"https://philsmelbourne.com","code":null,"name":"ValidationError","statusCode":422,"level":"normal","message":"Validation (FieldIsRequired) failed for ref","stack":"ValidationError: Validation (FieldIsRequired) failed for ref\n    at /var/www/travel/versions/5.80.2/node_modules/@tryghost/api-framework/lib/validators/input/all.js:38:25\n    at /var/www/travel/versions/5.80.2/node_modules/lodash/lodash.js:4967:15\n    at baseForOwn (/var/www/travel/versions/5.80.2/node_modules/lodash/lodash.js:3032:24)\n    at /var/www/travel/versions/5.80.2/node_modules/lodash/lodash.js:4936:18\n    at Function.forEach (/var/www/travel/versions/5.80.2/node_modules/lodash/lodash.js:9410:14)\n    at validate (/var/www/travel/versions/5.80.2/node_modules/@tryghost/api-framework/lib/validators/input/all.js:36:7)\n    at Object.all (/var/www/travel/versions/5.80.2/node_modules/@tryghost/api-framework/lib/validators/input/all.js:96:32)\n    at allShared (/var/www/travel/versions/5.80.2/node_modules/@tryghost/api-framework/lib/validators/handle.js:34:37)\n    at sequence (/var/www/travel/versions/5.80.2/node_modules/@tryghost/promise/lib/sequence.js:16:33)\n    at module.exports.input (/var/www/travel/versions/5.80.2/node_modules/@tryghost/api-framework/lib/validators/handle.js:66:12)\n    at doValidation (/var/www/travel/versions/5.80.2/node_modules/@tryghost/api-framework/lib/pipeline.js:38:42)\n    at sequence (/var/www/travel/versions/5.80.2/node_modules/@tryghost/promise/lib/sequence.js:16:33)\n    at Object.input (/var/www/travel/versions/5.80.2/node_modules/@tryghost/api-framework/lib/pipeline.js:45:20)\n    at getResponse (/var/www/travel/versions/5.80.2/node_modules/@tryghost/api-framework/lib/pipeline.js:250:41)\n    at wrapper (/var/www/travel/versions/5.80.2/node_modules/@tryghost/api-framework/lib/pipeline.js:258:36)\n    at Http (/var/www/travel/versions/5.80.2/node_modules/@tryghost/api-framework/lib/http.js:64:34)","hideStack":false},"msg":"Validation (FieldIsRequired) failed for ref","time":"2024-03-14T09:05:02.367Z","v":0}

Thanks for the reply.

I went through the theme activation process and these are the errors from the Developer Console:

InstallTrigger is deprecated and will be removed in the future. constants.js:50:15
Failed to get subsystem status for purpose 
Object { rejected: true, message: Error }
content-script.js:95:21
InstallTrigger is deprecated and will be removed in the future. constants.js:50:15
Failed to get subsystem status for purpose 
Object { rejected: true, message: Error }
content-script.js:95:21
InstallTrigger is deprecated and will be removed in the future. constants.js:50:15
Referrer Policy: Ignoring the less restricted referrer policy “no-referrer-when-downgrade” for the cross-site request: https://cdn.jsdelivr.net/ghost/portal@~2.37/umd/portal.min.js portal.min.js
Referrer Policy: Ignoring the less restricted referrer policy “no-referrer-when-downgrade” for the cross-site request: https://cdn.jsdelivr.net/ghost/sodo-search@~1.1/umd/sodo-search.min.js sodo-search.min.js
Referrer Policy: Ignoring the less restricted referrer policy “no-referrer-when-downgrade” for the cross-site request: https://static.ghost.org/v5.0.0/images/publication-cover.jpg publication-cover.jpg
Failed to get subsystem status for purpose 
Object { rejected: true, message: Error }
content-script.js:95:21
downloadable font: Glyph bbox was incorrect (glyph ids 1 2 3 4 5 8 9 10 11 12 13 14 16 17 19 22 24 28 32 34 35 38 39 40 43 44 45 46 47 48 49 55 56 58 59 61 63 64 68 76 77 78 82 83 84 85 92 103 108 109 110 113 115 122 123 128 131 134 135 152 155 162 163 164 168 170 171 173 175 176 177 184 187 192 197 202 203 210 213 216 217 218 220 221 223 226 227 234 235 237 238 243 245 247 249 250 254 265 267 268 270 271 272 273 276 277 279 280 283 284 288 291 292 295 297 298 299 302 303 306 309 313 314 317 322 328 329 330 335 336 338 341 343 346 347 350 352 356 357 358 359 364 367 370 371 373 379 381 382 384 388 391 393 394 395 396 398 399 403 405 408 409 410 417 419 420 421 422 437 438 441 446 447 449 453 454 458 460 461 462 465 470 475 477 478 479 482 485 490 491 492 493 496 498 501 502 504 506 507 508 509 511 512 517) (font-family: "Font Awesome 6 Brands" style:normal weight:400 stretch:100 src index:0) source: https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/webfonts/fa-brands-400.woff2
InstallTrigger is deprecated and will be removed in the future. constants.js:50:15
Failed to get subsystem status for purpose 
Object { rejected: true, message: Error }
content-script.js:95:21
onmozfullscreenchange is deprecated. index-d4d158b7.mjs:4710:27
onmozfullscreenerror is deprecated. index-d4d158b7.mjs:4710:27
Source map error: Error: request failed with status 404
Resource URL: https://<snip>.com/ghost/assets/admin-x-settings/index-d4d158b7.mjs
Source Map URL: index-d4d158b7.mjs.map
InstallTrigger is deprecated and will be removed in the future. constants.js:50:15
InstallTrigger is deprecated and will be removed in the future. constants.js:50:15
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. blank
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. blank
Failed to get subsystem status for purpose 
Object { rejected: true, message: Error }
content-script.js:95:21
Failed to get subsystem status for purpose 
Object { rejected: true, message: Error }
content-script.js:95:21
Referrer Policy: Ignoring the less restricted referrer policy “no-referrer-when-downgrade” for the cross-site request: https://cdn.jsdelivr.net/ghost/portal@~2.37/umd/portal.min.js modals-ae924d1e.mjs:16091:89
Referrer Policy: Ignoring the less restricted referrer policy “no-referrer-when-downgrade” for the cross-site request: https://cdn.jsdelivr.net/ghost/sodo-search@~1.1/umd/sodo-search.min.js modals-ae924d1e.mjs:16091:89
Source map error: Error: request failed with status 404
Resource URL: https://<snip>.com/ghost/assets/admin-x-settings/modals-ae924d1e.mjs
Source Map URL: modals-ae924d1e.mjs.map
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. srcdoc
InstallTrigger is deprecated and will be removed in the future. constants.js:50:15
Failed to get subsystem status for purpose 
Object { rejected: true, message: Error }
content-script.js:95:21
Source map error: Error: URL constructor:  is not a valid URL.
Resource URL: about:srcdoc
Source Map URL: 
Content-Security-Policy warnings 2
Referrer Policy: Ignoring the less restricted referrer policy “no-referrer-when-downgrade” for the cross-site request: https://cdn.jsdelivr.net/ghost/portal@~2.37/umd/portal.min.js portal.min.js
Referrer Policy: Ignoring the less restricted referrer policy “no-referrer-when-downgrade” for the cross-site request: https://js.stripe.com/v3/ v3
Referrer Policy: Ignoring the less restricted referrer policy “no-referrer-when-downgrade” for the cross-site request: https://cdn.jsdelivr.net/ghost/sodo-search@~1.1/umd/sodo-search.min.js sodo-search.min.js
Partitioned cookie or storage access was provided to “https://source.ghost.io/” because it is loaded in the third-party context and dynamic state partitioning is enabled.
patchWindow disabled. patchWindow.js:103:13
Content-Security-Policy: The page’s settings blocked the loading of a resource at data: (“media-src”). 4 source.ghost.io
InstallTrigger is deprecated and will be removed in the future. constants.js:50:15
Referrer Policy: Ignoring the less restricted referrer policy “no-referrer-when-downgrade” for the cross-site request: https://cdn.jsdelivr.net/ghost/portal@~2.37/umd/portal.min.js portal.min.js
Loading failed for the <script> with source “https://cdn.jsdelivr.net/ghost/portal@~2.37/umd/portal.min.js”. source.ghost.io:85:259
Referrer Policy: Ignoring the less restricted referrer policy “no-referrer-when-downgrade” for the cross-site request: https://js.stripe.com/v3/ v3
Loading failed for the <script> with source “https://js.stripe.com/v3/”. source.ghost.io:148:56
Referrer Policy: Ignoring the less restricted referrer policy “no-referrer-when-downgrade” for the cross-site request: https://cdn.jsdelivr.net/ghost/sodo-search@~1.1/umd/sodo-search.min.js sodo-search.min.js
Loading failed for the <script> with source “https://cdn.jsdelivr.net/ghost/sodo-search@~1.1/umd/sodo-search.min.js”. source.ghost.io:149:277
Loading failed for the <script> with source “https://source.ghost.io/public/cards.min.js?v=0deb9c9cdc”. source.ghost.io:152:59
Loading failed for the <script> with source “https://source.ghost.io/public/member-attribution.min.js?v=0deb9c9cdc”. source.ghost.io:154:72
Loading failed for the <script> with source “https://source.ghost.io/assets/built/source.js?v=0deb9c9cdc”. source.ghost.io:991:52
Content-Security-Policy: The page’s settings blocked the loading of a resource at inline (“script-src-elem”). 4 source.ghost.io:20:13
Content-Security-Policy: The page’s settings blocked the loading of a resource at https://cdn.jsdelivr.net/ghost/portal@~2.37/umd/portal.min.js (“script-src-elem”). 4 source.ghost.io
Content-Security-Policy: The page’s settings blocked the loading of a resource at https://js.stripe.com/v3/ (“script-src-elem”). 4 source.ghost.io
Content-Security-Policy: The page’s settings blocked the loading of a resource at https://cdn.jsdelivr.net/ghost/sodo-search@~1.1/umd/sodo-search.min.js (“script-src-elem”). 4 source.ghost.io
Content-Security-Policy: The page’s settings blocked the loading of a resource at https://source.ghost.io/public/cards.min.js?v=0deb9c9cdc (“script-src-elem”). 4 source.ghost.io
Content-Security-Policy: The page’s settings blocked the loading of a resource at https://source.ghost.io/public/member-attribution.min.js?v=0deb9c9cdc (“script-src-elem”). 4 source.ghost.io
Content-Security-Policy: The page’s settings blocked the loading of a resource at https://source.ghost.io/assets/built/source.js?v=0deb9c9cdc (“script-src-elem”). 4 source.ghost.io
Content-Security-Policy: The page’s settings blocked the loading of a resource at inline (“script-src-elem”). 4 content-script.js:40:66
Failed to get subsystem status for purpose 
Object { rejected: true, message: Error }
content-script.js:95:21
downloadable font: download failed (font-family: "Inter" style:normal weight:100..900 stretch:100 src index:0): status=2147500036 source: https://source.ghost.io/assets/fonts/inter-roman.woff2
InstallTrigger is deprecated and will be removed in the future. constants.js:50:15
InstallTrigger is deprecated and will be removed in the future. constants.js:50:15
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. blank
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. blank
Failed to get subsystem status for purpose 
Object { rejected: true, message: Error }
content-script.js:95:21
Failed to get subsystem status for purpose 
Object { rejected: true, message: Error }
content-script.js:95:21
Referrer Policy: Ignoring the less restricted referrer policy “no-referrer-when-downgrade” for the cross-site request: https://cdn.jsdelivr.net/ghost/portal@~2.37/umd/portal.min.js modals-ae924d1e.mjs:16091:89
Referrer Policy: Ignoring the less restricted referrer policy “no-referrer-when-downgrade” for the cross-site request: https://cdn.jsdelivr.net/ghost/sodo-search@~1.1/umd/sodo-search.min.js modals-ae924d1e.mjs:16091:89
InstallTrigger is deprecated and will be removed in the future. constants.js:50:15
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. srcdoc
Failed to get subsystem status for purpose 
Object { rejected: true, message: Error }
content-script.js:95:21
Source map error: Error: URL constructor:  is not a valid URL.
Resource URL: about:srcdoc
Source Map URL: 

In my research on this problem I came across this which seems like a similar issue: New instance - Error prevents Theme change (Validation (FieldIsRequired) failed for ref) · Issue #13715 · TryGhost/Ghost · GitHub

However the fix - namely changing the theme in a non-Firefox / non-Clear URLs browser - does not work for me. Is there anything else I should try?

Can anyone help with this?

After many days of pain, I have found what I wouldn’t call a ‘solution’ to this problem but a workaround.

I nuked my entire VPS and reinstalled everything from the ground up.

So good luck to anyone else who finds this in the future and you have a similar problem.