Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few issues when running locally #3

Closed
umaar opened this issue Nov 23, 2023 · 6 comments
Closed

A few issues when running locally #3

umaar opened this issue Nov 23, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@umaar
Copy link

umaar commented Nov 23, 2023

Seeing a few issues like:

[Info] Generated embedding {"table":"document_sections","id":71,"contentColumn":"content","embeddingColumn":"embedding"}

CPU time limit reached. isolate: 10342867669556939419
event loop error: Uncaught Error: execution terminated
failed to send request to user worker: connection closed before message completed
failed to send request to user worker: connection closed before message completed
InvalidWorkerResponse: user worker failed to respond
    at async Promise.all (index 1)
    at async UserWorker.fetch (ext:sb_user_workers/user_workers.js:64:19)
    at async Server.<anonymous> (file:///home/deno/main/index.ts:128:12)
    at async Server.#respond (https://deno.land/std@0.182.0/http/server.ts:220:18) {
  name: "InvalidWorkerResponse"
}
InvalidWorkerResponse: user worker failed to respond
    at async Promise.all (index 1)
    at async UserWorker.fetch (ext:sb_user_workers/user_workers.js:64:19)
    at async Server.<anonymous> (file:///home/deno/main/index.ts:128:12)
    at async Server.#respond (https://deno.land/std@0.182.0/http/server.ts:220:18) {
  name: "InvalidWorkerResponse"
}
serving the request with /home/deno/functions/chat
serving the request with /home/deno/functions/chat

And

[Info] Saved 25 sections for file 'roman-empire-3.md'

serving the request with /home/deno/functions/embed
serving the request with /home/deno/functions/embed
serving the request with /home/deno/functions/embed
client connection error (hyper::Error(IncompleteMessage))
client connection error (hyper::Error(IncompleteMessage))
client connection error (hyper::Error(IncompleteMessage))
[Info] Generated embedding {"table":"document_sections","id":66,"contentColumn":"content","embeddingColumn":"embedding"}

And:

 ⨯ node_modules/@xenova/transformers/src/env.js (60:0) @ eval
 ⨯ TypeError: Cannot read properties of undefined (reading 'wasm')
    at __webpack_require__ (/code/chatgpt-your-files/.next/server/webpack-runtime.js:33:43)
    at __webpack_require__ (/code/chatgpt-your-files/.next/server/webpack-runtime.js:33:43)
    at __webpack_require__ (/code/chatgpt-your-files/.next/server/webpack-runtime.js:33:43)
    at __webpack_require__ (/code/chatgpt-your-files/.next/server/webpack-runtime.js:33:43)
    at __webpack_require__ (/code/chatgpt-your-files/.next/server/webpack-runtime.js:33:43)
    at eval (./lib/hooks/use-pipeline.ts:5:78)
    at (ssr)/./lib/hooks/use-pipeline.ts (/code/chatgpt-your-files/.next/server/app/chat/page.js:423:1)
    at __webpack_require__ (/code/chatgpt-your-files/.next/server/webpack-runtime.js:33:43)
    at eval (./app/chat/page.tsx:10:81)
    at (ssr)/./app/chat/page.tsx (/code/chatgpt-your-files/.next/server/app/chat/page.js:357:1)
    at __webpack_require__ (/code/chatgpt-your-files/.next/server/webpack-runtime.js:33:43)
    at JSON.parse (<anonymous>)
null
  • Running locally on macOS
  • deno 1.38.2
  • node v21.1.0
  • supabase 1.102.0

Wondering what that could be about. Thanks for the great workshop!

@umaar umaar added the bug Something isn't working label Nov 23, 2023
@kleenkanteen
Copy link

Try again te batch size got decreased: #2

@gregnr
Copy link
Collaborator

gregnr commented Nov 28, 2023

Thank you for reporting @umaar. The CPU limit issues looks related to #2 - we'll open a PR shortly to get this fix into local dev. I'll look into the other issues!

@gregnr
Copy link
Collaborator

gregnr commented Nov 29, 2023

Just an update - a pre-release version of the CLI is now available to test the new CPU limit logic. Feel free to try this by updating your supabase CLI dependency to v1.116.0 or above:

  1. Stop your local supabase stack:

    npx supabase stop
  2. Upgrade supabase dependency:

    npm i -D supabase@1.116.0
  3. Start back up your local supabase stack:

    npx supabase start
  4. Serve your edge functions as usual:

    npx supabase functions serve

@gregnr
Copy link
Collaborator

gregnr commented Jan 5, 2024

An update - since my last comment this repo now uses the latest Supabase CLI v1.127.4 which uses edge-runtime v1.29.1: #14

Of the errors above, I am still able to reproduce these errors:

client connection error (hyper::Error(IncompleteMessage))

and (intermittently):

CPU time limit reached. isolate: ...

Will post updates as I learn more.

@gregnr
Copy link
Collaborator

gregnr commented Jan 10, 2024

This error:

client connection error (hyper::Error(IncompleteMessage))

Has now been addressed in this PR: #15

The issue was due to pg_net closing the HTTP connection too early due to a timeout. Increasing the timeout removes this error.

@gregnr
Copy link
Collaborator

gregnr commented Jan 10, 2024

The last error:

CPU time limit reached. isolate: ...

We'll track in this issue going forward: #2.

Closing this issue now, but feel free to comment if you still experience any of the other issues above. Thanks again for reporting!

@gregnr gregnr closed this as completed Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants