#community-help

Bug in Using Import-Documents Endpoint

TLDR Dan reported a bug when using the import-documents with an upsert to update documents while Cory experienced the same. Kishore Nallan offered a solution through a release candidate (RC) build after identifying the data edge case.

Powered by Struct AI
Aug 31, 2022 (16 months ago)
Dan
Photo of md5-f8f7b04dda4a09dec991cdc07f4d9c64
Dan
01:03 PM
Possibly a bug somewhere - we’re using the import-documents endpoint with upsert to update our docs for now - but we’re seeing that this fails with a 400 with some payloads - and there is no further information given. this only happens in one environment, on our staging env (with same schema and doc) it imports correctly. A minimal document of an id and one field always triggers this.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:03 PM
The import response lines should have error message: does it not have?
Dan
Photo of md5-f8f7b04dda4a09dec991cdc07f4d9c64
Dan
01:03 PM
it does not
01:03
Dan
01:03 PM
rejects the whole call with a 400
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:03 PM
What is the response body?
Dan
Photo of md5-f8f7b04dda4a09dec991cdc07f4d9c64
Dan
01:04 PM
> "{\"message\": \"Bad request.\"}",
01:04
Dan
01:04 PM
here’s the headers:
{"Connection" "close",
 "access-control-allow-origin" "*",
 "content-type" "application/json; charset=utf-8",
 "transfer-encoding" "chunked"}
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:05 PM
Is this on Typesense Cloud?
Dan
Photo of md5-f8f7b04dda4a09dec991cdc07f4d9c64
Dan
01:05 PM
correct
01:05
Dan
01:05 PM
can I pm you the uri?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:06 PM
Can you DM me the cluster ID? I can check if something is logged. Also tell me a date/time in UTC when error happened.
Dan
Photo of md5-f8f7b04dda4a09dec991cdc07f4d9c64
Dan
01:07 PM
done
Sep 10, 2022 (15 months ago)
Cory
Photo of md5-047f0d10d7838fdb02d7cc7940f89427
Cory
02:35 PM
Experiencing this same issue, getting back a Bad request and can’t see any noticeable difference between the payloads that succeed and fail. Though they do seem to be somewhat consistent.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
02:37 PM
The above thread turned out to be a data edge case that I was able to fix in a RC build. Can you please DM your cluster ID?

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3005 threads (79% resolved)

Join Our Community

Similar Threads

Handling Kinesis Stream Event Batching with Typesense

Dui had questions about how to handle Kinesis stream events with Typesense. Kishore Nallan suggested using upsert mode for creation/update and differentiating with logical deletion. After various discussions including identifying and resolving a bug, they finalized to introduce an `emplace` action in Typesense v0.23.

8

91
24mo

Troubleshooting Indexing Duration in Typesense Import

Alan asked about lengthy indexing times for importing documents to Typesense. Jason suggested various potential causes, including network connectivity and system resources. They later identified the problem to be an error in Alan's code.

5

43
15mo
Solved

Resolving Typesense v0.22.0 Import Issues

Anton encountered issues importing documents in batches using Typesense v0.22.0. Kishore Nallan suggested using atomic import and proposed a debug build. After multiple trials, they were able to reproduce and fix the issue. Anton confirmed the solution was working.

1

57
27mo
Solved

Working with Typesense SDK and Addressing Import Issues

Jacob was having issues with importing and indexing documents using Typesense SDK. After discussing with Jason, the user discovered the `emplace` action was ideal for their parallel processing requirement.

1

7
15mo
Solved

Typesense Server Bulk Import/Upsert Issue Resolved

Adam was confused about the discrepancy between the successful responses and the actual indexed data while working with a custom WP plugin integrating with Typesense. The issue was a bug related to fetching documents in the wrong order, not a Typesense problem.

2

22
7mo
Solved