# Ghost custom theme error while uploading: Validation error

**URL:** <https://forum.ghost.org/t/ghost-custom-theme-error-while-uploading-validation-error/24034>\
**Category:** Developer help\
**Created:** [July 7, 2021, 10:20pm UTC](https://forum.ghost.org/t/ghost-custom-theme-error-while-uploading-validation-error/24034 "2021-07-07T22:20:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bop](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@bop](https://forum.ghost.org/u/bop)\
**Post date:** [July 7, 2021, 10:20pm UTC](https://forum.ghost.org/t/ghost-custom-theme-error-while-uploading-validation-error/24034/1 "2021-07-07T22:20:20Z")

</div>

I just updated to Ghost 4.9 and my custom theme stopped working. The page started to throw 500 errors and I had to switch back to Casper. When I try to switch back to my theme the API returns a 400.

When I try to upload a new zip with the theme it fails saying “Fail to read zip file”.

When I upload it to Gscan it throws this error:

```auto
Cannot read property 'join' of undefined

ValidationError: Failed to read zip file at new ValidationError (/app/node_modules/ghost-ignition/lib/errors/index.js:141:23) at /app/lib/index.js:34:19

```

I have searched this and it seems to be a problem with the [permissions on the zip file with gulp-zip and Windows](https://forum.ghost.org/t/uploading-theme-fails-to-read-zip-file/14597)? But my build process uses the system `zip` command on macOS Big Sur. Basically this:

```auto
zip -vr dist/my_theme.zip ./ -x '*.DS_Store' -x '*dist*' -x '*.git*' -x '*node_modules*' 

```

I really don’t know what’s going on. I have Ubuntu v18.04.5 LTS on a DigitalOcean machine with node v12.22.2 and ghost-cli 1.17.3.

---

<div class="post-metadata">

**Author:** ![bop](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@bop](https://forum.ghost.org/u/bop)\
**Post date:** [July 7, 2021, 10:26pm UTC](https://forum.ghost.org/t/ghost-custom-theme-error-while-uploading-validation-error/24034/2 "2021-07-07T22:26:20Z")

</div>

For now I’m going back to 4.8.1. I did `ghost update --rollback` and everything works again.

---

<div class="post-metadata">

**Author:** ![Stromfeldt](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/stromfeldt/32/13572_2.png) [@Stromfeldt](https://forum.ghost.org/u/Stromfeldt)\
**Post date:** [July 7, 2021, 10:44pm UTC](https://forum.ghost.org/t/ghost-custom-theme-error-while-uploading-validation-error/24034/3 "2021-07-07T22:44:53Z")

</div>

You’re not the only one. Upon updating (from 4.8.4) I also got the 500 error (which also stated something like “Can’t read theme” or “Can’t find theme”, I forget). I too switched to Casper, which worked, and when I tried to switch back over to the theme that apparently didn’t work the Activate button was unresponsive. So I deleted the theme and tried re-uploading it, which is when I got that “Fail to read zip file” message as well. I tried uploading an entirely different theme, which worked fine. Gscan gave me the same error message as you got when trying to validate the non-uploadable theme:

 ![Screen Shot 2021-07-08 at 5.59.49 am](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/f/f0d3381f3eefd97199180f5b7ad1484dba4fc5bf.png)

Your idea that it might be related to Gulp could very well make sense, seeing how that non-uploadable theme of mine utilises Gulp, while the theme that did manage to upload is not using Gulp.

---

<div class="post-metadata">

**Author:** ![naz](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/naz/32/30666_2.png) [@naz](https://forum.ghost.org/u/naz)\
**Post date:** [July 8, 2021, 5:18am UTC](https://forum.ghost.org/t/ghost-custom-theme-error-while-uploading-validation-error/24034/4 "2021-07-08T05:18:10Z")

</div>

Hey @bop @Stromfeldt can you please get a more detailed logs from your instances when the error happens?

The `Cannot read property 'join' of undefined` is a useful clue. Would need to get a stacktrace from the error to find out exactly where it’s happening. Given your themes are private, would be good to find out which piece of code in your themes causes this error, so we could have a reproducible example. Thanks!

---

<div class="post-metadata">

**Author:** ![bop](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@bop](https://forum.ghost.org/u/bop)\
**Post date:** [July 9, 2021, 6:22pm UTC](https://forum.ghost.org/t/ghost-custom-theme-error-while-uploading-validation-error/24034/5 "2021-07-09T18:22:45Z")

</div>

@naz Thanks for reply! Luckily I just saw the commits for [4.9.2](https://github.com/TryGhost/Ghost/releases/tag/v4.9.2) and I can confirm that the new release fixes the bug. Everything is working fine now and I’m fully updated!

---

<div class="post-metadata">

**Author:** ![justinv](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/justinv/32/13141_2.png) [@justinv](https://forum.ghost.org/u/justinv)\
**Post date:** [July 9, 2021, 7:15pm UTC](https://forum.ghost.org/t/ghost-custom-theme-error-while-uploading-validation-error/24034/6 "2021-07-09T19:15:11Z")

</div>

Not sure if this is the same issue, but I’m getting a ‘name is not defined’ error when uploading a theme. It’s pretty weird, since I get the same error even when I download the current theme and re-upload it (without any changes).

Hosted w/ Ghost Pro on what I believe is the latest up-to-date instance.

 ![Screen Shot 2021-07-09 at 12.13.34 PM](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/3/37dea6a5c9248fafed4710894e079ac6776e06a2.jpeg)

---

<div class="post-metadata">

**Author:** ![naz](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/naz/32/30666_2.png) [@naz](https://forum.ghost.org/u/naz)\
**Post date:** [July 14, 2021, 10:50am UTC](https://forum.ghost.org/t/ghost-custom-theme-error-while-uploading-validation-error/24034/7 "2021-07-14T10:50:30Z")

</div>

Hey @justinv. That error has been fixed in the latest patch release:

> **[Release 4.9.4 · TryGhost/Ghost](https://github.com/TryGhost/Ghost/releases/tag/v4.9.4)**
>
> 🐛 Fixed name is not defined error when uploading invalid theme - Vikas Potluri
> 
> 
> View the changelogs for full details:
> 
> Ghost - v4.9.3...v4.9.4
> Admin - TryGhost/Admin@v4.9.3...v4.9.4

---

<div class="post-metadata">

**Author:** ![justinv](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/justinv/32/13141_2.png) [@justinv](https://forum.ghost.org/u/justinv)\
**Post date:** [July 15, 2021, 8:09pm UTC](https://forum.ghost.org/t/ghost-custom-theme-error-while-uploading-validation-error/24034/8 "2021-07-15T20:09:55Z")

</div>

Awesome, thanks so much @naz! This fixed it for me.
