Investigating cause of "Denied replicating to remote server" for task document

I’m looking at logged errors in feedback documents and I’m seeing several with the pattern Denied replicating to remote server.

select *
from couchdb_users_meta
CROSS JOIN LATERAL json_populate_recordset(null::record, (doc->>'log')::json) AS (level text, arguments text)
where 
	arguments like '%Denied replicating%'
;

An example log event is

[
  "Denied replicating to remote server",
  {
    "id": "task~org.couchdb.user:USERNAME~c2dff1c4-9b0d-43ae-901b-df95d815a176-delivery-check~1663045225177",
    "error": "forbidden",
    "name": "forbidden",
    "status": 500
  }
]

I have about 10 events like this for denied replications. All are for task documents. All are for the same CHW user.

Are there recommendations to investigate the root cause of this?

Hi @kenn

The way we validate whether or not a task document is allowed to be uploaded is through the user property:

case 'task':
      return emit(doc.user, value);

link to code

It’s an anomaly, for sure.
Can you please check if there are tasks for this user that are uploaded to the server?
Is the emission id or timestamp similar for all tasks that failed to replicate?