MbinOrg / mbin-website

Source for the joinmbin.org website, built with Solid.js, SolidUI, and Tailwind CSS.
https://joinmbin.org/
GNU Affero General Public License v3.0
4 stars 0 forks source link

Very long load #2

Open melroy89 opened 1 month ago

melroy89 commented 1 month ago

When running: pnpm dev -- --open or just pnpm dev it takes forever to get the site started!?

I suspect it caused by busy waiting for all the time-outs!? Can we stop busy waiting? Or should we remove the instances?

Error: supermeter.social: invalid nodeinfo response (skip)
    at fetchServerInfo (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:112:11)
    at async Promise.allSettled (index 18)
    at async initServerData (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:175:5)
    at async file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:195:1 {
  [cause]: TypeError: fetch failed
      at node:internal/deps/undici/undici:13185:13
      at async fetchServerInfo (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:105:7)
      at async Promise.allSettled (index 18)
      at async initServerData (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:175:5)
      at async file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:195:1 {
    [cause]: HeadersTimeoutError: Headers Timeout Error
        at Timeout.onParserTimeout [as callback] (node:internal/deps/undici/undici:5995:32)
        at Timeout.onTimeout [as _onTimeout] (node:internal/deps/undici/undici:2356:17)
        at listOnTimeout (node:internal/timers:594:17)
        at process.processTimers (node:internal/timers:529:7) {
      code: 'UND_ERR_HEADERS_TIMEOUT'
    }
  }
}
Error: social.tath.link: invalid nodeinfo response (skip)
    at fetchServerInfo (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:112:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Promise.allSettled (index 19)
    at async initServerData (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:175:5)
    at async file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:195:1 {
  [cause]: TypeError: fetch failed
      at node:internal/deps/undici/undici:13185:13
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
      at async fetchServerInfo (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:105:7)
      at async Promise.allSettled (index 19)
      at async initServerData (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:175:5)
      at async file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:195:1 {
    [cause]: ConnectTimeoutError: Connect Timeout Error
        at onConnectTimeout (node:internal/deps/undici/undici:2331:28)
        at node:internal/deps/undici/undici:2283:50
        at Immediate._onImmediate (node:internal/deps/undici/undici:2315:13)
        at process.processImmediate (node:internal/timers:491:21) {
      code: 'UND_ERR_CONNECT_TIMEOUT'
    }
  }
}
Mbin servers found: 19
vinxi v0.3.14
vinxi starting dev server

  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

11:47:48 PM [vite] ✨ new dependencies optimized: class-variance-authority, clsx, tailwind-merge
11:47:48 PM [vite] ✨ optimized dependencies changed. reloading
melroy89 commented 1 month ago

I even think pnpm dev -- --open is fully broken at this point..

melroy89 commented 1 month ago

Yea, so pretty sure these calls are the big problem:

Error: supermeter.social: invalid nodeinfo response (skip)
    at fetchServerInfo (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:112:11)
    at async Promise.allSettled (index 18)
    at async initServerData (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:175:5)
    at async file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:195:1 {
  [cause]: TypeError: fetch failed
      at node:internal/deps/undici/undici:13185:13
      at async fetchServerInfo (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:105:7)
      at async Promise.allSettled (index 18)
      at async initServerData (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:175:5)
      at async file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:195:1 {
    [cause]: HeadersTimeoutError: Headers Timeout Error
        at Timeout.onParserTimeout [as callback] (node:internal/deps/undici/undici:5995:32)
        at Timeout.onTimeout [as _onTimeout] (node:internal/deps/undici/undici:2356:17)
        at listOnTimeout (node:internal/timers:594:17)
        at process.processTimers (node:internal/timers:529:7) {
      code: 'UND_ERR_HEADERS_TIMEOUT'
    }
  }
}
Error: social.tath.link: invalid nodeinfo response (skip)
    at fetchServerInfo (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:112:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Promise.allSettled (index 19)
    at async initServerData (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:175:5)
    at async file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:195:1 {
  [cause]: TypeError: fetch failed
      at node:internal/deps/undici/undici:13185:13
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
      at async fetchServerInfo (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:105:7)
      at async Promise.allSettled (index 19)
      at async initServerData (file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:175:5)
      at async file:///media/melroy/Data/Projects/mbin-website/src/initdata.js:195:1 {
    [cause]: ConnectTimeoutError: Connect Timeout Error
        at onConnectTimeout (node:internal/deps/undici/undici:2331:28)
        at node:internal/deps/undici/undici:2283:50
        at Immediate._onImmediate (node:internal/deps/undici/undici:2315:13)
        at process.processImmediate (node:internal/timers:491:21) {
      code: 'UND_ERR_CONNECT_TIMEOUT'
    }
  }
}

I hope this can be fixed so we don't need to wait 15 mins.

jwr1 commented 1 month ago

Yes, we probably need to figure out how to add a timeout, because those requests should be taking probably 10 seconds at the most (even that's high though).

As a workaround for now, as long as you have run pnpm run initdata at least once (to fetch Mbin server info), then you can just use pnpx vinxi dev and it will skip fetching the data.

melroy89 commented 1 month ago

Yeah. I do see other request failures and timeouts. But the two above (giving back invalid nodeinfo response) seems to be a bit of a nightmare, since these timeouts apparently are set to a very high timeout by default.