[Bug]: CLI Timeout and fails to persistently keep renegotiating connection
Please confirm that you have:
- [x] Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
- [x] Reproduced the issue in the latest CLI version.
In which of these areas are you experiencing a problem?
Theme
Expected behavior
If the theme CLI is left running in the background, it shouldn't timeout or just stop spontaneously and should automatically renegotiation any tokens and just keep running.
Actual behavior
Unknown on exact timing, but the CLI will just randomly stop working and present the following error. Sometimes it will be after a period of inactivity, sometimes it will just stop working and not re-negotiate the connection while actively using the CLI to updated files while building things
Error: [401] API request unauthorized error
at request (file:///opt/homebrew/Cellar/shopify-cli/3.68.0/libexec/lib/node_modules/@shopify/cli/dist/index.js:145224:13)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async fetchChecksums (file:///opt/homebrew/Cellar/shopify-cli/3.68.0/libexec/lib/node_modules/@shopify/cli/dist/index.js:145198:17)
at async pollRemoteJsonChanges (file:///opt/homebrew/Cellar/shopify-cli/3.68.0/libexec/lib/node_modules/@shopify/cli/dist/index.js:148436:97)
Verbose output
N/A
Reproduction steps
- Start up the CLI
- Leave it running for a time period (can't get an exact timing on it, but my guess is at least an hour or 2)
- See the timeout and failure to renegotiate
Operating System
macOS Sonoma 14.6.1
Shopify CLI version (check your project's package.json if you're not sure)
3.68.0
Shell
iTerm + ZSH
Node version (run node -v if you're not sure)
20.10.0
What language and version are you using in your application?
No response
This is also reported here but showing a different symptom: https://github.com/Shopify/cli/issues/4576 We'll address this soon.
@frandiox I wasn't 100% sure if it was the same issue given the different error code so I created this one, sorry about the duplication!