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]: Error while polling for changes #4897

Closed
2 tasks done
bigskillet opened this issue Nov 20, 2024 · 6 comments · Fixed by #5001
Closed
2 tasks done

[Bug]: Error while polling for changes #4897

bigskillet opened this issue Nov 20, 2024 · 6 comments · Fixed by #5001
Labels
Area: @shopify/theme @shopify/theme package issues State: Waiting for feedback Type: Bug Something isn't working

Comments

@bigskillet
Copy link

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

No errors.

Actual behavior

Polling errors while running: shopify theme dev --store store-name --theme-editor-sync --live-reload full-page. Related to --theme-editor-sync perhaps?

Image

Verbose output

Sorry, I killed the terminal before doing this.

Reproduction steps

  1. Run shopify theme dev --store store-name --theme-editor-sync --live-reload full-page
  2. Make edits to files and error will eventually appear

Operating System

macOS Sequoia 15.1.1

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

3.7.0

Shell

No response

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

No response

What language and version are you using in your application?

No response

@bigskillet bigskillet added the Type: Bug Something isn't working label Nov 20, 2024
@mgmanzella
Copy link
Contributor

👋 can you re run this and share the verbose output? or at minimum a copy-pastable version of the request is (i cant copy it from the image) -- thanks in advance

@bigskillet
Copy link
Author

bigskillet commented Nov 21, 2024

Here's the text from that screenshot, extracted with Chat-GPT:

Error while polling for changes.

The Admin GraphQL API responded unsuccessfully with the HTTP status 401 and errors:
“[API] Service is not valid for authentication”

Request ID: 75102210-6986-4c80-84f4-964b670714ed-1732129546

Error:
Too many polling errors…

Please check the errors above and ensure you have a stable internet connection.

Starting the server with --verbose doesn't immediately give the error - it's random. I haven't been able to spot any correlations. I've been running --verbose since you asked and it keeps looping the follow code. Not sure if it's producing/revealing the error or not.

2024-11-21T16:15:32.366Z: Sending "Admin" GraphQL request:
  query getThemeFileChecksums($id: ID!, $after: String) {
  theme(id: $id) {
    files(first: 250, after: $after) {
      nodes {
        filename
        size
        checksumMd5
        __typename
      }
      userErrors {
        filename
        code
        __typename
      }
      pageInfo {
        hasNextPage
        endCursor
        __typename
      }
      __typename
    }
    __typename
  }
}

With variables:
{
  "id": "gid://shopify/OnlineStoreTheme/129630306352",
  "after": null
}

With request headers:
 - User-Agent: Shopify CLI; v=3.70.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

to https://store-name.myshopify.com/admin/api/2024-10/graphql.json

@tannerkovach
Copy link

Getting the same issue here as well. I'm assuming it's related to previous versions of the cli where you'd get kicked off randomly and need to re-authenticate. Happening pretty consistently though with this newer version of 'shopify theme dev'.

@bigskillet
Copy link
Author

Another thing I'm noticing with --theme-editor-sync, which may be related to the polling issue, is that every time I start the server, it asks me to reconcile a file that has already been reconciled. For example, if I choose to keep the local version, stop the server, then restart, it'll ask to reconcile again. The same thing happens if I choose the remote – and I notice it doesn't update my local files. Seems like this would all be polling related, or no?

@lukeh-shopify
Copy link
Contributor

👋🏻 When you encounter the error with verbose logs, are there any request ID headers being output? That would be helpful so we can investigate if there is anything going wrong on our end

@JasonHassold
Copy link

Hey all, I've also been running into this issue.

The command I ran was shopify theme dev --theme-editor-sync --verbose

Even when not making any file changes it seems to be performing a repetitive call below and eventually errors out. Makes a call or a couple of calls every about every 2 seconds or so.

Note: I've redacted the store name

2024-11-29T02:56:55.582Z: Request to https://{STORE NAME}.myshopify.com/admin/api/2024-10/graphql.json completed in 328 ms
With response headers:
 - content-type: application/json; charset=utf-8
 - server-timing: processing;dur=148, graphql;desc="admin/query/other", cfRequestDuration;dur=226.999998
 - x-request-id: 1b926f0b-2b2e-4193-89c9-1a374d713ecf-1732849015
    
2024-11-29T02:56:55.582Z: Sending "Admin" GraphQL request:
  query getThemeFileChecksums($id: ID!, $after: String) {
  theme(id: $id) {
    files(first: 250, after: $after) {
      nodes {
        filename
        size
        checksumMd5
        __typename
      }
      userErrors {
        filename
        code
        __typename
      }
      pageInfo {
        hasNextPage
        endCursor
        __typename
      }
      __typename
    }
    __typename
  }
}

With variables:
{
  "id": "gid://shopify/OnlineStoreTheme/144575332602",
  "after": "InNlY3Rpb25zXC9wcm9kdWN0LXJldmVhbGVyLXRlbXBsYXRlLmxpcXVpZCI="
}

Sometimes the after variable is null

With variables:
{
  "id": "gid://shopify/OnlineStoreTheme/144575332602",
  "after": null
}

cc @lukeh-shopify

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 State: Waiting for feedback Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants