Typesense - Only Works if I re-index


I have installed 0.23.0 with Helm on a K8s Cluster.

Everything seems to be working fine and I can search tasks by name however Label search seems is not getting updated.

For example say that I create a new Task, Task-1 and Label it with a pre-existing label, Lable-1.
If I now search for “Label-1” Task-1 is not listed.
There are no errors in the logs.

If I connect to the API POD and run ./vikunja index it works but I have to do this every time I add a new Task.

I tried partial-reindex as well and that breaks Typesense and the API POD will show this error {"message": "Could not find a field named comments.comment in the schema."}

I am using Typesense 0.26.0.rc67 is not clear from the installation guide if there is any specific version dependency.

Thank you!

Does the search for the updated label work when you add some detail on the task, after updating the label?


Indeed, I added a description and then it indeed popped up in the search by Label!

So it seems that creating a new Task + Label doesn’t trigger indexing or something on these lines.

Should be fixed with 521300613f. Please check with the next unstable build (make a backup first!) in ~45min or the next regular release.

I just tested the image but seems is crashing for me every time I add something with out without labels:

2024-04-07T09:40:15.666677125Z: ERROR   ▶ events/func1 602 Error while handling message 8a8b73fb-339e-4528-90b1-cfded128db80, handler_poisoned=task.created.typesense.task.add, subscriber_poisoned=gochannel.GoChannel, reason_poisoned=panic occurred: "assignment to entry in nil map", stacktrace:
goroutine 1004 [running]:
        /usr/local/go/src/runtime/debug/stack.go:24 +0x64
        /go/pkg/mod/github.com/!three!dots!labs/watermill@v1.3.5/message/router/middleware/recoverer.go:29 +0x50
panic({0x14a7160?, 0x3c2e7d0?})
        /usr/local/go/src/runtime/panic.go:914 +0x218
code.vikunja.io/api/pkg/models.convertTaskToTypesenseTask(0x4000a5ca00, {0x4000381380, 0x4, 0x0?})
        /go/src/code.vikunja.io/api/pkg/models/typesense.go:480 +0x83c
code.vikunja.io/api/pkg/models.getTypesenseTaskForTask(0x4000d9f450, 0x4000a5ca00, 0x0)
        /go/src/code.vikunja.io/api/pkg/models/typesense.go:258 +0xf8
code.vikunja.io/api/pkg/models.(*AddTaskToTypesense).Handle(0xffffffffffffffff?, 0x4025eabce0)
        /go/src/code.vikunja.io/api/pkg/models/listeners.go:532 +0x150
        /go/pkg/mod/github.com/!three!dots!labs/watermill@v1.3.5/message/router.go:334 +0x24
        /go/pkg/mod/github.com/!three!dots!labs/watermill@v1.3.5/message/router/middleware/recoverer.go:33 +0x74
        /go/pkg/mod/github.com/!three!dots!labs/watermill@v1.3.5/message/router/middleware/retry.go:72 +0x1c8
        /go/pkg/mod/github.com/!three!dots!labs/watermill@v1.3.5/message/router/middleware/poison.go:99 +0x90
        /go/pkg/mod/github.com/!three!dots!labs/watermill@v1.3.5/components/metrics/handler.go:58 +0x13c
github.com/ThreeDotsLabs/watermill/message.(*handler).handleMessage(0x40006884e0, 0x4025eabce0, 0x4000798ac8)
        /go/pkg/mod/github.com/!three!dots!labs/watermill@v1.3.5/message/router.go:775 +0x13c
created by github.com/ThreeDotsLabs/watermill/message.(*handler).run in goroutine 137
        /go/pkg/mod/github.com/!three!dots!labs/watermill@v1.3.5/message/router.go:620 +0x26c
, topic_poisoned=task.created,  payload={"task":{"id":44,"title":"HomeSte","description":"","done":false,"done_at":"0001-01-01T00:00:00Z","due_date":"0001-01-01T00:00:00Z","reminders":null,"project_id":1,"repeat_after":0,"repeat_mode":0,"priority":0,"start_date":"0001-01-01T00:00:00Z","end_date":"0001-01-01T00:00:00Z","assignees":[],"labels":[],"hex_color":"","percent_done":0,"identifier":"#19","index":19,"related_tasks":{},"attachments":[],"cover_image_attachment_id":0,"is_favorite":false,"created":"2024-04-07T09:40:11.384061432Z","updated":"2024-04-07T09:40:11.384083892Z","bucket_id":0,"position":0,"reactions":{},"created_by":{"id":1,"name":"Camillo","username":"akadmin","created":"2024-03-28T12:03:14Z","updated":"2024-04-07T09:04:07Z"}},"doer":{"id":1,"name":"Camillo","username":"akadmin","created":"2024-03-28T12:03:14Z","updated":"2024-04-07T09:04:07Z"}}

I’ve just pushed a bunch of fixes for the typesense integration (cb648e5ad8, 3519b8b2fe, a5d02380a3, 77e95642a9) which should fix the problem and make this work correctly with the recent change of views. Please check with the next unstable build (ready in ~45min).

Please do a full reindex with the vikunja index cli command as well, I haven’t tested it otherwise.

Success it works !

Just one thing I noticed, you remove sh/bash and even ls from this container image not sure if is intentional.

Gonna stay on this specific version till the next official build comes out!

Thanks so much !

Actually the type sense fix is working but I am getting a new error now:

2024-04-17T13:10:57.475379703Z: ERROR   ▶ handler/ReadAllWeb 13b pq: missing FROM-clause entry for table "task_positions"

Don’t think is related but just letting you know :slight_smile:

Glad it (kinda) works now!

That is intentional, the container only includes the Vikunja binary. This reduces the attack surface because we don’t need to update the actual OS of the container image in addition to Vikunja itself.

When does this happen? Which steps did you do to trigger the error?

I just re-tested with the latest unstable

Creating new projects fails with:

2024-04-17T23:06:26.78569282Z: ERROR    ▶ handler/CreateWeb 242 status: 400 response: {"message": "Could not parse the filter query: unbalanced `&&` operands."}

But if I refresh the UI is at least crated.

The error I was getting yesterday was when adding a task into a project but now seems is not happening anymore so I guess that issue is gone? :smiley:

This looks like a bug, but I’m not sure if related to the indexing process (Vikunja does not index projects into Typesense at the moment). Is there anything in Typesense’s logs?

I have deleted that install… Do you not see this on your side?
I can create a new namespace in my cluster if you want to just test this on the side if you want :wink:

Let me know if that could help, realistically I will have time probably over the weekend.

What do you mean by this? I can’t see anything you’re doing on your instance.

Sorry if I wasn’t clear.

For me this happened on a new fresh install by just creating a new Project.
So I thought you would see the same if you tried :slight_smile: