Gatsby Error: UNHANDLED REJECTION There is no worker with "1" id

41 Views Asked by At

i've been facing an error when trying to build a gatsby project in aws amplify. Some context: This error is ocurring ONLY on preview builds ONLY on amplify. Local build works fine and nothing seems to be broken.

Sometimes the build passes and sometimes it breaks (more often than not).

The error itself is as follows:

2024-01-12T17:11:46.472Z [INFO]: success run queries in workers - 129.430s - 14/14 0.11/s
2024-01-12T17:11:56.660Z [WARNING]: error UNHANDLED REJECTION There is no worker with "1" id.
2024-01-12T17:11:56.728Z [INFO]: �[0m
                                 �[0m  �[0m�[97m�[41mError�[0m�[37m�[41m:�[0m�[37m�[41m �[0m�[97m�[41mThere is no worker with "1" id.�[0m
                                 �[0m  �[0m
                                 �[0m  �[0m�[90m-�[0m �[0m�[93mindex.js�[0m�[90m:�[0m�[93m294�[0m�[37m �[0m�[37mWorkerPool.sendMessage�[0m
                                 �[0m  �[0m  �[0m�[90m[mokens-league-web]/[gatsby-worker]/dist/index.js:294:13�[0m
                                 �[0m  �[0m
                                 �[0m  �[0m�[90m-�[0m �[0m�[93mworker-messaging.ts�[0m�[90m:�[0m�[93m41�[0m�[37m �[0m
                                 �[0m  �[0m  �[0m�[90m[mokens-league-web]/[gatsby]/src/utils/jobs/worker-messaging.ts:41:22�[0m
                                 �[0m  �[0m
                                 �[0m
                                 not finished Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 230.677s
2024-01-12T17:11:57.980Z [ERROR]: !!! Build failed
2024-01-12T17:11:57.981Z [ERROR]: !!! Non-Zero Exit Code detected
2024-01-12T17:11:57.981Z [INFO]: # Starting environment caching...

Our enviroment:

System:
    OS: Windows 10 10.0.22621
    CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11400H @ 2.70GHz
  Binaries:
    Node: 18.17.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.21 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (120.0.2210.91)
  npmPackages:
    gatsby: ^4.2.0 => 4.25.7
    gatsby-background-image: ^1.6.0 => 1.6.0
    gatsby-plugin-anchor-links: ^1.2.1 => 1.2.1
    gatsby-plugin-eslint: ^4.0.2 => 4.0.2
    gatsby-plugin-google-gtag: ^4.11.0 => 4.25.0
    gatsby-plugin-image: ^2.2.0 => 2.25.0
    gatsby-plugin-manifest: ^4.2.0 => 4.25.0
    gatsby-plugin-minify: ^0.5.0 => 0.5.0
    gatsby-plugin-postcss: ^5.2.0 => 5.25.0
    gatsby-plugin-react-helmet: ^5.4.0 => 5.25.0
    gatsby-plugin-react-i18next: ^1.2.2 => 1.2.3
    gatsby-plugin-root-import: ^2.0.9 => 2.0.9
    gatsby-plugin-sass: ^5.2.0 => 5.25.0
    gatsby-plugin-sharp: ^4.2.0 => 4.25.1
    gatsby-plugin-sitemap: ^5.2.0 => 5.25.0
    gatsby-source-filesystem: ^4.2.0 => 4.25.0
    gatsby-source-s3: ^4.1.1 => 4.1.1
    gatsby-transformer-sharp: ^4.2.0 => 4.25.0

Our flags:

flags: {
                FAST_DEV: true,
                PARALLEL_QUERY_RUNNING: true,
            },

We're currently pretty much in the dark with this. We tried getting rid of the flags, tried adding CPU_COUNT=1 to the build scripts, tried cleaning the cache before the build, modified logic arround the gatsby-images, but nothing had an impact.

For what we know it should be building the previews fine. Any clue on this?

1

There are 1 best solutions below

0
Yuri G. On

The error says that gatsby procces tried to communicate with a gatsby worker and didn't find the worker. It means that the worker has crashed for some reason. You need to figure out what and why is crashing. I would start with limiting CPU to 1, see the docs, or may be with increasing the machine resources.