I have customer backtraces showing that 'drsuapi' is NULL in dreplsrv_op_pull_source_get_changes_trigger() called from the WERR_DS_DRA_SCHEMA_MISMATCH retry case of dreplsrv_op_pull_source_apply_changes_trigger(), while 'drsuapi' was a valid pointer there. From reading the code I don't understand how this can happen, but it does very often on RODCs.
This bug was referenced in samba master: 83030780285290ecf64b57c1744634379b68ea01
Created attachment 18308 [details] Patch for v4-20-test
Created attachment 18309 [details] Patch for v4-19-test
Reassigning to Jule for inclusion in 4.19 and 4.20.
This bug was referenced in samba v4-19-test: 3b922dd575919fd08c2b98249691ea11cb7ffe56
This bug was referenced in samba v4-20-test: 0d0fbf2bb860f3cbc29c74b4ff8c9b3f65778152
This bug was referenced in samba v4-19-stable (Release samba-4.19.7): 3b922dd575919fd08c2b98249691ea11cb7ffe56
This bug was referenced in samba v4-20-stable (Release samba-4.20.2): 0d0fbf2bb860f3cbc29c74b4ff8c9b3f65778152