garden-io / garden

Automation for Kubernetes development and testing. Spin up production-like environments for development, testing, and CI on demand. Use the same configuration and workflows at every step of the process. Speed up your builds and test runs via shared result caching
https://garden.io
Mozilla Public License 2.0
3.39k stars 275 forks source link

0.13: [Bug]: `garden up` terminates abnormally #4960

Open 24601 opened 1 year ago

24601 commented 1 year ago

Garden Bonsai (0.13) Bug

Current Behavior

garden up terminates abnormally shortly after running with the following information:

──────────────────────────────────────────────────────────────────────────────────────────── 🌼 🌸 🌷 🌺 🌻  ────────────────────────────────────────────────────────────────────────────────────────────
 🌼  > <enter command> (enter help for more info)

  ⠇  Running deploy command...
/snapshot/project/tmp/pkg/cli/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error [ERR_STREAM_WRITE_AFTER_END]: write after end
    at new NodeError (node:internal/errors:388:5)
    at _write (node:internal/streams/writable:322:11)
    at Writable.write (node:internal/streams/writable:337:10)
    at Socket.ondata (node:internal/streams/readable:766:22)
    at Socket.emit (node:events:549:35)
    at Socket.emit (node:domain:482:12)
    at Readable.read (node:internal/streams/readable:539:10)
    at Socket.read (node:net:695:39)
    at flow (node:internal/streams/readable:1023:34)
    at resume_ (node:internal/streams/readable:1004:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on Transform instance at:
    at Transform.onerror (node:internal/streams/readable:785:14)
    at Transform.emit (node:events:549:35)
    at Transform.emit (node:domain:482:12)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'ERR_STREAM_WRITE_AFTER_END'
}

Node.js v18.5.0

Expected behavior

garden up does not exit abnormally, and any underlying errors or troubles are reported and handled without process exit and/or leaving the user scratching their head as to what went wrong.

Reproducible example

Can provide access to our GH upon request directly to garden team members/committers to replicate.

Workaround

None

Suggested solution(s)

Catch high level uncaughts.

Additional context

We have a Pulumi deploy in this project using the "Deploy" (not module) functionality. I suspect there is some error or issue inside our actual Pulumi deploy/config that is causing an error that Garden is simply not handling gracefully. Running the stack deploys with pulumi up usually shows such issues, etc, but we are not sure. Whatever the case, the behavior to abnormally terminate with this message is probably something garden should address in Pulumi error states, which are common/important to surface and handle appropriately at the Garden level IMO.

Your environment

garden version: 0.13.12

salotz commented 1 year ago

I'm getting the same error using Pulumi. Its only happening when running in CI.