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

🐛 BUG: Wrangler dev server silently dies without showing in the CLI or throwing an error #7268

Open
NikhilVerma opened this issue Nov 15, 2024 · 1 comment
Labels
bug Something that isn't working

Comments

@NikhilVerma
Copy link

NikhilVerma commented Nov 15, 2024

Which Cloudflare product(s) does this pertain to?

Workers AI

What version(s) of the tool(s) are you using?

^3.60.3

What version of Node are you using?

v20.16.0

What operating system and version are you using?

MacOS 15.1 (24B83)

Describe the Bug

Observed behavior

  1. Run npm run dev --experimental-vectorize-bind-to-prod
  2. Post some vectors to the upsert endpoint
  3. The wrangler local dev dies (the HTTP endpoint stops working) but the CLI reports no errors, infact the CLI behaves as if the backend is working, however it shows no logs of any requests. The server has to be restarted.
  4. When I deploy the worker to prod it actually works fine!

Here is the relevant script section.

import {
	Vectorize,
	ExportedHandler,
	VectorizeVector,
	VectorizeVectorMetadataFilter
} from "@cloudflare/workers-types/2023-07-01";

export default {
	async fetch(request, env, _ctx): Promise<Response> {
		const path = new URL(request.url).pathname;

		// Upsert vectors
		if (path.startsWith("/documents-embedding/upsert")) {
			const vectors = await request.json<VectorizeVector[]>();
			const inserted = await env.DOCUMENTS_INDEX.upsert(vectors);
			return Response.json(inserted);
		}

Also my wrangler.toml (Relevant portion)

[[vectorize]]
binding = "DOCUMENTS_INDEX"
index_name = "documents-index"

Expected behavior

Wrangler dev should not fail

Steps to reproduce

Provided above

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

ConnectionClosed: The socket connection was closed unexpectedly. ) path: "http://localhost:8787/documents-embedding/upsert"

@NikhilVerma NikhilVerma added the bug Something that isn't working label Nov 15, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Nov 15, 2024
@garrettgu10
Copy link
Contributor

Hi @NikhilVerma, I'm having trouble reproducing this. Can you share the full script as well as cURL for the requests you use to upsert the vectors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Status: Untriaged
Development

No branches or pull requests

2 participants