typesense icon indicating copy to clipboard operation
typesense copied to clipboard

Error while removing field `field_name` from document

Open AzikDeveloper opened this issue 2 years ago • 4 comments

Description

When i start typesense service using docker it is returning 503 error in all APIs. I did bulk import of 10000s of documents. Total 30000. I am thinking maybe that is something to do with this error.

Collection Scheme

{
        "name": "collection_5",
        "enable_nested_fields": True,
        "fields": [
            {"name": "id", "type": "string"},
            {"name": "available", "type": "bool"},
            {"name": "name", "type": "string"},
            {"name": "name_cy", "type": "string", "optional": True},
            {"name": "name_lat", "type": "string", "optional": True},
            {"name": "url", "type": "string", "optional": True, "index": False},
            {"name": "picture", "type": "string", "optional": True, "index": False},
            {"name": "price", "type": "float", "optional": True},
            {"name": "old_price", "type": "float", "optional": True},
            {"name": "ordering", "type": "int32", "optional": True},
            {"name": "keywords", "type": "string[]", "optional": True},
            {"name": "code", "type": "string", "optional": True, "index": False},
            {"name": "category", "type": "object"},
            {"name": "category.id", "type": "string", "facet": True},
            {"name": "category.name", "type": "string"},
            {"name": "category.name_cy", "type": "string", "optional": True},
            {"name": "category.name_lat", "type": "string", "optional": True},
            {"name": "category.url", "type": "string", "optional": True, "index": False},
            {"name": "category.ordering", "type": "int32", "optional": True},
        ],
    }


Logs

W20240304 10:59:34.117610 300 index.cpp:6181] Error while removing field category.ordering from document, message: [json.exception.type_error.302] type must be number, but is null 2024-03-04T10:59:34.118898465Z W20240304 10:59:34.117625 300 index.cpp:6181] Error while removing field category.ordering from document, message: [json.exception.type_error.302] type must be number, but is null 2024-03-04T10:59:34.118904743Z W20240304 10:59:34.117640 300 index.cpp:6181] Error while removing field category.ordering from document, message: [json.exception.type_error.302] type must be number, but is null 2024-03-04T10:59:34.118907752Z W20240304 10:59:34.117655 300 index.cpp:6181] Error while removing field category.ordering from document, message: [json.exception.type_error.302] type must be number, but is null 2024-03-04T10:59:34.118910634Z W20240304 10:59:34.117669 300 index.cpp:6181] Error while removing field category.ordering from document, message: [json.exception.type_error.302] type must be number, but is null 2024-03-04T10:59:34.118913594Z W20240304 10:59:34.117684 300 index.cpp:6181] Error while removing field category.ordering from document, message: [json.exception.type_error.302] type must be number, but is null 2024-03-04T10:59:34.118916514Z W20240304 10:59:34.117699 300 index.cpp:6181] Error while removing field category.ordering from document, message: [json.exception.type_error.302] type must be number, but is null 2024-03-04T10:59:34.118919430Z W20240304 10:59:34.117714 300 index.cpp:6181] Error while removing field category.ordering from document, message: [json.exception.type_error.302] type must be number, but is null 2024-03-04T10:59:34.118922364Z W20240304 10:59:34.117728 300 index.cpp:6181] Error while removing field category.ordering from document, message: [json.exception.type_error.302] type must be number, but is null 2024-03-04T10:59:34.118925553Z W20240304 10:59:34.117743 300 index.cpp:6181] Error while removing field category.ordering from document, message: [json.exception.type_error.302] type must be number, but is null 2024-03-04T10:59:34.118928486Z W20240304 10:59:34.117758 300 index.cpp:6181] Error while removing field category.ordering from document, message: [json.exception.type_error.302] type must be number, but is null 2024-03-04T10:59:36.555116368Z I20240304 10:59:36.554966 262 raft_server.cpp:557] Term: 73, pending_queue: 0, last_index: 297, committed: 297, known_applied: 297, applying: 0, pending_writes: 0, queued_writes: 0, local_sequence: 630316 2024-03-04T10:59:36.555134636Z

Metadata

Typesense Version: 0.25.2

OS: docker image

AzikDeveloper avatar Mar 04 '24 11:03 AzikDeveloper

Would you be able to share a simple dataset with few records where we can reproduce this error?

kishorenc avatar Mar 04 '24 13:03 kishorenc

Hello, I'm also getting a lot of logs with this error but it finally seems to update the field correctly.

Steps to reproduce

  1. Set a field with "optional": True. For me, it was set by {"name": ".*", "type": "auto"}
  2. Add a document with null value on the field
  3. Update the document with a not null value => The error is logged
  4. When retrieving the document, the not null value is correctly set

Excpected behaviour

Don't log an error if field is updated correctly

Metadata

Version: 0.25.2 OS: docker

cmigazzi avatar May 29 '24 07:05 cmigazzi

This should be fixed in 27.0.rc18 -- can you please check @cmigazzi ?

kishorenc avatar Jun 13 '24 15:06 kishorenc

It looks good to me with 27.0.rc18, no more error. Thank you @kishorenc

cmigazzi avatar Jun 13 '24 16:06 cmigazzi