Gatsby builds stopped working: parallel query running error?

Netlify site name: sunny-lokum-b7fddf.netlify.app

Production site: hikewithgravity.com

After a successful migration from Gatsby Cloud to Netlfiy, builds suddenly stopped working. I’m seeing this error: Input buffer has corrupt header: glib: XML parse error: Error domain 1 code 77 on line 577 column 1 of data: Premature end of data in tag link line 117

This is happening when I run a build locally or attempt to run one on Netlify.

The error provides no help in determining the source of the problem, at least with my limited knowledge. Results from googling seem to imply that the problem is related to Sharp processing images, yet no new images were added when the build problem started.

If there is a corrupted image, I’m unsure how that would have occurred. Additionally, the errors never reference a specific image and seem to happen at different times in the build process each time I run it. I’ve attempted to find a corrupted image in the site and can’t find any.

A second error message says An error occurred during parallel query running. Go here for troubleshooting tips: https://gatsby.dev/pqr-feedback

Unfortunately, the help suggested by the link is not useful because it is out-of-date. It suggests enabling Parallel Query Running, but elsewhere, I learned that this was enabled by default in Gatsby version 4. I am running Gatsby version 5.11.0.

More about the site:

`❯ gatsby info

  System:
    OS: macOS 13.5.2
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.5.0 - ~/.nvm/versions/node/v20.5.0/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.1.0 - ~/.nvm/versions/node/v20.5.0/bin/npm
  Browsers:
    Chrome: 118.0.5993.70
    Firefox: 118.0.2
    Safari: 16.6
  npmPackages:
    gatsby: 5.11.0 => 5.11.0
    gatsby-awesome-pagination: ^0.3.8 => 0.3.8
    gatsby-cli: ^5.12.1 => 5.12.2
    gatsby-core-utils: ^4.12.0 => 4.12.0
    gatsby-plugin-algolia: ^1.0.3 => 1.0.3
    gatsby-plugin-feed: ^5.12.0 => 5.12.1
    gatsby-plugin-google-gtag: ^5.12.0 => 5.12.1
    gatsby-plugin-image: ^3.12.0 => 3.12.1
    gatsby-plugin-mailchimp: ^5.2.2 => 5.2.2
    gatsby-plugin-manifest: ^5.12.0 => 5.12.1
    gatsby-plugin-netlify: ^5.1.0 => 5.1.1
    gatsby-plugin-postcss: ^6.12.0 => 6.12.0
    gatsby-plugin-purgecss: ^6.1.2 => 6.2.1
    gatsby-plugin-react-helmet: ^6.12.0 => 6.12.0
    gatsby-plugin-sharp: ^5.12.0 => 5.12.1
    gatsby-plugin-sitemap: ^6.12.0 => 6.12.1
    gatsby-plugin-split-css: ^2.0.3 => 2.0.3
    gatsby-plugin-utils: ^4.12.0 => 4.12.1
    gatsby-source-drupal: ^6.12.0 => 6.12.1
    gatsby-source-filesystem: ^5.12.0 => 5.12.0
    gatsby-transformer-sharp: ^5.12.0 => 5.12.1`

The content of this site is provided by Drupal. There are 19,625 total nodes and 736 SitePage nodes. Each page contains several images, sometimes as many as 20-25. Generally, all of the problems I’ve had in getting the site to function properly have been related to the images, but as I said, it was running as expected until the errors suddenly started to appear.

I’ve never run into this problem before and have run out of ideas that might resolve it. All of the suggestions I’ve found in googling, such as setting GATSBY_CPU_COUNT=1, have failed to make any changes to the failed results.

Hi @startinggravity,

Regarding the first error, unfortunately that’s not something we can help with. Since it’s also happening locally, it has something to do with your setup, which we cannot investigate to find the root cause.

About the second, could you share a link to the deploy that gave that error?

The most recent build attempt is found at Netlify App.

That one appears to be about the input buffer has corrupt header, which as I have mentioned, is not something we can check.

I was asking for a link about the second issue, the PQR one.

Line 186 refers to parallel query running error.

Hi, @startinggravity. It does say “An error occurred during parallel query running.”. However, the error that occurred is the same error as above:

Error: Input buffer has corrupt header: glib: XML parse error: Error domain 1   code 77 on line 577 column 1 of data: Premature end of data in tag link line 1  17

Are you trying to process SVG files? If so, this issue may be helpful:

Thanks for the help. When I found that page early into my investigation, I saw it referenced processing SVG files using Sharp. There is nowhere in my site where that is done.

The whole error makes no sense to me. The error references glib, which is a system library, so it would not necessarily be the same in my local machine as it would in Netlify’s system, yet the error appeared in both systems.

All I can figure is that the error message is a red herring. There must have been an error that slipped in somewhere into my code or a file got corrupted. The error message was somehow triggered incorrectly.

This is only a theory, but I was able finally fix the problem by doing a git revert to rollback the code to a state that ran correctly.