Solved

"shopify push" authentication issue in CI (like GitHub Actions)

camelmasa
Shopify Partner
83 10 27

We tried to do Shopify CLI in GitHub Actions.

Setup was no problem. But, We could't do the command "shopify push". It can upload Argo code to Shopify's server.

/var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/bin/load_shopify.rb:12: warning: Insecure world writable dir /opt/hostedtoolcache/gcloud/323.0.0/x64 in PATH, mode 040777
┏━━ Building extension with: yarn... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
┃ yarn run v1.22.5
┃ $ argo-admin-cli build --entry="index.tsx"
┃ Successfully compiled: build/main.js
┃ Done in 7.53s.
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ (7.72s) 
┏━━ Pushing your extension to Shopify ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
┃ Pushing code to Shopify...
This command ran with ID: 39302
Please include this information in any issues/report along with relevant logs
/var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/oauth.rb:91:in `receive_access_code': Timed out while waiting for response from Shopify (ShopifyCli::OAuth::Error)
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/oauth.rb:42:in `authenticate'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/partners_api.rb:93:in `authenticate'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/partners_api.rb:81:in `block in access_token'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/db.rb:87:in `get'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/partners_api.rb:80:in `access_token'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/partners_api.rb:74:in `api_client'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/partners_api.rb:49:in `block in query'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/partners_api.rb:63:in `authenticated_req'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/partners_api.rb:48:in `query'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/project_types/extension/tasks/update_draft.rb:21:in `call'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/task.rb:7:in `call'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/project_types/extension/commands/push.rb:58:in `block in update_draft'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/project_types/extension/commands/push.rb:53:in `with_waiting_text'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/project_types/extension/commands/push.rb:57:in `update_draft'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/project_types/extension/commands/push.rb:14:in `block in call'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-ui/lib/cli/ui/frame.rb:103:in `open'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/project_types/extension/commands/push.rb:13:in `call'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/command.rb:25:in `call'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:16:in `block (2 levels) in call'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:37:in `block (2 levels) in with_logging'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb:169:in `with_id'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:36:in `block in with_logging'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-ui/lib/cli/ui.rb:172:in `log_output_to'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:35:in `with_logging'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:15:in `block in call'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:45:in `block (2 levels) in with_traps'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:51:in `twrap'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:44:in `block in with_traps'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:55:in `twrap'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:43:in `with_traps'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-kit/lib/cli/kit/executor.rb:14:in `call'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/core/executor.rb:15:in `call'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/core/entry_point.rb:43:in `block in call'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/core/monorail.rb:32:in `log'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/lib/shopify-cli/core/entry_point.rb:42:in `call'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/bin/shopify:33:in `block in <main>'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:75:in `handle_abort'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb:21:in `call'
	from /var/lib/gems/2.5.0/gems/shopify-cli-1.5.0/bin/shopify:32:in `<main>'
┃ 𝒾 Authentication required. Login to the URL below with your Shopify Partners account credentials to continue.
┃ Please open this URL in your browser:
┃ https://accounts.shopify.com/oauth/authorize?client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&scope=openid+https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.app.cli.access&redirect_uri=http%3A%2F%2F127.0.0.1%3A3456&state=7e527cf24130c4770bf72954f9d9748ce561cbe53638ac7dfd268238f758&response_type=code&code_challenge=dyK0zxx76gt-N6hb1PoHawheNqL9H7drYNhB91vioZc&code_challenge_method=S256
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ (247.9s) 
Error: Process completed with exit code 1.

 

Does anyone know to avoid this authentication issue?

Accepted Solution (1)

camelmasa
Shopify Partner
83 10 27

This is an accepted solution.

Replies 2 (2)

jonathanhmg
Tourist
4 0 2

@camelmasa Could you let me know how did you authenticate the Shopify CLI in your Continuous Integration - GitHub Actions without manually interact with your browser?  

Thanks

camelmasa
Shopify Partner
83 10 27

This is an accepted solution.

Shopify released the solution.

Ref: https://shopify.dev/apps/tools/cli/ci-cd