Skip to content

Unrecoverable error while generating Gatsby Image CDN fields crashes gatsby develop #37557

@tqureshi-uog

Description

@tqureshi-uog

Preliminary Checks

Description

If you run gatsby develop it crashes and fails to build successfully whenever it runs into a problem with a random image:

reporter.panic(`[gatsby-source-drupal] Encountered an unrecoverable error while generating Gatsby Image CDN fields for url ${url}.

After I changed reporter.panic to reporter.warn (line 115 of gatsby-source-drupal/normalize.js) the gatsby develop command completed successfully and my local dev site worked. In other words, there's no legitimate reason for gatsby develop to fail outright simply because one image out of potentially thousands doesn't get its Image CDN fields generated.

Reproduction Link

n/a

Steps to Reproduce

Since there are any number of reasons outside a user's control for Image CDN field generation to fail, it would be difficult to deliberately reproduce this. It's most common on slower internet connections, however, so that would be a place to start - run gatsby develop in an environment with a slow internet connection.

Expected Result

gatsby develop should complete successfully.

Actual Result

gatsby develop fails and crashes with the following error message:

[gatsby-source-drupal] Encountered an unrecoverable error while generating Gatsby Image CDN fields for url
[image URL here - this is random and changes each time] See above for additional information.

If you manually edit normalize.js as I described above, you'll still see the error message, but gatsby develop will continue and eventually finish successfully.

Environment

System:
    OS: Linux 4.4 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    npm: 9.4.0 - ~/.nvm/versions/node/v18.12.1/bin/npm
  npmPackages:
    gatsby: ^5.5.0 => 5.5.0
    gatsby-cli: ^5.5.0 => 5.5.0
    gatsby-plugin-asset-path: ^3.0.4 => 3.0.4
    gatsby-plugin-client-side-redirect: ^1.1.0 => 1.1.0
    gatsby-plugin-gatsby-cloud: ^5.5.0 => 5.5.0
    gatsby-plugin-google-analytics: ^5.5.0 => 5.5.0
    gatsby-plugin-google-tagmanager: ^5.5.0 => 5.5.0
    gatsby-plugin-image: ^3.5.0 => 3.5.0
    gatsby-plugin-manifest: ^5.5.0 => 5.5.0
    gatsby-plugin-react-helmet: ^6.5.0 => 6.5.0
    gatsby-plugin-robots-txt: ^1.8.0 => 1.8.0
    gatsby-plugin-root-import: ^2.0.9 => 2.0.9
    gatsby-plugin-sharp: ^5.5.0 => 5.5.0
    gatsby-plugin-styled-components: ^6.5.0 => 6.5.0
    gatsby-source-drupal: ^6.5.0 => 6.5.0
    gatsby-source-filesystem: ^5.5.0 => 5.5.0
    gatsby-source-wordpress: ^7.5.0 => 7.5.0
    gatsby-transformer-sharp: ^5.5.0 => 5.5.0
    gatsby-transformer-yaml: ^5.5.0 => 5.5.0
  npmGlobalPackages:
    gatsby-cli: 5.2.0

Config Flags

  resolve: `gatsby-source-drupal`,
    options: {
    baseUrl: process.env.DRUPAL_BASEURL,
    apiBase: process.env.DRUPAL_APIBASE,
    basicAuth: {
      username: process.env.BASIC_AUTH_USERNAME,
      password: process.env.BASIC_AUTH_PASSWORD,
    },
    fastBuilds: true,
    skipFileDownloads: true,
  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssue that doesn't require previous experience with Gatsbyhelp wantedIssue with a clear description that the community can help with.topic: source-drupalRelated to Gatsby's integration with Drupaltopic: source-pluginsRelates to the Gatsby source plugins (e.g. -filesystem)type: bugAn issue or pull request relating to a bug in Gatsby

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions