Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: shopify theme push shows interactive "send error report" prompt even with SHOPIFY_CLI_TTY=0 #1573

Closed
2 tasks done
illarionvk opened this issue Mar 7, 2023 · 14 comments · Fixed by #3906
Closed
2 tasks done
Labels
Area: @shopify/theme @shopify/theme package issues open for contributions theme bugs that won't be prioritized in the near future Type: Bug Something isn't working

Comments

@illarionvk
Copy link

illarionvk commented Mar 7, 2023

Please confirm that you have:

  • 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.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Theme

Expected behavior

The shopify theme push command should skip interactive prompts like "Send an anonymized error report to Shopify?" when SHOPIFY_CLI_TTY environment variable is set to zero and immediately exit on error.

Screenshot 2023-03-07 at 17 59 06

Actual behavior

The shopify theme push command was waiting for interactive input for 15 minutes while running in a GitHub Action workflow until the CI task timed out.

Screenshot 2023-03-07 at 17 53 05

Verbose output

2023-03-07T17:00:25.309Z: Running command theme push
2023-03-07T17:00:25.322Z: Ensuring that the user is authenticated with the Theme API with the following scopes:
[]

2023-03-07T17:00:25.335Z:
Running system process:
  · Command: ruby -v
  · Working directory: /app

2023-03-07T17:00:25.357Z:
Running system process:
  · Command: bundle -v
  · Working directory: /app

2023-03-07T17:00:25.478Z: Reading the content of file at /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/Gemfile...
2023-03-07T17:00:25.488Z:
Running system process:
  · Command: bundle install
  · Working directory: /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby

2023-03-07T17:00:25.747Z:
Running system process:
  · Command: bundle exec ruby /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify theme push . --unpublished --theme Preview Test
  · Working directory: /app

DEBUG POST https://theme-kit-access.shopifyapps.com/cli/admin/api/unstable/themes.json with X-Request-Id: 753d72e8-91d0-423d-bb18-dab7072c2ff4
✗ An unexpected error occurred.
        To submit an issue include the stack trace.

