Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Key not found: "grey" Error when pushing theme. #1388

Closed
ryangall7 opened this issue Jul 15, 2021 · 3 comments · Fixed by #1411
Closed

Key not found: "grey" Error when pushing theme. #1388

ryangall7 opened this issue Jul 15, 2021 · 3 comments · Fixed by #1411

Comments

@ryangall7
Copy link

Issue summary

Running shopify theme push returns an error.

Expected behavior

Should allow you to select a theme from the connected store to push to.

Actual behavior

46: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/bin/shopify:32:in `' 45: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:21:in `call' 44: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:75:in `handle_abort' 43: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/bin/shopify:33:in `block in ' 42: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/shopify-cli/core/entry_point.rb:23:in `call' 41: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/shopify-cli/core/monorail.rb:32:in `log' 40: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/shopify-cli/core/entry_point.rb:24:in `block in call' 39: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/shopify-cli/core/executor.rb:15:in `call' 38: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:14:in `call' 37: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:43:in `with_traps' 36: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:55:in `twrap' 35: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:44:in `block in with_traps' 34: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:55:in `twrap' 33: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:45:in `block (2 levels) in with_traps' 32: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:15:in `block in call' 31: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:35:in `with_logging' 30: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui.rb:176:in `log_output_to' 29: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:36:in `block in with_logging' 28: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb:169:in `with_id' 27: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:37:in `block (2 levels) in with_logging' 26: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:16:in `block (2 levels) in call' 25: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/shopify-cli/command.rb:19:in `call' 24: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/shopify-cli/sub_command.rb:13:in `call' 23: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/project_types/theme/commands/push.rb:36:in `call' 22: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/shopify-cli/form.rb:13:in `ask' 21: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/project_types/theme/forms/select.rb:8:in `ask' 20: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt.rb:100:in `ask' 19: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt.rb:203:in `ask_interactive' 18: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt.rb:230:in `interactive_prompt' 17: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:27:in `call' 16: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:73:in `call' 15: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:445:in `render_options' 14: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:445:in `each' 13: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:466:in `block in render_options' 12: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui.rb:162:in `with_frame_color' 11: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/frame.rb:247:in `with_frame_color_override' 10: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:467:in `block (2 levels) in render_options' 9: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui.rb:114:in `fmt' 8: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:88:in `format' 7: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:88:in `each_with_object' 6: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:88:in `each' 5: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:90:in `block in format' 4: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:110:in `apply_format' 3: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:110:in `each_with_object' 2: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:110:in `each' 1: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:113:in `block in apply_format' /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:113:in `fetch': key not found: "grey" (KeyError) Did you mean? "green" 46: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/bin/shopify:32:in `' 45: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:21:in `call' 44: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:75:in `handle_abort' 43: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/bin/shopify:33:in `block in ' 42: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/shopify-cli/core/entry_point.rb:23:in `call' 41: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/shopify-cli/core/monorail.rb:32:in `log' 40: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/shopify-cli/core/entry_point.rb:24:in `block in call' 39: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/shopify-cli/core/executor.rb:15:in `call' 38: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:14:in `call' 37: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:43:in `with_traps' 36: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:55:in `twrap' 35: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:44:in `block in with_traps' 34: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:55:in `twrap' 33: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:45:in `block (2 levels) in with_traps' 32: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:15:in `block in call' 31: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:35:in `with_logging' 30: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui.rb:176:in `log_output_to' 29: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:36:in `block in with_logging' 28: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb:169:in `with_id' 27: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:37:in `block (2 levels) in with_logging' 26: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-kit/lib/cli/kit/executor.rb:16:in `block (2 levels) in call' 25: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/shopify-cli/command.rb:19:in `call' 24: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/shopify-cli/sub_command.rb:13:in `call' 23: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/project_types/theme/commands/push.rb:36:in `call' 22: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/shopify-cli/form.rb:13:in `ask' 21: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/lib/project_types/theme/forms/select.rb:8:in `ask' 20: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt.rb:100:in `ask' 19: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt.rb:203:in `ask_interactive' 18: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt.rb:230:in `interactive_prompt' 17: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:27:in `call' 16: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:73:in `call' 15: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:445:in `render_options' 14: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:445:in `each' 13: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:466:in `block in render_options' 12: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui.rb:162:in `with_frame_color' 11: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/frame.rb:247:in `with_frame_color_override' 10: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb:467:in `block (2 levels) in render_options' 9: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui.rb:114:in `fmt' 8: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:88:in `format' 7: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:88:in `each_with_object' 6: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:88:in `each' 5: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:90:in `block in format' 4: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:110:in `apply_format' 3: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:110:in `each_with_object' 2: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:110:in `each' 1: from /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:112:in `block in apply_format' /Users/ashtongallagher/.gem/gems/shopify-cli-2.0.1/vendor/deps/cli-ui/lib/cli/ui/formatter.rb:115:in `rescue in block in apply_format': invalid format specifier: grey (CLI::UI::Formatter::FormatError)

Specifications

  • App type: Theme
  • Operating System: Mac OS
  • Shell: ZSH
  • Ruby version (ruby -v): 3.0.1
@ryangall7
Copy link
Author

This is a problem with stores that have demo themes. The method

      def theme_tags(theme)
        color = case theme.role
        when "live"
          "green"
        when "unpublished"
          "yellow"
        when "development"
          "blue"
        else
          "grey"
        end

        tags = ["{{#{color}:[#{theme.role}]}}"]

        if theme.current_development?
          tags << "{{cyan:[yours]}}}}"
        end

        tags.join(" ")
      end

In the else grey is not a valid tag. In cli-ui/lib/cli/ui/formatter.rb:13 the map is defined as

  SGR_MAP = {
        # presentational
        'red' => '31',
        'green' => '32',
        'yellow' => '33',
        # default blue is low-contrast against black in some default terminal color scheme
        'blue' => '94', # 9x = high-intensity fg color x
        'magenta' => '35',
        'cyan' => '36',
        'bold' => '1',
        'italic' => '3',
        'underline' => '4',
        'reset' => '0',

        # semantic
        'error' => '31', # red
        'success' => '32', # success
        'warning' => '33', # yellow
        'info' => '94', # bright blue
        'command' => '36', # cyan
      }.freeze

@ryangall7
Copy link
Author

Removing the theme trial also fixes it but this should probably cleaned up in the code.

@nathanhartallen-ca
Copy link

Getting this same error. Would love to know when it's updated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants