qdrant / qdrant-js

JavaScript/Typescript SDK for Qdrant Vector Database
https://qdrant.tech
Apache License 2.0
222 stars 18 forks source link

403 on client.scroll (yet working in python) #74

Open thomasf1 opened 2 months ago

thomasf1 commented 2 months ago

Trying to port over some code from python, but getting an 403 while the same request with the same server etc works with the python code:

import {QdrantClient} from '@qdrant/js-client-rest';

const QDRANT_COLLECTION = "test_8";
const client = new QdrantClient({
    url: "https://(redacted).gcp.cloud.qdrant.io:6333",
    api_key: "(redacted)"
});

const res = client.scroll(QDRANT_COLLECTION) // simplest possible, also tried with options like limit etc.
const res2 = await res

Gets the following - however the same code in python gets a result (tried it before and after the js code):

ApiError: Forbidden
    at Object.fun [as scrollPoints] (file:///Users/tom/Dev/gt/node_modules/@qdrant/openapi-typescript-fetch/dist/esm/fetcher.js:169:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async QdrantClient.scroll (file:///Users/tom/Dev/gt/node_modules/@qdrant/js-client-rest/dist/esm/qdrant-client.js:322:26)
    at async file:///Users/tom/Dev/gt/serve_node.js:27:14 {
  headers: Headers {
    [Symbol(headers list)]: HeadersList {
      cookies: null,
      [Symbol(headers map)]: Map(3) {
        'content-length' => { name: 'content-length', value: '21' },
        'content-type' => {
          name: 'content-type',
          value: 'application/json; charset=utf-8'
        },
        'date' => { name: 'date', value: 'Thu, 16 May 2024 13:17:33 GMT' }
      },
      [Symbol(headers map sorted)]: null
    },
    [Symbol(guard)]: 'immutable',
    [Symbol(realm)]: null
  },
  url: 'https://(redacted).gcp.cloud.qdrant.io:6333/collections/vguys_test_8/points/scroll',
  status: 403,
  statusText: 'Forbidden',
  data: { error: 'forbidden' }
}
Anush008 commented 3 weeks ago

Hi @thomasf1. It should've been apiKey instead of api_key.