Panic with 1.25.8

I am running docker image cr.weaviate.io/semitechnologies/weaviate:1.25.8 and seeing this panic while loading data:

goroutine 2297272 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
/usr/local/go/src/runtime/debug/stack.go:16 +0x1c
github.com/weaviate/weaviate/entities/errors.GoWrapperWithBlock.func1.1()
/go/src/github.com/weaviate/weaviate/entities/errors/go_wrapper.go:48 +0x170
panic({0x144eb00?, 0x405a5f9380?})
/usr/local/go/src/runtime/panic.go:914 +0x218
github.com/weaviate/weaviate/usecases/modules.reVectorize({0x1bca2f0, 0x4053bd38c0}, {0x1bcd700?, 0x405a520200?}, {0xf70be1628158?, 0x4003aad110?}, 0x40538d74d0, 0x4053c41550, {0x0, 0x0, …}, …)
/go/src/github.com/weaviate/weaviate/usecases/modules/compare.go:126 +0xc14
github.com/weaviate/weaviate/usecases/modules.(*Provider).batchUpdateVector(0x4002b7dd60, {0x1bca2f0, 0x4053bd38c0}, {0x4053050800?, 0x3e8, 0x500}, 0x4053c41550, 0x9?, {0x0, 0x0}, …)
/go/src/github.com/weaviate/weaviate/usecases/modules/vectorizer.go:203 +0x3a8
github.com/weaviate/weaviate/usecases/modules.(*Provider).BatchUpdateVector(0x4002b7dd60, {0x1bca2f0?, 0x4053bd38c0}, 0x4053c41550, {0x4053050800, 0x3e8, 0x500}, 0x405a580610, {0x1be1b48, 0x40038d0f80})
/go/src/github.com/weaviate/weaviate/usecases/modules/vectorizer.go:111 +0x240
github.com/weaviate/weaviate/usecases/objects.(*BatchManager).validateAndGetVector(0x4002caf880, {0x1bca2f0, 0x4053bd38c0}, 0x402ff19a68?, {0x4053426000, 0x3e8, 0x402ff19ad8?}, 0x0)
/go/src/github.com/weaviate/weaviate/usecases/objects/batch_add.go:159 +0x8e8
github.com/weaviate/weaviate/usecases/objects.(*BatchManager).AddObjects(0x4002caf880, {0x1bca2f0, 0x404ab01f80}, 0x41b04c0?, {0x4053426000, 0x3e8, 0x3e8}, {0x404ab018f0?, 0x1ba4020?, 0x41b04c0?}, …)
/go/src/github.com/weaviate/weaviate/usecases/objects/batch_add.go:56 +0x2a0
github.com/weaviate/weaviate/adapters/handlers/grpc/v1.(*Service).batchObjects(0x4002ca1580, {0x1bca2f0, 0x404ab01f80}, 0x404ade5720)
/go/src/github.com/weaviate/weaviate/adapters/handlers/grpc/v1/service.go:150 +0x2b4
github.com/weaviate/weaviate/adapters/handlers/grpc/v1.(*Service).BatchObjects.func1()
/go/src/github.com/weaviate/weaviate/adapters/handlers/grpc/v1/service.go:131 +0x3c
github.com/weaviate/weaviate/entities/errors.GoWrapperWithBlock.func1()
/go/src/github.com/weaviate/weaviate/entities/errors/go_wrapper.go:53 +0x74
created by github.com/weaviate/weaviate/entities/errors.GoWrapperWithBlock in goroutine 2297271
/go/src/github.com/weaviate/weaviate/entities/errors/go_wrapper.go:42 +0xa4
{“level”:“error”,“msg”:“Recovered from panic: interface conversion: interface {} is interface {}, not string”,“time”:“2024-07-25T16:12:59Z”}

hi @ctindel !!

I have just faced this exact same error recently.

Are you by any chance updating an object and not passing a TEXT_ARRAY?

here is a code I was able to run and reproduce and get this error message:


import weaviate
from weaviate.util import generate_uuid5
from weaviate import classes as wvc
client = weaviate.connect_to_local()

print(weaviate.__version__, client.get_meta().get("version"))

client.collections.delete("Test")
collection = client.collections.create(
    "Test",
    properties=[
        wvc.config.Property(
            name="tags", data_type=wvc.config.DataType.TEXT_ARRAY),
        wvc.config.Property(
            name="title", data_type=wvc.config.DataType.TEXT),
        wvc.config.Property(name="authorized",
                            data_type=wvc.config.DataType.BOOL)
    ],
    vectorizer_config=[
        wvc.config.Configure.NamedVectors.text2vec_openai(
            name="title_vector",
            source_properties=["title"],
        ),
        wvc.config.Configure.NamedVectors.text2vec_openai(
            name="tags_vector",
            source_properties=["tags"],
        ),
    ]
)

collection.data.insert({"tags": [], "authorized": False, },
                       uuid=generate_uuid5("example2"))
# this will fail:
collection.data.update(
    properties={
        "authorized": True,
        #"tags": [] # specifying it null will work
    }, uuid=generate_uuid5("example2"))
#
# ERROR: UnexpectedStatusCodeError: Object was not updated.! Unexpected status code: 500, with response body: {'error': [{'message': 'msg:merge and vectorize code:500 err:panic occurred: interface conversion: interface {} is []interface {}, not []string'}]}.
#
1 Like

Yes! There was a case where I was omitting the text array field from the object!

Will it be OK to pass an empty array instead of a null value?

null or the value you want.

And that’s a problem :thinking:

Now for for every property update you do, you have to pass all TEXT_ARRAY with it’s values.

semitechnologies/weaviate:preview-fix-updating-object-with-empty-list-c604412

this should fix the panic (latest 1.25+a fix)

1 Like