This message was deleted.
# community-help
s
This message was deleted.
j
For your dataset it usually takes about 30 minutes from what I remember…
g
I think something went wrong and it's rolling back
j
Yeah, it looks like the RC build you had chosen to upgrade to has a bug that made the process go into a crash-restart loop. We’re looking into it
The rollback should be done in about 30 minutes
g
The reason I tried to upgrade is because I noted the my embedding field wasn't being filled. No idea why.
j
For new records you mean?
g
Yes, but I don't now when it started to behave like that.
The
embedding
field is computed from the
topics
field which is an array of strings. After looking for a bug in my search functionality, I noted that a document in Typesense didn't have the
embedding
field when I retrived it with the SDK.
I'm waiting for the cluster to be up so I can continue investigating.
It finished to roll back, but it's unhealthy. Edit: it's healthy now. Edit: and unhealthy again. 😅
j
It might be a bit flaky for a few minutes right after an upgrade completes, as DNS propagation happens
👍 1
g
Are you able to access my
posts-v1
collection? There's a document there with ID
z3xMqOyt8d0xdTeEaPyb
that contains the
topics
field, but not the
embedding
.
Cluster:
v601y2x3upjea4tip
j
Need to try a few things which involve restarting your node. Is it ok if there’s sporadic 10 min downtimes?
g
Yes
j
Tried a few things and didn’t work unfortunately… Your cluster is back up, but need to look closer in a few hours
👍 1
It looks like this might have been an issue from early RC builds where if an OpenAI API call fails, we still indexed the document without the embeddings. In builds after end of June, we added a validation to fail the document during import if the auto-embedding generation fails.
So it’s likely that these documents that don’t have embeddings were created in earlier RC builds without this validation
I would recommend either deleting them and adding them back, or add a space at the end of each source field that’s used for embedding generation which will then cause the embedding generation to run
g
I’m on RC53. Upgrading to RC58 failed, but I see there’s the option for RC55 in the list. Is the problem fixed in it?
j
RC53 doesn’t have the missing validation issue. However builds after that have a different bug that’s causing your particular dataset to not load in them. So I’d recommend not upgrading up from rc53 for now. We’re working on the fix.
g
I was having the issue on RC53 🤔
j
Right, but the issue started well before when you were running an older RC build. So those documents were probably just carried over with the missing embeddings from the older RC builds, even as you upgraded
Even once you upgrade to the upcoming RC build, the embeddings will still be missing, unless you do this: https://typesense-community.slack.com/archives/C01P749MET0/p1691035880028789?thread_ts=1691003672.362599&cid=C01P749MET0
Just published the new RC build. Scheduled the upgrade to your cluster
👍 1
g
I thought I updated a document using RC53 and the embedding was still missing, but it's probably because I didn't actually change the source field
j
Yeah there needs to be some change to the field (eg: adding a space / period, etc)
g
It finished to upgrade at 13:41 UTC-3, the dashboard consistently says it's healthy when I refresh and I can search from there, but my requests are still failing (20min later). Is it expected?
j
I do see searches coming into your cluster… Are you still seeing issues?
g
No, it's working now
👍 1
I've reindexed all docs and so far it seems the embedding field is working as expected. 👍
👍 1
@Jason Bosco Caught more docs missing the embedding field since I sent the message above. The cluster is on RC59 all this time.
j
Could you give me the ID of one such document?
g
`gZKGF5rItp8UWLdmKzIg`: had the problem, but I deleted and recreated, so now it's OK `AbHg5oQacJ1Ufw9JjI9v`: still missing the embedding field
j
The document was created on August 1 (based on the
createdAt
timestamp), but the cluster was upgraded to rc59 only on Aug 3. So this is an old document that was created on a prior RC build which didn’t have the error handling for this particular case. See this: https://typesense-community.slack.com/archives/C01P749MET0/p1691079700751459?thread_ts=1691003672.362599&cid=C01P749MET0
Unrelated side note: rc66 is now out which I’d recommend upgrading to
g
Strange because the last thing I did that day was I deleted all docs and reindexed. 🤔
I'll update to RC66, then delete all docs and reindex. Let's see.
j
Could you make sure that the collection is fully empty before you re-index? Best to just delete the whole collection and recreate it
g
I think that's what I did, but I'll make sure this time.
Upgraded to RC66.
Deleted all docs.
Reindexing them...
j
You mean deleted the collection and created it right?
g
No, just deleted the docs.
Do I have to delete the collection?
j
Could you delete the full collection and create it again, just to be sure (that it’s not an issue with older collections)?
g
Yes
Deleted and recreated the collection.
👍 1
@Jason Bosco I'm having another problem. It doesn't seem to be the same thing, but may be related. The embedding is generated from the
topics
array. I have a document with:
Copy code
id: 'WtSy5f9KgdvxGB0i6HGz',
  topics: [
    'Direito Trabalhista',
    'Direito Previdenciário',
    'Benefícios trabalhistas',
    'Auxílio maternidade',
    'Licença maternidade'
  ]
