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

Firestore emulator does not support vector embeddings #7216

Closed
vmgarcia opened this issue May 23, 2024 · 3 comments
Closed

Firestore emulator does not support vector embeddings #7216

vmgarcia opened this issue May 23, 2024 · 3 comments

Comments

@vmgarcia
Copy link

[REQUIRED] Environment info

firebase-tools: 13.02

Platform: macOS

[REQUIRED] Test case

import { Firestore, FieldValue } from "@google-cloud/firestore";

  const firestore = new Firestore({
    projectId: "demo-client",
    host: "127.0.0.1",
    port: 8080,
    ssl: false,
  });

  const collection = firestore.collection("messages");
  const response = await collection.add({
    title: "Welcome to Firestore",
    body: "Hello World",
    vec: FieldValue.vector([1, 2, 3]),
  });

[REQUIRED] Steps to reproduce

Just run the above code in nodejs.

[REQUIRED] Expected behavior

A document with a vector will be created.

[REQUIRED] Actual behavior

Error: 3 INVALID_ARGUMENT: Property vec contains an invalid nested entity.
 ❯ callErrorFromStatus node_modules/.pnpm/@[email protected]/node_modules/@grpc/grpc-js/src/call.ts:82:17
 ❯ Object.onReceiveStatus node_modules/.pnpm/@[email protected]/node_modules/@grpc/grpc-js/src/client.ts:360:55
 ❯ Object.onReceiveStatus node_modules/.pnpm/@[email protected]/node_modules/@grpc/grpc-js/src/client-interceptors.ts:458:34
 ❯ Object.onReceiveStatus node_modules/.pnpm/@[email protected]/node_modules/@grpc/grpc-js/src/client-interceptors.ts:419:48
 ❯ node_modules/.pnpm/@[email protected]/node_modules/@grpc/grpc-js/src/resolving-call.ts:163:24
 ❯ ServiceClientImpl.makeUnaryRequest node_modules/.pnpm/@[email protected]/node_modules/@grpc/grpc-js/src/client.ts:325:42
 ❯ ServiceClientImpl.<anonymous> node_modules/.pnpm/@[email protected]/node_modules/@grpc/grpc-js/src/make-client.ts:189:15
 ❯ node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/firestore/build/src/v1/firestore_client.js:242:29
 ❯ node_modules/.pnpm/[email protected]/node_modules/google-gax/build/src/normalCalls/timeout.js:44:16
 ❯ repeat node_modules/.pnpm/[email protected]/node_modules/google-gax/build/src/normalCalls/retries.js:80:25
 ❯ node_modules/.pnpm/[email protected]/node_modules/google-gax/build/src/normalCalls/retries.js:119:13
 ❯ OngoingCallPromise.call node_modules/.pnpm/[email protected]/node_modules/google-gax/build/src/call.js:67:27
 ❯ NormalApiCaller.call node_modules/.pnpm/[email protected]/node_modules/google-gax/build/src/normalCalls/normalApiCaller.js:34:19
 ❯ node_modules/.pnpm/[email protected]/node_modules/google-gax/build/src/createApiCall.js:112:30
 ❯ WriteBatch.commit node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/firestore/build/src/write-batch.js:433:23
 ❯ DocumentReference.create node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/firestore/build/src/reference.js:332:14
 ❯ CollectionReference.add node_modules/.pnpm/@[email protected]/node_modules/@google-cloud/firestore/build/src/reference.js:2854:28
 ❯ tests/crud.test.ts:30:37
     28|
     29|   const collection = firestore.collection("messages");
     30|   const response = await collection.add({
       |                                     ^
     31|     title: "Welcome to Firestore",
     32|     body: "Hello World",

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 3, details: 'Property vec contains an invalid nested entity.', metadata: { 'content-type': [ 'application/grpc' ] }, note: 'Exception occurred in retry method that was not classified as transient' }
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
@aalej
Copy link
Contributor

aalej commented May 24, 2024

Hey @vmgarcia, thanks for sharing code snippets and the error you encountered. I tried reproducing this issue using the latest version of firebase-tools, which is currently 13.10.0, and no errors were raised when running the code snippet you provided.

Could you try upgrading to the latest version to see if this would resolve the issue?

@aalej aalej added the Needs: Author Feedback Issues awaiting author feedback label May 24, 2024
@vmgarcia
Copy link
Author

That fixed it, thanks for the help. For anyone that runs across this issue, to upgrade you need to run

npm update -g firebase-tools

@google-oss-bot google-oss-bot added Needs: Attention and removed Needs: Author Feedback Issues awaiting author feedback labels May 24, 2024
@aalej
Copy link
Contributor

aalej commented May 28, 2024

It’s good to know that the issue is now resolved. I’m going to go ahead and close this. Thanks!

@aalej aalej closed this as completed May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants