theopenconversationkit / tock

Tock, the open source conversational AI toolkit.
https://doc.tock.ai
Apache License 2.0
496 stars 131 forks source link

Trouble still present on DialogFlowDAO with documentDB indexes limitation #1420

Closed djowalker closed 1 year ago

djowalker commented 1 year ago

Trouble still present : When tock_document_db_on=true

2022-11-22T14:37:26.777 [main] ERROR ai.tock.shared.Mongos - Generated reduced index too long : applicationId1date1intent1storyDefinitionId1storyCategory1storyType1locale1configurationName1connectorType1actionType1hourOfDay1
2022-11-22T14:37:26.800 [main] ERROR ai.tock.bot.mongo.DialogFlowMongoDAO - Command failed with error 67 (CannotCreateIndex): 'namespace name generated from index name "tock_bot.flow_transition_stats_date.$applicationId1date1intent1storyDefinitionId1storyCategory1storyType1locale1configurationName1connectorType1actionType1hourOfDay1" is too long (127 byte max)' on server mongo2:27018. The full response is {"operationTime": {"$timestamp": {"t": 1669124241, "i": 1}}, "ok": 0.0, "errmsg": "namespace name generated from index name \"tock_bot.flow_transition_stats_date.$applicationId1date1intent1storyDefinitionId1storyCategory1storyType1locale1configurationName1connectorType1actionType1hourOfDay1\" is too long (127 byte max)", "code": 67, "codeName": "CannotCreateIndex", "$clusterTime": {"clusterTime": {"$timestamp": {"t": 1669124241, "i": 1}}, "signature": {"hash": {"$binary": {"base64": "AAAAAAAAAAAAAAAAAAAAAAAAAAA=", "subType": "00"}}, "keyId": 0}}}
com.mongodb.MongoCommandException: Command failed with error 67 (CannotCreateIndex): 'namespace name generated from index name "tock_bot.flow_transition_stats_date.$applicationId1date1intent1storyDefinitionId1storyCategory1storyType1locale1configurationName1connectorType1actionType1hourOfDay1" is too long (127 byte max)' on server mongo2:27018. The full response is {"operationTime": {"$timestamp": {"t": 1669124241, "i": 1}}, "ok": 0.0, "errmsg": "namespace name generated from index name \"tock_bot.flow_transition_stats_date.$applicationId1date1intent1storyDefinitionId1storyCategory1storyType1locale1configurationName1connectorType1actionType1hourOfDay1\" is too long (127 byte max)", "code": 67, "codeName": "CannotCreateIndex", "$clusterTime": {"clusterTime": {"$timestamp": {"t": 1669124241, "i": 1}}, "signature": {"hash": {"$binary": {"base64": "AAAAAAAAAAAAAAAAAAAAAAAAAAA=", "subType": "00"}}, "keyId": 0}}}

on lines :

    at org.litote.kmongo.MongoCollectionsKt.ensureIndex(MongoCollections.kt:680)
    at ai.tock.shared.MongosKt.ensureIndex(Mongos.kt:253)
    at ai.tock.shared.MongosKt.ensureIndex$default(Mongos.kt:248)
    at ai.tock.bot.mongo.DialogFlowMongoDAO.<clinit>(DialogFlowMongoDAO.kt:165)
    at ai.tock.bot.mongo.IocKt$botMongoModule$1$13.invoke(ioc.kt:60)
    at ai.tock.bot.mongo.IocKt$botMongoModule$1$13.invoke(ioc.kt:60)

Originally posted by @djowalker in https://github.com/theopenconversationkit/tock/issues/1406#issuecomment-1323698549

The answer could be to reduce indexe and use isDocumentDb() boolean

vsct-jburet commented 1 year ago

Yes there is a bug in the shared mongo libs - will be fixed in next release