Weirdly, when I make a semantic search with "Auxílio maternidade", it doesn't appear.
How can it be that searching for an exact match in
topics
doesn't include it? I wonder if there's something wrong with the embedding itself.
Here's the definition of the embedding in the schema:
Copy code
"embed": {
        "from": [
          "topics"
        ],
        "model_config": {
          "api_key": "...",
          "model_name": "openai/text-embedding-ada-002"
        }
      },
      "facet": false,
      "index": true,
      "infix": false,
      "locale": "",
      "name": "embedding",
      "num_dim": 1536,
      "optional": false,
      "sort": false,
      "type": "float[]"
    },
Could it be related to the
locale
because the
topics
include diacritics?
Hmm, doesn't seem to be the case. I updated the document to
topics: ['Software development']
just to make it have a topic that's different from all other documents in the collection. I search for "Software development" and it still doesn't appear in the first 50 results. There's no other document with anything even close to that topic.
It's like this particular document it just broken.
j
I’ve seen this happen with different embedding models. Somehow verbatim searches are not considered “close enough” by the model… This is where hybrid search helps. Typesense will do a keyword search and that will put exact matches on top, followed by semantic matches
So you can do something like
query_by: topics,embedding
g
Wait, I deleted the document, recreated and now it appears when I search.
But it's not the same issue as before because before the embedding field was missing. This time, it was there.
This is from my terminal, printed before I deleted I recreated the document, so you can see the embedding field was present.
j
Hmmm
g
This is the document now:
The embedding is indeed not identical.
j
Strange! The embedding values are different
g
Oh, nevermind, the reason the embedding is different is because the
topics
field is different.
😅 1
But you can see the
topics
is the same as how it was before I manually changed it to test.
So here's what I'm sure about: Same topics, same search. Before: didn't appear in the results. Now: appears normally.
If this problem happens again, do you want me to do something specific? Maybe send you the ID and leave it untouched so you can inspect it?
j
Yeah, if you can send me the search query (curl request with all the search params, minus the API key) and the document ID that you expect to be returned but not returned, we can take a closer look
👍 1
g
@Jason Bosco Found some docs (collection
posts-v1
, cluster
v601y2x3upjea4tip
) here missing the embedding field:
DdsfazcfhV2KaZoHZVdk
SY7nMf9i1FIdxXrBmKKt
UQG0x9SS4HXC1Ayk16Wx
JsieTqFhhn6OlC2Ol6bs
Can you take a look?
j
Hmm, will keep you posted
👍 1
k
@Gustavo can you please tell me if the field is missing totally in the document or is it present as an empty array?
g
@Kishore Nallan Missing totally
k
Got it. I'll update you after some investigations.
g
Double checking now, the document with ID
DdsfazcfhV2KaZoHZVdk
isn't missing the
embedding
field anymore. Not sure why.
j
That was me - I tried to check if the issue exists with document updates as well. So when I updated one of the fields in that document (and reverted it back) the embeddings was regenerated
👍 1
@Gustavo Could you try upgrading to
0.25.1.rc4
? The issue was most likely because of this OpenAI issue that we weren't handling in Typesense. We've updated logic to handle blank embeddings and return the error in the import API response.
This won't fix existing documents with missing embeddings though... So for those you would have to delete the docs and re-add them back to generate the embeddings for them
g
No problem, will do it, thanks!
👍 1
@Jason Bosco I just found a document missing the
embedding
field:
f4fr0cpFeTIyrhtoxKf6
(collection
posts-v1
, cluster
v601y2x3upjea4tip
). The embedding was there before the document was updated today.
j
😞 Is it set to
null
or missing, or is it an empty array?
g
Missing
And there's this other document
vkuH7LxZpdrWbSxah6er
, the field is there and seems OK, but when I search for "Pilates" (which is one of the keywords used in the embedding), it doesn't appear in the results. It was also showing up a few moments ago before being updated.
I guess if I delete it and recreate, the embedding will start working again (at least that's what happened last time).
j
Just to be sure it's the same issue, could you try deleting & re-creating or updating the
embed.from
fields in these documents, to see if the embeddings are regenerated fine?
g
Yeah, deleted the document
vkuH7LxZpdrWbSxah6er
, recreated it and now it's searchable. Exact same values in all its fields.
Before:
Copy code
{
  code: 'PDFIS0080',
  createdAt: 1683575032503,
  embedding: [
     -0.005973665975034237,   0.016291815787553787,   0.007027072831988335,
     -0.021735507994890213, -0.0018189257243648171,    0.04381124675273895,
       0.00911425705999136,  -0.006199396215379238,   0.012424963526427746,
      0.002208228223025799,    0.00143207679502666,   0.022049566730856895,
      0.023358145728707314,   0.003556065261363983,  -0.005882065277546644,
     -0.008335652761161327,   0.018948232755064964,  -0.006811156868934631,
    -0.0003819416742771864,  -0.005038031842559576,     0.0243395809084177,
    -0.0006596059538424015,  -0.003408849937841296,    -0.0294430423527956,
     -0.013412941247224808,   0.005394619423896074,   0.015480496920645237,
     -0.040461283177137375,  -0.011718330904841423,  -0.015166438184678555,
       0.03773943707346916,  -0.005551649257540703,   -0.01372699998319149,
      -0.03321175277233124,  -0.015585183165967464,  -0.010377036407589912,
     0.0027905460447072983,  0.0036607515066862106,   0.028500864282250404,
      0.010684552602469921,  0.0013453834690153599,   0.002723481273278594,
      0.002067555906251073,   0.009003028273582458,  -0.015362724661827087,
      0.006376054137945175,    -0.0255042165517807,  -0.013177396729588509,
     -0.018293943256139755,    0.01177721656858921, -0.0020315698347985744,
      0.015637526288628578,  -0.008551567792892456, -0.0003418664273340255,
      0.006232110317796469,  -0.004315041471272707, -0.0007229902548715472,
       0.02750634402036667,   0.017835941165685654,  -0.028212977573275566,
     -0.008100108243525028,   -0.02800360508263111,   -0.02721845731139183,
     -0.006405497435480356,  -0.013897115364670753,   0.008636625483632088,
     -0.006843871437013149,    0.01868651807308197, -0.0035135364159941673,
      0.010841581970453262,   0.013367140665650368,   0.009218943305313587,
      0.007838391698896885, -0.0025533661246299744,   0.043156955391168594,
      -0.01052752323448658,  -0.013792429119348526, -0.0031602198723703623,
       0.01115564163774252,   0.010730353184044361,   0.023318888619542122,
     -0.023711463436484337,  -0.016291815787553787,  -0.021369105204939842,
      0.031196538358926773,  -0.005410976707935333,   0.007707533892244101,
      0.023436661809682846,   0.020976532250642776,   0.004877730738371611,
      0.004154740367084742,   0.011175270192325115,    0.02282162941992283,
      0.022834714502096176,  -0.019026748836040497,    0.02078024484217167,
     -0.008643168956041336,    0.01432894729077816,  -0.022887058556079865,
      -0.01284370943903923,
    ... 1436 more items
  ],
  id: 'vkuH7LxZpdrWbSxah6er',
  image: {
    highRes: {
      base: 'https://firebasestorage.googleapis.com/v0/b/publiko-f9288.appspot.com/o/posts%2FvkuH7LxZpdrWbSxah6er%2F1080x1920-base.jpg?alt=media&token=1zqdQmjb',
      mask: 'https://firebasestorage.googleapis.com/v0/b/publiko-f9288.appspot.com/o/posts%2FvkuH7LxZpdrWbSxah6er%2F1080x1920-mask.png?alt=media&token=phyNz5g0'
    },
    lowRes: {
      base: 'https://firebasestorage.googleapis.com/v0/b/publiko-f9288.appspot.com/o/posts%2FvkuH7LxZpdrWbSxah6er%2F360x640-base.jpg?alt=media&token=HFWI3YJP',
      mask: 'https://firebasestorage.googleapis.com/v0/b/publiko-f9288.appspot.com/o/posts%2FvkuH7LxZpdrWbSxah6er%2F360x640-mask.png?alt=media&token=uTcdq4l3'
    }
  },
  imageAspect: 'portrait',
  imageLogoRegion: {
    height: 0.10572916666666667,
    width: 0.28055555555555556,
    x: 0.3592592592592593,
    y: 0.2296875
  },
  imageText: 'Você sabia que o pilates podem ser um ótimo complemento para outras atividades físicas que você pratica, como corrida ou natação?',
  status: 'available',
  text: 'O Pilates é uma ótima opção para quem pratica atividades físicas como corrida e natação, pois ajuda a melhorar a postura, o equilíbrio e a flexibilidade, além de fortalecer o core e prevenir lesões. 🧘‍♀️\r\n' +
    '\r\n' +
    'Como essas atividades envolvem movimentos repetitivos, o Pilates pode ser utilizado para trabalhar diferentes grupos musculares e aumentar a resistência do corpo, melhorando o desempenho geral. 👩‍🦰\r\n' +
    '\r\n' +
    'Além disso, o Pilates pode ajudar a reduzir o estresse e a ansiedade, proporcionando um equilíbrio mental e emocional para quem pratica.',
  title: 'Pilates',
  topics: [
    'Educação Física',
    'Fisioterapia',
    'Pilates',
    'Condicionamento físico',
    'Complemento para outras atividades físicas'
  ],
  updatedAt: 1683575032503
}
After:
Copy code
{
  code: 'PDFIS0080',
  createdAt: 1683575032503,
  embedding: [
     -0.005973665975034237,   0.016291815787553787,   0.007027072831988335,
     -0.021735507994890213, -0.0018189257243648171,    0.04381124675273895,
       0.00911425705999136,  -0.006199396215379238,   0.012424963526427746,
      0.002208228223025799,    0.00143207679502666,   0.022049566730856895,
      0.023358145728707314,   0.003556065261363983,  -0.005882065277546644,
     -0.008335652761161327,   0.018948232755064964,  -0.006811156868934631,
    -0.0003819416742771864,  -0.005038031842559576,     0.0243395809084177,
    -0.0006596059538424015,  -0.003408849937841296,    -0.0294430423527956,
     -0.013412941247224808,   0.005394619423896074,   0.015480496920645237,
     -0.040461283177137375,  -0.011718330904841423,  -0.015166438184678555,
       0.03773943707346916,  -0.005551649257540703,   -0.01372699998319149,
      -0.03321175277233124,  -0.015585183165967464,  -0.010377036407589912,
     0.0027905460447072983,  0.0036607515066862106,   0.028500864282250404,
      0.010684552602469921,  0.0013453834690153599,   0.002723481273278594,
      0.002067555906251073,   0.009003028273582458,  -0.015362724661827087,
      0.006376054137945175,    -0.0255042165517807,  -0.013177396729588509,
     -0.018293943256139755,    0.01177721656858921, -0.0020315698347985744,
      0.015637526288628578,  -0.008551567792892456, -0.0003418664273340255,
      0.006232110317796469,  -0.004315041471272707, -0.0007229902548715472,
       0.02750634402036667,   0.017835941165685654,  -0.028212977573275566,
     -0.008100108243525028,   -0.02800360508263111,   -0.02721845731139183,
     -0.006405497435480356,  -0.013897115364670753,   0.008636625483632088,
     -0.006843871437013149,    0.01868651807308197, -0.0035135364159941673,
      0.010841581970453262,   0.013367140665650368,   0.009218943305313587,
      0.007838391698896885, -0.0025533661246299744,   0.043156955391168594,
      -0.01052752323448658,  -0.013792429119348526, -0.0031602198723703623,
       0.01115564163774252,   0.010730353184044361,   0.023318888619542122,
     -0.023711463436484337,  -0.016291815787553787,  -0.021369105204939842,
      0.031196538358926773,  -0.005410976707935333,   0.007707533892244101,
      0.023436661809682846,   0.020976532250642776,   0.004877730738371611,
      0.004154740367084742,   0.011175270192325115,    0.02282162941992283,
      0.022834714502096176,  -0.019026748836040497,    0.02078024484217167,
     -0.008643168956041336,    0.01432894729077816,  -0.022887058556079865,
      -0.01284370943903923,
    ... 1436 more items
  ],
  id: 'vkuH7LxZpdrWbSxah6er',
  image: {
    highRes: {
      base: 'https://firebasestorage.googleapis.com/v0/b/publiko-f9288.appspot.com/o/posts%2FvkuH7LxZpdrWbSxah6er%2F1080x1920-base.jpg?alt=media&token=1zqdQmjb',
      mask: 'https://firebasestorage.googleapis.com/v0/b/publiko-f9288.appspot.com/o/posts%2FvkuH7LxZpdrWbSxah6er%2F1080x1920-mask.png?alt=media&token=phyNz5g0'
    },
    lowRes: {
      base: 'https://firebasestorage.googleapis.com/v0/b/publiko-f9288.appspot.com/o/posts%2FvkuH7LxZpdrWbSxah6er%2F360x640-base.jpg?alt=media&token=HFWI3YJP',
      mask: 'https://firebasestorage.googleapis.com/v0/b/publiko-f9288.appspot.com/o/posts%2FvkuH7LxZpdrWbSxah6er%2F360x640-mask.png?alt=media&token=uTcdq4l3'
    }
  },
  imageAspect: 'portrait',
  imageLogoRegion: {
    height: 0.10572916666666667,
    width: 0.28055555555555556,
    x: 0.3592592592592593,
    y: 0.2296875
  },
  imageText: 'Você sabia que o pilates podem ser um ótimo complemento para outras atividades físicas que você pratica, como corrida ou natação?',
  status: 'available',
  text: 'O Pilates é uma ótima opção para quem pratica atividades físicas como corrida e natação, pois ajuda a melhorar a postura, o equilíbrio e a flexibilidade, além de fortalecer o core e prevenir lesões. 🧘‍♀️\r\n' +
    '\r\n' +
    'Como essas atividades envolvem movimentos repetitivos, o Pilates pode ser utilizado para trabalhar diferentes grupos musculares e aumentar a resistência do corpo, melhorando o desempenho geral. 👩‍🦰\r\n' +
    '\r\n' +
    'Além disso, o Pilates pode ajudar a reduzir o estresse e a ansiedade, proporcionando um equilíbrio mental e emocional para quem pratica.',
  title: 'Pilates',
  topics: [
    'Educação Física',
    'Fisioterapia',
    'Pilates',
    'Condicionamento físico',
    'Complemento para outras atividades físicas'
  ],
  updatedAt: 1683575032503
}
They're identical.
j
I see, this 2nd issue seems to be slightly different
g
Yes, doesn't seem like the same issue as the one where the field is completely missing.
Should I open a separate thread?
j
No, this is fine. I'll keep track
Will keep you posted
👍 1
g
We made an adjustment to the document
vkuH7LxZpdrWbSxah6er
in Firestore and it triggered an upsert with the Typesense JS SDK. After that, the post can't be found anymore in the vector search (even though the embedding field is present). So it seems there's something wrong happening on the upsert path somewhere in Typesense.
As expected, deleted/recreated the document and now it's searchable again.
k
I'm able to reproduce the issue with upsert. Will have a fix shortly.
g
Great!
j
@Gustavo Could you upgrade to
0.25.1.rc6
? This should solve the issue with missing embeddings. It happened whenever there's an upsert with no changes to any of the fields in the docs - this would cause the embedding field to be dropped.
Still trying to replicate the 2nd issue with embeddings being present, but not pulling up the document in the search result... Let me know if you still see that issue in this new build.
g
I'm upgrading now. The second issue should also happen after an upsert. Maybe it'll be gone after upgrading, let's see.
🤞 1
j
@Gustavo Have you seen this issue happen again?
g
I'm investigating one case right now 😅
😢 1
But I didn't delete and reindex all docs after the last upgrade, so I'll do it now first and then see if I can reproduce the bug
👍 1
Recreated the collections from scratch, reindexed everything, tried to reproduce the bug with an upsert and it didn't happen. I'll let you know if it happens again.
👍 1
So, we haven't had the bug anymore, I guess it's finally gone.
j
🎉🎉
🎉 1