toastdotdev/toast

RequestError: connect ECONNREFUSED /var/tmp/toaster.sock

johno opened this issue ยท 2 comments

johno commented

I started seeing an ECONNREFUSED when running yarn build on my site.

What I've done so far:

  • Turned it off and on again (reinstalled node_modules, nuked .tmp and public)
  • Even turned off my machine as a sanity check to make sure it wasn't a hanging socket (#39) ๐Ÿ˜ธ

Error

Error: 
   0: command ["node", "--unhandled-rejections", "strict", "--loader", "toast/src/loader.mjs", "/Users/johno-mini/c/_/node_modules/.bin/toast-source-data", "/var/tmp/toaster.sock", "/Users/johno-mini/c/_/toast.js"] exited with code 1
See full error ๐Ÿ‘‡
~/c/_ master* 20s
โฏ yarn build
yarn run v1.17.3
$ toast incremental .
internal/process/promises.js:213
        triggerUncaughtException(err, true /* fromPromise */);
        ^
RequestError: connect ECONNREFUSED /var/tmp/toaster.sock
    at ClientRequest.<anonymous> (/Users/johno-mini/c/_/node_modules/toast/node_modules/got/dist/source/core/index.js:953:111)
    at Object.onceWrapper (events.js:422:26)
    at ClientRequest.emit (events.js:327:22)
    at ClientRequest.origin.emit (/Users/johno-mini/c/_/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
    at Socket.socketErrorListener (_http_client.js:469:9)
    at Socket.emit (events.js:315:20)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  code: 'ECONNREFUSED',
  timings: {
    start: 1603541392801,
    socket: 1603541392801,
    lookup: undefined,
    connect: undefined,
    secureConnect: undefined,
    upload: undefined,
    response: undefined,
    end: undefined,
    error: 1603541392802,
    abort: undefined,
    phases: {
      wait: 0,
      dns: undefined,
      tcp: undefined,
      tls: undefined,
      request: undefined,
      firstByte: undefined,
      download: undefined,
      total: 1
    }
  }
}
Error: 
   0: command ["node", "--unhandled-rejections", "strict", "--loader", "toast/src/loader.mjs", "/Users/johno-mini/c/_/node_modules/.bin/toast-source-data", "/var/tmp/toaster.sock", "/Users/johno-mini/c/_/toast.js"] exited with code 1

  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” BACKTRACE โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
                                โ‹ฎ 3 frames hidden โ‹ฎ                               
   4: toast::toast::node::run_cmd::h9d9a3c2a5fa76fe8
      at <unknown source file>
   5: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::he47fcc2b11006133
      at <unknown source file>
   6: toast::incremental::incremental_compile::{{closure}}::{{closure}}::ha40330418d242ba8
      at <unknown source file>
   7: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h53876f90ad0f9a73
      at <unknown source file>
   8: std::thread::local::LocalKey<T>::with::h81b469bca11781f6
      at <unknown source file>
   9: scoped_tls::ScopedKey<T>::set::hdedae796555744ea
      at <unknown source file>
  10: async_executor::LocalExecutor::run::hbfae8c20597cf639
      at <unknown source file>
  11: scoped_tls::ScopedKey<T>::set::h30c44173ba9e88d3
      at <unknown source file>
  12: async_std::task::executor::enter::h9f133f3a3dfe9bb4
      at <unknown source file>
  13: std::thread::local::LocalKey<T>::with::h55a898b483631204
      at <unknown source file>
  14: async_std::task::builder::Builder::blocking::h1f419a2e6583933f
      at <unknown source file>
  15: toast::main::h16d9852f5caf3b57
      at <unknown source file>
  16: std::sys_common::backtrace::__rust_begin_short_backtrace::h19a27f3b540e72c0
      at <unknown source file>
  17: std::rt::lang_start::{{closure}}::ha2138aeb05c9341a
      at <unknown source file>
  18: std::rt::lang_start_internal::he8007b277bc5e1b2
      at <unknown source file>
  19: _main
      at <unknown source file>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.

Metadata

key value
version 0.1.0
os_type Darwin
os_release 19.6.0
johno commented

I was able to manually fix it with rm /var/tmp/toaster.sock. Turns out it was a hanging socket that persists a machine reboot (TIL).

#39 is the tracking issue for this