A user named hdng is encountering an Error 422 when running discourse_theme watch ., stating that about.json does not exist or is invalid — despite confirming the file’s presence, correct formatting, encoding, and directory structure. They’ve ruled out theme corruption by testing with a freshly generated theme via discourse_theme new. chapoi suggests verifying API key settings, specifically ensuring it’s global and assigned to a specific user — which hdng confirms they’ve already done, even testing with new keys tied to admin/moderator accounts. awesomerobot proposes checking the ~/.discourse_theme config file for malformed entries or escape characters, particularly if using bracketed paste mode in terminal emulators. hdng inspects the file and finds odd syntax (e.g., ! '':), cleans it up, but still experiences the same error. The issue remains unresolved, with suspicions pointing toward configuration file corruption or hidden terminal-related formatting issues, despite valid theme and API setup.
I have authors and the version numbers in there too
The encoding is correct
All directories exist
I thought possibly it could be the API permissions, but if I’m connected and the scopes in admin/api/keys/settings are correct and present, then surely it can’t be?
Basically, I’m stuck. Please can someone point me in the right direction?
I remember something similar that was still an API problem: can you check the setting of your API key, it has to be set to global & set it to a specific user, not to all users.
Thanks for the reply. The API key that I was using was already set to global and to a specific user.
However, I have created 2 new ones against some moderators/admins (just in case it didn’t like the current admin user) and I’m having the same results again.
Sorry just to update this, I’ve also created a brand new theme discourse_theme new <dir> and again it falls over when I run the watch command, so that rules out that there’s an issue with the theme (as you mentioned before)
Unfortunately, that’s the extend of my “how-to-run” things setup knowledge
I’m sure a more knowledgeable person will be able to help you out soon.
I’ve mainly seen that error when trying to run the command on a plugin (which won’t work) but you say it’s a theme, or with maybe formatting errors in the .json, but you’ve checked that already…
Location may vary, but have you taken a look at your ~/.discourse_theme file?
I’ve run into an issue before where my terminal emulator was using “bracketed paste mode”
You can see the difference below (these aren’t real keys, I’ve truncated them for sharing)… if you see something like the first entry with escape characters, that’s incorrect and won’t work.
I checked my discourse_theme file, and while the API key was formed properly, the file itself does look a bit malformed, compared to other examples I’ve seen (including yours).
Should be worth noting that I’m on macOS here and this was the result of cat ~/discourse_theme in iTerm.