Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

ProGet 2023 Data Migration Failed



  • My upgrade failed to migrate the data. Would like to rollback to 2022 as the error suggests. Any guidance?

    8be0ea11-800a-4bbc-b60d-783d00fc0a48-image.png


  • inedo-engineer

    Hi @MF-60085,

    You can attempt to run the migration again (it won't hurt any existing data for rollback), it may resolve the issue. What version of ProGet did you upgrade to?

    Also, it may be helpful to email us the migration log to review in more detail. You can send it to support@inedo.com,use the subject [QA-1121] Migration Log, and let us know you sent it so we can keep an eye out.

    Thanks,
    Rich



  • @rhessinger

    I updated to Version 2023.0 (Build 73)

    I retried the migration and it failed. I have an npm repo that migrated fine, and also a powershell repo that was fine. Just my nuget repo failed to migrate.

    Error importing data: Microsoft.Data.SqlClient.SqlException (0x80131904): 8672161NuGet_ImportPackageVersion116`The MERGE statement attempted to UPDATE or DELETE the same row more than once. This happens when a target row matches more than one source row. A MERGE statement cannot UPDATE/DELETE the same row of the target table multiple times. Refine the ON clause to ensure a target row matches at most one source row, or use the GROUP BY clause to group the source rows.

    at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__209_0(Task`1 result)

    at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()

    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

    --- End of stack trace from previous location ---

    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)

    --- End of stack trace from previous location ---

    at Inedo.Data.DatabaseContext.DbResult.CreateAsync(DbCommand command, DatabaseContext context, DateTimeOffset startTime, Stopwatch stopwatch)

    at Inedo.Data.DatabaseContext.ExecuteInternalAsync(String storedProcName, GenericDbParameter[] parameters)

    at Inedo.Data.SqlServerDatabaseContext.ExecuteInternalAsync(String storedProcName, GenericDbParameter[] parameters)

    at Inedo.Data.DatabaseContext.ExecuteNonQueryAsync(String storedProcName, GenericDbParameter[] parameters)

    at Inedo.Data.DatabaseContext.ExecuteScalarAsync[TResult](String storedProcName, GenericDbParameter[] parameters, Int32 outParameterIndex)

    at Inedo.ProGet.Feeds.NuGet.NuGetFeed.<>c__DisplayClass111_0.<<Inedo-ProGet-Feeds-ILegacyImportableFeed-ImportLegacyPackageDataAsync>b__6>d.MoveNext()

    --- End of stack trace from previous location ---

    at Inedo.ProGet.Feeds.StandardPackageFeed3.<>c__DisplayClass47_01.<<ImportLegacyPackageDataAsync>g__importRow|1>d.MoveNext()

    --- End of stack trace from previous location ---

    at Inedo.ProGet.Feeds.StandardPackageFeed3.ImportLegacyPackageDataAsync[TOldRow](ImportLegacyPackageDataContext context, IEnumerable1 oldRows, Func`2 importAsync, CancellationToken cancellationToken)

    at Inedo.ProGet.Feeds.NuGet.NuGetFeed.Inedo.ProGet.Feeds.ILegacyImportableFeed.ImportLegacyPackageDataAsync(ImportLegacyPackageDataContext context, CancellationToken cancellationToken)

    at Inedo.ProGet.Executions.MigrateFeedsForProGet23Execution.ExecuteAsync(IManualExecutionContext context)

    ClientConnectionId:6772c9e6-4da4-44fd-ba0e-d54dc7cb5d86

    Error Number:50000,State:42,Class:16



  • I have sent the mail with the log.


  • inedo-engineer

    Hi @MF-60085,

    Can you please try upgrading to ProGet v2023.5? We have fixed multiple migration issues since ProGet 2023.0, including the MERGE statement error when handling NuGet packages.

    Thanks,
    Rich



  • I'll go do it now



  • I upgraded, which went fine. I still had the message about migration fail. I retried the migration and all it said about my feed was:

    Debug: Skipping feed pangaea...
    Error: Feed pangaea must be migrated later.



  • @MF-60085 sent mail to support@inedo.com with the migration log for this post upgrade retry.


  • inedo-engineer

    Hi @MF-60085,

    It looks like there is a bug in the migration process when you select a specific feed. If you re-run it with no feeds selected, it will rerun it for all feeds that need to be migrated and that message should go away. We will fix the per-feed retry migration in ProGet 2023.6 which is due out this Friday.

    Thanks,
    Rich



  • Thanks. I did try the migrate again with no feed selected but with some errors still. I will try the upgrade for the release today.



  • I tried the upgrade and then the data migration. Getting farther it seems, though, Here is my error:

    Importing pkg:nuget/Hercules@1.0.100...Error reading package: 2627141NuGet_ImportPackageVersion116Violation of PRIMARY KEY constraint 'PK__NuGetPackageSymbols23'. Cannot insert duplicate key in object 'dbo.NuGetPackageSymbols23'. The duplicate key value is (1, 93294, 0x9c18e8644915d54881411a10e614137f, Hercules.Common.Constants.pdb, 1, Hercules).Retrying...Reading package #54390...Importing pkg:nuget/Hercules@1.0.100...Error reading package: 2627141NuGet_ImportPackageVersion116Violation of PRIMARY KEY constraint 'PK__NuGetPackageSymbols23'. Cannot insert duplicate key in object 'dbo.NuGetPackageSymbols23'. The duplicate key value is (1, 93295, 0x9c18e8644915d54881411a10e614137f, Hercules.Common.Constants.pdb, 1, Hercules).Retrying...Reading package #54390...Importing pkg:nuget/Hercules@1.0.100...Error reading package: 2627141NuGet_ImportPackageVersion116Violation of PRIMARY KEY constraint 'PK__NuGetPackageSymbols23'. Cannot insert duplicate key in object 'dbo.NuGetPackageSymbols23'. The duplicate key value is (1, 93296, 0x9c18e8644915d54881411a10e614137f, Hercules.Common.Constants.pdb, 1, Hercules).Error importing data: Microsoft.Data.SqlClient.SqlException (0x80131904): 2627141NuGet_ImportPackageVersion116Violation of PRIMARY KEY constraint 'PK__NuGetPackageSymbols23'. Cannot insert duplicate key in object 'dbo.NuGetPackageSymbols23'. The duplicate key value is (1, 93296, 0x9c18e8644915d54881411a10e614137f, Hercules.Common.Constants.pdb, 1, Hercules).

    at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__209_0(Task`1 result)

    at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()

    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

    --- End of stack trace from previous location ---

    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)

    --- End of stack trace from previous location ---

    at Inedo.Data.DatabaseContext.DbResult.CreateAsync(DbCommand command, DatabaseContext context, DateTimeOffset startTime, Stopwatch stopwatch)

    at Inedo.Data.DatabaseContext.ExecuteInternalAsync(String storedProcName, GenericDbParameter[] parameters)

    at Inedo.Data.SqlServerDatabaseContext.ExecuteInternalAsync(String storedProcName, GenericDbParameter[] parameters)

    at Inedo.Data.DatabaseContext.ExecuteNonQueryAsync(String storedProcName, GenericDbParameter[] parameters)

    at Inedo.Data.DatabaseContext.ExecuteScalarAsync[TResult](String storedProcName, GenericDbParameter[] parameters, Int32 outParameterIndex)

    at Inedo.ProGet.Feeds.NuGet.NuGetFeed.<>c__DisplayClass105_0.<<Inedo-ProGet-Feeds-ILegacyImportableFeed-ImportLegacyPackageDataAsync>b__6>d.MoveNext()

    --- End of stack trace from previous location ---

    at Inedo.ProGet.Feeds.StandardPackageFeed3.<>c__DisplayClass47_01.<<ImportLegacyPackageDataAsync>g__importRow|1>d.MoveNext()

    --- End of stack trace from previous location ---

    at Inedo.ProGet.Feeds.StandardPackageFeed3.ImportLegacyPackageDataAsync[TOldRow](ImportLegacyPackageDataContext context, IEnumerable1 oldRows, Func`2 importAsync, CancellationToken cancellationToken)

    at Inedo.ProGet.Feeds.NuGet.NuGetFeed.Inedo.ProGet.Feeds.ILegacyImportableFeed.ImportLegacyPackageDataAsync(ImportLegacyPackageDataContext context, CancellationToken cancellationToken)

    at Inedo.ProGet.Executions.MigrateFeedsForProGet23Execution.ExecuteAsync(IManualExecutionContext context)

    ClientConnectionId:f068233c-56cf-4d81-88da-eb29df11a3e9

    Error Number:50000,State:42,Class:14


  • inedo-engineer

    Hi @MF-60085 ,

    This message is pretty strange, and not quite sure how it's possible.

    Are you okay sending us your database? That's going to be easiest.

    It's probably too big to attach, but you can send using a "large file transfer" type service. Or we can email you a secure link on our sharepoint server to upload.

    Cheers,
    Alana



  • I'm fine to send it, but I think I would prefer a secure link. Thanks!


  • inedo-engineer

    Hi @MF-60085 FYI just sent you an email :)

    Let us know when you upload and we'll investigate from there!



  • @atripp It has been uploaded


  • inedo-engineer

    Hi @MF-60085,

    Thanks for the data! We've found that the root cause this time is due to some duplicate rows in the original table, which for some reason was not created with any uniqueness constraints. We'll get this fixed in a prerelease version within a day or two.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation