HI I am facing Below issue while syncing downloading data from crm server to field service mobile(Xamarin) APP.
UNIQUE constraint failed: incident.incidentid
Below is full sync log
SyncStart:2022-01-06 15:27:07-05:00
License: Valid
Customization NOT MODIFIED
<GetCustomization Tim=406/>
Exception while syncing: incident
<EXCEPTION>2022-01-06T15:28:24.8322882-05:00: SqliteException: Abort due to constraint violation
UNIQUE constraint failed: incident.incidentid
at SQLite3.PrvStep(Data.Sqlite3.SqliteStatement stmt)
at SQLite3.Step(Data.Sqlite3.SqliteStatement stmt)
at Resco.Data.SQLite.SQLiteDatabase.ExecuteSingleNonQuery(String query, Collections.Generic.IEnumerable<Object> parameters)
at Resco.Data.MultiInsertDataRecord.Flush()
at Resco.Data.MultiInsertDataRecord.Add(Data.InsertDataRecord rec)
at Resco.Data.MultiInsertDataRecord.Add(Data.IWritableDataRecord rec)
at SyncEngine.ClientBasedSyncTable(Data.db, Data.Synchronization.TableSyncAnchor anchor, Data.MetaEntity meta, Data.WebService.FetchRequestParams fetchParams, Collections.Generic.IEnumerator<ServerEntity> remoteReader, Collections.Generic.List<Guid> changedRecords, Collections.Generic.List<Guid> downloadedRecords, Boolean forceFullSync)
at SyncEngine.ClientBasedSyncTable(Data.db, Data.Synchronization.TableSyncAnchor anchor, Data.MetaEntity meta, Data.Synchronization.SyncFilter syncFilter, Collections.Generic.List<Guid>& changedActivities, Collections.Generic.List<Guid>& downloadedLists, Boolean forceFullSync)
at SyncEngine.SyncEntities(Data.db, Data.Synchronization.Anchor syncAnchor, Collections.Generic.List<SyncEngine.SyncAnalyzer.ExtendedMetaData> entityList, Data.Synchronization.SyncFilter syncFilter, Int32 progressMax, Collections.Generic.HashSet<String> toDeleteEntities, Collections.Generic.List<Guid>& lists)
at SyncEngine.DoExecute(Data.db)
at SyncEngine.Execute(Data.db, Boolean isHighEndDevice, Data.Synchronization.SyncResult& result)
at SyncEngine.Execute(Data.db, config, Data.Synchronization.SyncResult& result, Func<String[],Int32,Boolean> progress, Data.Synchronization.SyncConflict conflictCallback, Boolean isHighEndDevice, Boolean isRequestedByUser, Func<String> getNetworkDetails, Boolean isRestartSync)
</EXCEPTION>
<Details>
<UploadSync> Entitys=234ms Sent=1 SvrCalls=1 TotalTim=234</UploadSync>
Sleep=1000ms
Upload:NoChangesLeft
<IncSync>
<SyncDeletes <Analyze Tim=141ms NoSvrChanges/> />
<Downloader CacheSize=250MB UsedCache=48MB/>
Recv=40320 TotalTim=75219
</IncSync>
</Details>
<Summary>
<Settings Server='5;Crm2011.13/OnlineFederation2016' Threads='3' MaxExecMultiple='100' NOLOCK='true' Foreground='false' Launch='Manual'/>
<Results Sent='1' Recv='40320' Result='Normal'/>
<Times Total='77234ms' Prepare='406ms' UploadTotal='1594ms'/>
<Exception>2022-01-06T15:28:24.8322882-05:00: SqliteException: Abort due to constraint violation
UNIQUE constraint failed: incident.incidentid
</Exception>
<UploadSync Entitys='234ms' Sent='1' SvrCalls='1' AllChangesUploaded='true' SleepTime='1000ms' UploadTime='234ms' TotalTime='1234ms' />
<DownloadCustomization Status='NotModified' License='Valid' TotalDownloadTime='406ms' />
<IncSync Recv='40320' TotalTime='75219ms'>
<SyncDeletes AnalyzeTime='141ms' NoSvrChanges='true'/>
<SyncDownloader CacheSize='250MB' UsedCache='48MB'/>
</IncSync>
<FatalError>Abort due to constraint violation
UNIQUE constraint failed: incident.incidentid</FatalError>
</Summary>
Please reply if you have faced this same issue and found solution of it.
Hi aakash chaudhari,
According to the error message, there is a sync conflict with the case entity(incidentid is duplicated).
Please refer to this doc to deal with it:
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,818 Super User 2024 Season 2
Martin Dráb 229,147 Most Valuable Professional
nmaenpaa 101,156