David_Pešava encountered a 403 error while using the Discourse_theme CLI to watch a theme, despite having a valid admin API key. david suggested testing the API key via curl and reviewing the key’s configuration in the Discourse admin panel. David_Pešava confirmed the key worked via curl but noted it failed for colleagues as well, hinting at a possible version mismatch David_Pešava. david asked about the Discourse instance setup, prompting David_Pešava to suspect version incompatibility — he was using the latest CLI with an older Discourse server David_Pešava. david confirmed this: the CLI now uses header-based authentication, unsupported in older Discourse versions, and strongly advised upgrading Discourse for security and stability. As a workaround, David_Pešava could install an older CLI version with gem install discourse_theme -v "<0.3.0". David_Pešava confirmed the workaround resolved the issue David_Pešava.
I’m getting Error 403 when trying to run watch for first time.
Console output:
discourse_theme watch .
» Using http://mywebsize.com/ from /Users/davidpesava/.discourse_theme
» Using api key from /Users/davidpesava/.discourse_theme
✘ Error 403 for https://mywebsite.com/about.json
Generated API key is for admin user, I tried --reset multipe times
Multiple people are using the CLI on a day-to-day basis, so I think this is unlikely to be a CLI bug. Can you try using the same API key from curl or something similar?
Ah, that would explain it. The theme CLI was recently migrated to use header-based API authentication. That is supported in all current versions of Discourse, including the stable branch.
If you are using an older version of Discourse, I strongly recommend you upgrade ASAP, so that you’re not missing any critical security/bug fixes.