Shopify CLI theme pull error relating to Graph?

Hi everyone. This post is related to my previous post regarding the Shopify command shopify theme pull. As I’ve mentioned in my previous post, when I run the command, it hangs for a long time (a separate problem), then it either completes or keep on hanging up.

Whenever it completes, I get the notice regarding having uncommited changes (which isn’t a problem for now). After choosing the option to proceed regardless, I get this error.

Not sure where I did wrong to be honest. Reinstall and rolling back to previous Shopify versions did not do any wonders for me.

If you have any ideas as to how I can solve this, please let me know.

Thanks

Why are you using sudo here - you shouldn’t need to bypass any required password to run this command. Also, could you try pulling a fresh version of Dawn, just to rule out that it’s a theme specific issue?

This may actually be related to the other error. If it takes a long time to get to this step, it’s possible that the authentication tokens have expired, which could be why you’re getting 401 Unauthorized. It could be something else, but just in case, let’s try to fix the other problem first.

Logs running with --verbose could also be interesting to see.

Hi @Fran-Shopify

I’m not sure if there was a 401 Unauthorized during the theme pull but here are the --verbose logs.

anthonycoleman@MacBookPro eprosperfy % Sudo shopify theme pull --verbose --store https://eprosperfy.myshopify.com
2025-01-30T15:58:39.659Z: Running command theme pull
2025-01-30T15:58:39.665Z: Notifications to show: 0
2025-01-30T15:58:39.674Z: Ensuring that the user is authenticated with the Theme API with the following scopes:
[]

2025-01-30T15:58:39.674Z: Ensuring that the user is authenticated with the Admin API with the following scopes for the store eprosperfy.myshopify.com:
[]

2025-01-30T15:58:39.674Z: Getting session store...
2025-01-30T15:58:39.675Z: Validating existing session against the scopes:
[
  "openid",
  "https://api.shopify.com/auth/shop.admin.graphql",
  "https://api.shopify.com/auth/shop.admin.themes",
  "https://api.shopify.com/auth/partners.collaborator-relationships.readonly",
  "https://api.shopify.com/auth/shop.storefront-renderer.devtools",
  "https://api.shopify.com/auth/partners.app.cli.access",
  "https://api.shopify.com/auth/destinations.readonly",
  "https://api.shopify.com/auth/organization.store-management",
  "https://api.shopify.com/auth/organization.apps.manage"
]
For applications:
{
  "adminApi": {
    "scopes": [],
    "storeFqdn": "eprosperfy.myshopify.com"
  }
}

2025-01-30T15:58:39.676Z: Sending GET request to URL https://accounts.shopify.com/.well-known/openid-configuration.json
With request headers:
 - User-Agent: Shopify CLI; v=3.74.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2025-01-30T15:58:40.023Z: Request to https://accounts.shopify.com/.well-known/openid-configuration.json completed in 347 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"73d241ff8637e82a52ff610e4476c701"
 - server-timing: processing;dur=10, socket_queue;dur=1.002, edge;dur=1.032, util;dur=0.25, cfRequestDuration;dur=173.000097
 - x-request-id: 111bb7bd-ee10-4e09-bc01-c215cea3b28b-1738252719
   
2025-01-30T15:58:40.039Z: Sending Identity Introspection request to URL: https://accounts.shopify.com/oauth/introspection
2025-01-30T15:58:40.039Z: Sending POST request to URL https://accounts.shopify.com/oauth/introspection
With request headers:
 - User-Agent: Shopify CLI; v=3.74.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2025-01-30T15:58:40.184Z: Request to https://accounts.shopify.com/oauth/introspection completed in 144 ms
With response headers:
 - cache-control: no-cache
 - content-type: text/html
 - server-timing: processing;dur=8, socket_queue;dur=0.878, edge;dur=1.041, util;dur=0.15, cfRequestDuration;dur=62.999964
 - x-request-id: 14ad532d-6783-4ca8-ac22-993c6c451522-1738252720
   
2025-01-30T15:58:40.184Z: The Introspection request failed with:
 - status: 401
 - www-authenticate header: "error=\"invalid_token\",error_description=\"The access token provided is expired, revoked, malformed or invalid for other reasons.\""
 - body: ""
2025-01-30T15:58:40.185Z:
The validation of the token for application/identity completed with the following results:
- It's expired: true
- It's invalid in identity: true
 
2025-01-30T15:58:40.185Z: The current session is valid but needs refresh. Refreshing...
2025-01-30T15:58:40.186Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=refresh_token&access_token=atkn_CjQIrr_GvAYQzvfGvAZSJggBEhBudYg7aB5O66tO14GhWQDxGhBHiLkcxjBISJYbY-1RvSTVEkDHP8I_5RV2OmuMHQoTgw6RQA4dKO2TPAB2OoGnKNGJtbjCzze_zEsnHGTlRbppph9NA1zxZjU5ZTXSUTceNukL&refresh_token=atkn_CiEIrr_GvAYQrtnkvQaiARIKEEeIuRzGMEhIlhtj7VG9JNUSQMqkBD3FpaNpLJLCAz_0eRtJ4IDmuZpD-bs9ivRyHYQ4JRWOcAnDQ5rV5x-fGgjbrBMwciNbKAVk1ZMrmpSLbAU&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3
With request headers:
 - User-Agent: Shopify CLI; v=3.74.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2025-01-30T15:58:40.422Z: Request to https://accounts.shopify.com/oauth/token?grant_type=refresh_token&access_token=atkn_CjQIrr_GvAYQzvfGvAZSJggBEhBudYg7aB5O66tO14GhWQDxGhBHiLkcxjBISJYbY-1RvSTVEkDHP8I_5RV2OmuMHQoTgw6RQA4dKO2TPAB2OoGnKNGJtbjCzze_zEsnHGTlRbppph9NA1zxZjU5ZTXSUTceNukL&refresh_token=atkn_CiEIrr_GvAYQrtnkvQaiARIKEEeIuRzGMEhIlhtj7VG9JNUSQMqkBD3FpaNpLJLCAz_0eRtJ4IDmuZpD-bs9ivRyHYQ4JRWOcAnDQ5rV5x-fGgjbrBMwciNbKAVk1ZMrmpSLbAU&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3 completed in 236 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"918e0bc5084efe5c67a4b7cd323d6b80"
 - server-timing: processing;dur=80, socket_queue;dur=1.235, edge;dur=1.052, util;dur=0.1, cfRequestDuration;dur=141.999722
 - x-request-id: b4f15a6d-2c32-47e0-9c8c-d627f4182d20-1738252720
   