? Send an anonymized error report to Shopify? (You chose: No, don't send)
/mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/api.rb:80:in `block in request': 422 (ShopifyCLI::API::APIRequestClientError)
{"errors":{"base":["A shop may only have 20 themes"]}}
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/util.rb:172:in `retry_after'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/api.rb:89:in `request'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/theme/theme_access_api.rb:43:in `rest_request'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/theme/theme_admin_api.rb:38:in `rest_request'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/theme/theme_admin_api.rb:26:in `post'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/theme/theme.rb:74:in `create'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/theme/theme.rb:130:in `create_unpublished'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/project_types/theme/commands/push.rb:124:in `find_theme'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/project_types/theme/commands/push.rb:50:in `call'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/command/sub_command.rb:16:in `call'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/command.rb:27:in `call'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/core/executor.rb:17:in `block (2 levels) in call'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/executor.rb:37:in `block (2 levels) in with_logging'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb:169:in `with_id'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/executor.rb:36:in `block in with_logging'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui.rb:176:in `log_output_to'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/executor.rb:35:in `with_logging'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/core/executor.rb:16:in `block in call'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/executor.rb:45:in `block (2 levels) in with_traps'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/executor.rb:51:in `twrap'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/executor.rb:44:in `block in with_traps'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/executor.rb:55:in `twrap'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/executor.rb:43:in `with_traps'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/core/executor.rb:15:in `call'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/core/entry_point.rb:17:in `block in call'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/core/monorail.rb:26:in `log'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/lib/shopify_cli/core/entry_point.rb:16:in `call'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:50:in `block (2 levels) in <main>'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:75:in `handle_abort'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:21:in `call'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:49:in `block in <main>'
        from /mnt/tmp/node_modules/.pnpm/@shopify+cli-kit@3.44.1_@types+react@17.0.37/node_modules/@shopify/cli-kit/assets/cli-ruby/bin/shopify:59:in `<main>'

Reproduction steps

  1. Set SHOPIFY_CLI_TTY=0 environment variable
  2. Run shopify theme push -u -t 'My Theme' command on a store that has reached the max theme limit
  3. Expect the command to exit immediately with no additional user input.

Operating System

Debian Linux

Shopify CLI version (check your project's package.json if you're not sure)

3.44.1

Shell

Bash

Node version (run node -v if you're not sure)

v16.19.0

What language and version are you using in your application?

Ruby 3.1.2

@illarionvk illarionvk added the Type: Bug Something isn't working label Mar 7, 2023
@Arkham Arkham added the Area: @shopify/theme @shopify/theme package issues label Mar 7, 2023
@Arkham
Copy link
Contributor

Arkham commented Mar 7, 2023

Hi, thanks for reporting this! I'll ping @Shopify/theme-developer-tools so they can take a look at this.

@illarionvk
Copy link
Author

Also, the CLI doesn't output the error or the stack trace if the system kills the CLI process with a SIGTERM or SIGINT on timeout while the CLI waits for the interactive prompt.

@github-actions
Copy link
Contributor

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.
→ If there's no activity within a week, then a bot will automatically close this.
Thanks for helping to improve Shopify's dev tooling and experience.

P.S. You can learn more about why we stale issues here.

@illarionvk
Copy link
Author

This issue is still relevant to our daily work

@github-actions
Copy link
Contributor

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.
→ If there's no activity within a week, then a bot will automatically close this.
Thanks for helping to improve Shopify's dev tooling and experience.

P.S. You can learn more about why we stale issues here.

@github-actions
Copy link
Contributor

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.
→ If there's no activity within a week, then a bot will automatically close this.
Thanks for helping to improve Shopify's dev tooling and experience.

P.S. You can learn more about why we stale issues here.

@illarionvk
Copy link
Author

This issue is still relevant to our day to day work.

@benoitmidon
Copy link

same issue here

Copy link
Contributor

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action.
→ If there's no activity within a week, then a bot will automatically close this.
Thanks for helping to improve Shopify's dev tooling and experience.

P.S. You can learn more about why we stale issues here.

@mgmanzella
Copy link
Contributor

👋 hi all, thanks for your patience -- we're moving away from using SHOPIFY_CLI_TTY for theme commands, instead use --force for CI to skip prompts. let us know if that fixes your issue 🙏

@mgmanzella mgmanzella added the open for contributions theme bugs that won't be prioritized in the near future label May 15, 2024
@illarionvk
Copy link
Author

Thank you for the update, @mgmanzella! Unfortunately, that doesn't resolve my issue:

  1. It looks like there is no --force flag for shopify theme push.

  2. The general meaning of the --force flag in the CLI is "Skip confirmations" when encountering expected scenarios.

    My original bug report shows that the command crashed with an unexpected error, but the CLI was holding up the automation with an interactive prompt.

    I'd be happy to see a --ci flag that indicates the command is going to run in a non-interactive environment.

@illarionvk
Copy link
Author

Similar reports:

#3391
#3621

@mgmanzella
Copy link
Contributor

It looks like there is no --force flag for shopify theme push.

this isn't expected, force should work with theme push

ik it's unrelated to this specific issue but in the future can you try using --force with the --stable flag and let us know if that skips a prompt?? weve been working to remove the ruby dependency from the CLI and there may still be parity issues.

My original bug report shows that the command crashed with an unexpected error, but the CLI was holding up the automation with an interactive prompt.

ahhh ic ic thanks for bump/clarification. have you seen this behavior with all errors from the CLI or just 422s??

I'd be happy to see a --ci flag that indicates the command is going to run in a non-interactive environment.

definitely, feel free to +1 in this issue so we can track community interest for this enhancement

@jamesmengo
Copy link
Contributor

@illarionvk
Thanks for your report :)
This should be fixed in the upcoming release - if you still experience this issue after upgrading, please let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: @shopify/theme @shopify/theme package issues open for contributions theme bugs that won't be prioritized in the near future Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants