gpt4 book ai didi

RavenDB 从 3.5 迁移到 5.0.3 抛出重复键错误

转载 作者:行者123 更新时间:2023-12-03 23:02:38 25 4
gpt4 key购买 nike

我正在将 RavenDB 实例从 3.5(内部版本 #35295)移动到 5.0.3(撰写本文时的最新版本)。我通过设置 > 导入数据 > 从 RavenDB 开始迁移。我只包括文档和索引。旧数据库使用了一段时间的修订版,但不再这样做了。迁移失败的文档不是经过修订的文档。
导入大约65万个文档后,RavenDB抛出错误

An item with the same key has already been added. Key: [Value: Redacted description, GlobalSortOrder: -1, PropertyId: 342, Value: Redacted description, GlobalSortOrder: -1, PropertyId: 342]
System.ArgumentException: An item with the same key has already been added. Key: [Value: Redacted description, GlobalSortOrder: -1, PropertyId: 342, Value: Redacted description, GlobalSortOrder: -1, PropertyId: 342]
at System.Collections.Generic.TreeSet`1.AddIfNotPresent(T item)
at System.Collections.Generic.SortedDictionary`2.Add(TKey key, TValue value)
at Sparrow.Json.CachedProperties.UnlikelyGetProperty(LazyStringValue propName) in C:\Builds\RavenDB-Stable-5.0\50011\src\Sparrow\Json\CachedProperties.cs:line 157
at Sparrow.Json.BlittableJsonDocumentBuilder.ReadInternal[TWriteStrategy]() in C:\Builds\RavenDB-Stable-5.0\50011\src\Sparrow\Json\BlittableJsonDocumentBuilder.cs:line 296
at Sparrow.Json.Parsing.UnmanagedJsonParserHelper.ReadObject(BlittableJsonDocumentBuilder builder, PeepingTomStream peepingTomStream, UnmanagedJsonParser parser, MemoryBuffer buffer) in C:\Builds\RavenDB-Stable-5.0\50011\src\Sparrow\Json\Parsing\UnmanagedJsonParserHelper.cs:line 96
at Raven.Server.Smuggler.Documents.StreamSource.ReadDocuments(INewDocumentActions actions)+MoveNext() in C:\Builds\RavenDB-Stable-5.0\50011\src\Raven.Server\Smuggler\Documents\StreamSource.cs:line 1184
at Raven.Server.Smuggler.Documents.DatabaseSmuggler.ProcessDocuments(SmugglerResult result, BuildVersionType buildType) in C:\Builds\RavenDB-Stable-5.0\50011\src\Raven.Server\Smuggler\Documents\DatabaseSmuggler.cs:line 612
at Raven.Server.Smuggler.Documents.DatabaseSmuggler.ProcessType(DatabaseItemType type, SmugglerResult result, BuildVersionType buildType, Boolean ensureStepsProcessed) in C:\Builds\RavenDB-Stable-5.0\50011\src\Raven.Server\Smuggler\Documents\DatabaseSmuggler.cs:line 190
at Raven.Server.Smuggler.Documents.DatabaseSmuggler.Execute(Boolean ensureStepsProcessed, Boolean isLastFile) in C:\Builds\RavenDB-Stable-5.0\50011\src\Raven.Server\Smuggler\Documents\DatabaseSmuggler.cs:line 95
at Raven.Server.Smuggler.Migration.Migrator_V3.MigrateDatabase(String json, Boolean readLegacyEtag) in C:\Builds\RavenDB-Stable-5.0\50011\src\Raven.Server\Smuggler\Migration\Migrator_V3.cs:line 338
at Raven.Server.Smuggler.Migration.Migrator_V3.Execute() in C:\Builds\RavenDB-Stable-5.0\50011\src\Raven.Server\Smuggler\Migration\Migrator_V3.cs:line 99
at Raven.Server.Smuggler.Migration.Migrator.<>c__DisplayClass15_1.<<StartMigratingSingleDatabase>b__1>d.MoveNext() in C:\Builds\RavenDB-Stable-5.0\50011\src\Raven.Server\Smuggler\Migration\Migrator.cs:line 318
“编辑描述”包含在文档中找到的描述。它没有给我一个 id(即 products-1),它给了我文档的一部分。该文档具有唯一标识符。
经过一番挖掘,我找回了文件,它看起来像这样:
{
... other properties
"Description": "Redacted description",
... other properties
"Localisation": {
"nl" {
... more translated content
"Redacted description": "dutch translation (which is identical to Redacted description"
... more translated content
},
"fr": {
... more translated content
"Redacted description": "french translation"
... more translated content
}
},
... more properties
}
省略的属性与编辑描述不同,它们是日期、金额、百分比、 bool 值、标签等。
有人知道为什么数据库在这个文档上失败吗?
如果我需要提供其他信息,我可以。
抱歉,我无法发布实际文件,但我不想泄露任何公司数据。 :) 在这些电晕时代,我的客户对我来说太珍贵了,GDPR 的罚款对我的钱包来说有点太高了。
更新:
我尝试了选项 2,在创建数据库时从 3.X 数据库导入。现在我收到以下错误:
[18:13:01 INFO] Path of temporary export file: C:\Windows\ServiceProfiles\LocalService\AppData\Local\Temp\export-MF.Studio-20201106_181301.ravendump
[18:13:22 INFO] Failed to initialize the storage it is probably been locked by RavenDB.
Error occurred during migration. Exception: System.ApplicationException: The data export tool have exited with code -532462766.
at Raven.Server.Web.System.AdminDatabasesHandler.<>c__DisplayClass24_1.<<MigrateDatabaseOffline>b__2>d.MoveNext() in C:\Builds\RavenDB-Stable-5.0\50011\src\Raven.Server\Web\System\AdminDatabasesHandler.cs:line 1320. Process pid: 14668, killed: True
System.InvalidOperationException: Error occurred during migration. Exception: System.ApplicationException: The data export tool have exited with code -532462766.
at Raven.Server.Web.System.AdminDatabasesHandler.<>c__DisplayClass24_1.<<MigrateDatabaseOffline>b__2>d.MoveNext() in C:\Builds\RavenDB-Stable-5.0\50011\src\Raven.Server\Web\System\AdminDatabasesHandler.cs:line 1320. Process pid: 14668, killed: True
at Raven.Server.Web.System.AdminDatabasesHandler.<>c__DisplayClass24_1.<<MigrateDatabaseOffline>b__2>d.MoveNext() in C:\Builds\RavenDB-Stable-5.0\50011\src\Raven.Server\Web\System\AdminDatabasesHandler.cs:line 1353
我已经让运行 RavenDB5 服务(本地服务)的用户完全控制生产数据库文件夹(实际上是一个副本,但我也用实际的生产 db 文件夹尝试了它)。
我可以看到初始化在目标位置创建了文件,因此它在那里有足够的权限。

最佳答案

这似乎是一个错误,需要进行调查,如果您可以提供转储文件(您可以将其匿名化),请将其发送至 support@ravendb.net
要解决此问题,您可以尝试使用其他选项迁移数据吗?

  • 您可以像在 3.5 服务器之间设置复制一样设置从 3.5 到 4.x/5.0 的单向复制。

  • 为了允许复制到安全的 4.x/5.0 服务器,您可以修改配置文件并添加以下配置选项:
    Raven/复制/证书路径
    Raven/复制/证书密码(可选)
    证书必须从 4.x/5.0 服务器生成,并包含所需数据库的权限。 (如果您还需要迁移索引,请使用运算符)。
  • create a database from 3.x database or file system data
  • live import data from a running instance
  • 关于RavenDB 从 3.5 迁移到 5.0.3 抛出重复键错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64663779/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com