gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.28k stars 10.31k forks source link

Gatbsy v4: SIGILL on gatsby build command #34106

Closed RobCharlet closed 2 years ago

RobCharlet commented 2 years ago

Preliminary Checks

Description

I experience a SIGILL error on a Debian server when i run the gatsby build command on a gatsby v4. Same issue with gatsby develop Same issue with a clean gatsby v4 clean install. No issue on my local environment with the same node and gatsby-cli versions.

local environment :

System:
    OS: macOS 11.6.1
    CPU: (20) x64 Intel(R) Core(TM) i9-10850K CPU @ 3.60GHz
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.0.1 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.1.0 - /usr/local/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 96.0.4664.55
    Firefox: 94.0.1
    Safari: 15.1
  npmPackages:
    gatsby: ^4.2.0 => 4.2.0
    gatsby-background-image: ^1.4.1 => 1.5.3
    gatsby-image: ^3.11.0 => 3.11.0
    gatsby-plugin-dark-mode: ^1.1.2 => 1.1.2
    gatsby-plugin-emotion: ^7.2.0 => 7.2.0
    gatsby-plugin-google-analytics: ^4.2.0 => 4.2.0
    gatsby-plugin-image: ^2.2.0 => 2.2.0
    gatsby-plugin-mdx: ^3.2.0 => 3.2.0
    gatsby-plugin-offline: ^5.2.0 => 5.2.0
    gatsby-plugin-react-helmet: ^5.2.0 => 5.2.0
    gatsby-plugin-robots-txt: ^1.5.5 => 1.6.14
    gatsby-plugin-sharp: ^4.2.0 => 4.2.0
    gatsby-plugin-sitemap: ^5.2.0 => 5.2.0
    gatsby-plugin-webpack-bundle-analyser-v2: ^1.1.26 => 1.1.26
    gatsby-source-filesystem: ^4.2.0 => 4.2.0
    gatsby-transformer-sharp: ^4.2.0 => 4.2.0
  npmGlobalPackages:
    gatsby-cli: 4.2.0

Reproduction Link

*

Steps to Reproduce

  1. gatsby build
  2. ...

Expected Result

info Done building in xxx sec

Actual Result

$ GATSBY_ENV=production gatsby build ⠙ open and validate gatsby-configs, load plugins error Command failed with signal "SIGILL". info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Environment

System:
    OS: Linux 4.19 Debian GNU/Linux 9 (stretch) 9 (stretch)
    CPU: (4) x64 Intel(R) Atom(TM) CPU N2800   @ 1.86GHz
    Shell: 4.4.12 - /bin/bash
  Binaries:
    Node: 17.0.1 - ~/.nvm/versions/node/v17.0.1/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v17.0.1/bin/npm
  Languages:
    Python: 2.7.13 - /usr/bin/python
  npmPackages:
    gatsby: ^4.2.0 => 4.2.0
    gatsby-background-image: ^1.4.1 => 1.5.3
    gatsby-image: ^3.11.0 => 3.11.0
    gatsby-plugin-dark-mode: ^1.1.2 => 1.1.2
    gatsby-plugin-emotion: ^7.2.0 => 7.2.0
    gatsby-plugin-google-analytics: ^4.2.0 => 4.2.0
    gatsby-plugin-image: ^2.2.0 => 2.2.0
    gatsby-plugin-mdx: ^3.2.0 => 3.2.0
    gatsby-plugin-offline: ^5.2.0 => 5.2.0
    gatsby-plugin-react-helmet: ^5.2.0 => 5.2.0
    gatsby-plugin-robots-txt: ^1.5.5 => 1.6.14
    gatsby-plugin-sharp: ^4.2.0 => 4.2.0
    gatsby-plugin-sitemap: ^5.2.0 => 5.2.0
    gatsby-plugin-webpack-bundle-analyser-v2: ^1.1.26 => 1.1.26
    gatsby-source-filesystem: ^4.2.0 => 4.2.0
    gatsby-transformer-sharp: ^4.2.0 => 4.2.0

Config Flags

No response

LekoArts commented 2 years ago

Hi, thanks for the issue!

To make the process of resolving problems quicker for both sides we need you to fill out the issue template and give us a minimal reproduction.

RobCharlet commented 2 years ago

Hi, i made a repo :

https://github.com/RobCharlet/gatsby-bug-repro

System: OS: Linux 4.19 Debian GNU/Linux 9 (stretch) 9 (stretch) CPU: (4) x64 Intel(R) Atom(TM) CPU N2800 @ 1.86GHz Shell: 4.4.12 - /bin/bash Binaries: Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm Languages: Python: 2.7.13 - /usr/bin/python npmPackages: gatsby: ^4.2.0 => 4.2.0 gatsby-background-image: ^1.5.3 => 1.5.3 gatsby-plugin-sharp: ^4.2.0 => 4.2.0 gatsby-transformer-sharp: ^4.2.0 => 4.2.0 npmGlobalPackages: gatsby-cli: 4.2.0

kmajzlik commented 2 years ago

Take a look on https://github.com/gatsbyjs/gatsby/discussions/34157 , can be same issue.

RobCharlet commented 2 years ago

Hi, i update the bug repo link.

plugins: [
    `gatsby-transformer-sharp`, `gatsby-plugin-sharp`
    ]

Cause the issue. If i remove this 2 plugins Gatsby built correctly.

@kmajzlik Thanks, it fails with no logs, even with --verbose, and i can't see no performance issues on my server.

kmajzlik commented 2 years ago

@RobCharlet - great! I will try to remove images from project and test. For me it also do not seem like performance as i described my server (16GB RAM) in Discussion link.

feedm3 commented 2 years ago

We also had the problem that builds were broken "randomly" with such a generic error. We figured out that the memory usage was significantly higher with Gatsby 4 than with Gatsby 3. I wrote down some details here: https://github.com/gatsbyjs/gatsby/discussions/34215#discussioncomment-1799510

We decided to downgrade to Gatsby 3 until the memory usage problem is fixed.

LekoArts commented 2 years ago

I'm closing this issue as the reproduction steps and repo are insufficient. We're following up with memory issues in PQR, e.g. in https://github.com/gatsbyjs/gatsby/discussions/34215#discussioncomment-1799510