Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SI: FK Violation Error Occurring #26

Closed
1 of 4 tasks
WillStrohl opened this issue Apr 11, 2024 · 0 comments
Closed
1 of 4 tasks

SI: FK Violation Error Occurring #26

WillStrohl opened this issue Apr 11, 2024 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@WillStrohl
Copy link
Contributor

Sponsorship

If this request requires additional support (e.g., such as direct email/phone/meeting/development), I have the following interest in helping to sponsor the effort via GitHub Sponsors:

  • None, please continue to work for me for free :P
  • Absolutely, I get value out of this!
  • Maybe later
  • I'm already a sponsor... Woot!

Describe the bug

When using the migrator, there could be exceptions that occur which cause the tool to fail related to attempts to add a new tag. This occurs when it already exists.

Software Versions

  • DNN: 09.13.01
  • Module: 01.01.00

To Reproduce

Steps to reproduce the behavior:

  1. Put the module on a page and correctly configure it and a HubSpot instance.
  2. Click the Login to Hubspot button to get started.
  3. Click the "Migrate" button to begin the migration process.

Expected behavior

All of the blog posts are imported into DNN, allowing us to proceed to the next step. No errors occur or are reported.

We can see a summary of the number of posts that were found, versus the number of posts that were successfully imported.

Actual behavior

Only a subset of the blogs are imported and a number of errors are logged into the Log4NET log file. The UI makes it look like everything happened as expected, despite there being numerous exceptions, and not all of the posts were imported.

Screenshots

N/A

Error log

2024-04-11 16:12:38.530-04:00 [DWURF0][D:4][T:291][ERROR] UpendoVentures.Modules.HubSpotEasyDnnNewsBlogMigrator.Repository.EasyDNNNewsGenericRepository`1[[UpendoVentures.Modules.HubSpotEasyDnnNewsBlogMigrator.Models.EasyDNNNewsTagsItems, UpendoVentures.Modules.HubSpotEasyDnnNewsBlogMigrator, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null]] - System.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_EasyDNNNewsTagsItems_EasyDNNNewsNewTags". The conflict occurred in database "dnn", table "dbo.EasyDNNNewsNewTags", column 'TagID'.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader(Boolean isInternal, Boolean forDescribeParameterEncryption)
   at System.Data.SqlClient.SqlCommand.InternalEndExecuteNonQuery(IAsyncResult asyncResult, String endMethod, Boolean isInternal)
   at System.Data.SqlClient.SqlCommand.EndExecuteNonQueryInternal(IAsyncResult asyncResult)
   at System.Data.SqlClient.SqlCommand.EndExecuteNonQueryAsync(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Dapper.SqlMapper.<ExecuteImplAsync>d__39.MoveNext() in /_/Dapper/SqlMapper.Async.cs:line 662
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at UpendoVentures.Modules.HubSpotEasyDnnNewsBlogMigrator.Repository.EasyDNNNewsGenericRepository`1.<AddAsync>d__3.MoveNext()
ClientConnectionId:075ee6e1-7f10-4391-81e0-2b5f6fc01c4f
Error Number:547,State:0,Class:16

Additional context

None at this time.

@WillStrohl WillStrohl added the bug Something isn't working label Apr 11, 2024
@WillStrohl WillStrohl changed the title FK Violation Error Occurring SI: FK Violation Error Occurring Apr 11, 2024
@WillStrohl WillStrohl added this to the 01.01.01 milestone Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant