Skip to main content

Notifications

Dynamics 365 Community / Forums / Field Service forum / Getting Sync Error Wil...
Field Service forum
Suggested answer

Getting Sync Error Wile downloading data from crm server to field service mobile(Xamarin) APP

Posted on by 175

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.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Getting Sync Error Wile downloading data from crm server to field service mobile(Xamarin) APP

    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:

    Configure offline data for the Field Service (Dynamics 365) mobile app (contains video) | Microsoft Docs

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,818 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,147 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans