What does 403 wrong user means in Sync Gateway logs?


I am discovering Sync Gatway logs (version 2.1) and I found out some cases when Sync Gateway rejects documents.
It looks like this:

2020-07-07T14:44:46.901+03:00 Sync fn rejected: new=map[type:QuestionnaireResult RevisionId:11 ObjectType:22 LastRevisionDate:1.594030398822e+12 _revisions:map[ids:[f61a0592c8037821f26de867a86418a5 b75c9961d75164e7a0b8ead55cbb8019] start:2] _id:b68b70b9-5ae6-40f4-b586-b6d34100e59c isAccepted:false isApprovedByUser:true questionnaireSchema:2a01d300-f953-43fa-8dac-8bc9f546977c _rev:2-f61a0592c8037821f26de867a86418a5 profileType:3 AllowSync:true taskId:2657fd82-742e-44b4-b7af-c86b802b93e6 ] old={“AllowSync”:true,“LastRevisionDate”:1594030398822,“ObjectType”:22,“RevisionId”:11", isAccepted":false,“isApprovedByUser”:false,“profileType”:3,“questionnaireSchema”:“2a01d300-f953-43fa-8dac-8bc9f546977c”,“taskId”:“2657fd82-742e-44b4-b7af-c86b802b93e6”,“type”:“QuestionnaireResult”}** --> 403 wrong user**
2020-07-07T14:44:46.901+03:00 CRUD+: Did not update document “b68b70b9-5ae6-40f4-b586-b6d34100e59c” w/ xattr: 403 wrong user

Is this how requireUser() inside SG function works? Cannot find documentation what this function actually logs.

Can somebody please explain why it happens?
Is this user auth problem ?

Hi @Nikolay_Nikolaev,

Yes, a "403 wrong user" exception is thrown when a requireUser() call in a sync function fails.
The reason why it fails ultimately depends on your sync function to determine what parameter is being passed into the requireUser function.