2025-01-30T15:58:40.426Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=271e16d403dfa18082ffb3d197bd2b5f4479c3fc32736d69296829cbb28d41a6&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.app.cli.access&subject_token=****
With request headers:
 - User-Agent: Shopify CLI; v=3.74.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2025-01-30T15:58:40.426Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=ee139b3d-5861-4d45-b387-1bc3ada7811c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.storefront-renderer.devtools&subject_token=****
With request headers:
 - User-Agent: Shopify CLI; v=3.74.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2025-01-30T15:58:40.429Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=32ff8ee5-82b8-4d93-9f8a-c6997cefb7dc&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly+https%3A%2F%2Fapi.shopify.com%2Fauth%2Forganization.store-management&subject_token=****
With request headers:
 - User-Agent: Shopify CLI; v=3.74.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2025-01-30T15:58:40.429Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.admin.graphql+https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.admin.themes+https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.collaborator-relationships.readonly&subject_token=****&destination=https%3A%2F%2Feprosperfy.myshopify.com%2Fadmin
With request headers:
 - User-Agent: Shopify CLI; v=3.74.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2025-01-30T15:58:40.430Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Forganization.apps.manage&subject_token=****
With request headers:
 - User-Agent: Shopify CLI; v=3.74.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2025-01-30T15:58:40.617Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=32ff8ee5-82b8-4d93-9f8a-c6997cefb7dc&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly+https%3A%2F%2Fapi.shopify.com%2Fauth%2Forganization.store-management&subject_token=**** completed in 188 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"c2f8cbaf18b1030fbb96755d16d250d5"
 - server-timing: processing;dur=42, socket_queue;dur=1.142, edge;dur=1.042, util;dur=0.15, cfRequestDuration;dur=94.999790
 - x-request-id: d7bbcfd4-7753-42e4-bce6-b1c834b3f21d-1738252720
   
2025-01-30T15:58:40.622Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.admin.graphql+https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.admin.themes+https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.collaborator-relationships.readonly&subject_token=****&destination=https%3A%2F%2Feprosperfy.myshopify.com%2Fadmin completed in 193 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"1511ce315754fb087897a09773a3694b"
 - server-timing: processing;dur=48, socket_queue;dur=1.819, edge;dur=3.036, util;dur=0.15, cfRequestDuration;dur=102.999926
 - x-request-id: d87ab5d2-9c64-49e9-b5e8-e28ad19d101c-1738252720
   
2025-01-30T15:58:40.691Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=271e16d403dfa18082ffb3d197bd2b5f4479c3fc32736d69296829cbb28d41a6&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.app.cli.access&subject_token=**** completed in 265 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"2c0d20c168a77d2d84a53f265614a448"
 - server-timing: processing;dur=42, socket_queue;dur=1.462, edge;dur=1.048, util;dur=0.25, cfRequestDuration;dur=122.999907
 - x-request-id: fd444298-84e6-440f-ac02-4bf51972f664-1738252720
   
2025-01-30T15:58:40.696Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=ee139b3d-5861-4d45-b387-1bc3ada7811c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.storefront-renderer.devtools&subject_token=**** completed in 267 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"11066c48f13a99a900e001187cc730db"
 - server-timing: processing;dur=48, socket_queue;dur=1.633, edge;dur=1.033, util;dur=0.25, cfRequestDuration;dur=129.999876
 - x-request-id: 7df100b9-2e3d-4e70-8a4f-7da61a157ecb-1738252720
   
2025-01-30T15:58:40.702Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Forganization.apps.manage&subject_token=**** completed in 272 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"0cafb67b79fa34ee37662a32b9807c1e"
 - server-timing: processing;dur=50, socket_queue;dur=1.641, edge;dur=1.043, util;dur=0.15, cfRequestDuration;dur=134.999752
 - x-request-id: 6f728677-f3c7-4c41-9b4f-17c5b5d4ad0e-1738252720
   
2025-01-30T15:58:40.702Z: Setting session store...
2025-01-30T15:58:40.712Z: Getting development theme...

2025-01-30T15:58:40.712Z: Getting development theme…

Is that the last log that you always see? It looks like the CLI was able to authenticate you, but if it gets stuck there it might be related to disk read/write permissions. Can you try without sudo? The CLI needs to write to these paths, depending on your OS: GitHub - sindresorhus/env-paths: Get paths for storing things like data, config, cache, etc

Otherwise, please copy/paste the logs until the point where the CLI gets stuck.