zendesk / zcli

A command-line tool for Zendesk
https://developer.zendesk.com
Apache License 2.0
63 stars 21 forks source link

Not able to preview themes despite API token login being accepted #250

Open mvlad-reb opened 3 months ago

mvlad-reb commented 3 months ago

Expectations

Being able to preview the theme being developed successfully locally, or at the very least getting actionable error messages

Reality

image

Steps to Reproduce

  1. log into zendesk via zcli login -i
  2. navigate to theme folder
  3. try to preview the theme via yarn start / zcli themes:preview
  4. Error 403

Issue details

This API token and setup has worked before, my account has admin access to the guide section on the user side, and i've already tried removing and re-adding profiles to no avail. The error doesn't really provide more issues if the error is on my side or the zendesk side, but checking the API log on the zendesk side doesn't seem to be logging these attempts.

michel-rely commented 2 months ago

Running into the same issue.

Using: $ DEBUG=* zcli themes:preview

... Uploading theme... ! Error: Request failed with status code 403 at error (/usr/lib/node_modules/@zendesk/zcli/node_modules/@oclif/core/lib/errors/index.js:28:15) at preview (/usr/lib/node_modules/@zendesk/zcli/node_modules/@zendesk/zcli-themes/dist/lib/preview.js:53:36) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async Preview.run (/usr/lib/node_modules/@zendesk/zcli/node_modules/@zendesk/zcli-themes/dist/commands/themes/preview.js:32:25) at async Preview._run (/usr/lib/node_modules/@zendesk/zcli/node_modules/@oclif/core/lib/command.js:80:22) at async Config.runCommand (/usr/lib/node_modules/@zendesk/zcli/node_modules/@oclif/core/lib/config/config.js:301:25)

Command: zcli themes Version: @zendesk/zcli/1.0.0-beta.47 .46 .45 OS: Debian in UTM

vagarogit commented 2 months ago

Same issue here. Any word on a fix?

mvlad-reb commented 1 month ago

Still getting this issue on 1.0.0 beta 50 image This is really frustrating.

michel-rely commented 1 month ago

Apparently, you need to set the environment variables too. This fixed my problem after raising this with support. https://developer.zendesk.com/documentation/apps/getting-started/using-zcli/#authenticating-zcli-using-environment-variables:~:text=As%20an%20optional%20step%2C%20print%20each%20environment%20variable%27s%20value%20to%20ensure%20it%27s%20set

mvlad-reb commented 1 month ago

Unfortunately I already have those set up as well with the same values as the ones I input during the login (I had to, otherwise login was failing): image

still i don't see why they'd be needed any more, since i am successfully logged in and the profile is selected, it should stand to reason that it should just connect using those details there.