See PHI1295. A couple of user account links here needed to be manually corrected. I think the issue is that they were invited by email address by an instance administrator before being imported.
This leads to a state where:
- The email address has an instances_member row, and that row has no autolinkShadowPHID. This is correct, since we shouldn't autolink based only on an invite. This largely disables the import flow since the user is marked as "Already Invited". The flow assumes that they've been invited by an "Import" action, but "Invited by Instance Administrator + No Account Link" and "Invited by Phacility Staff + Account Link" are actually different states.
- The instance has a user_externalaccount row for the central account, bound to no local instance account. I'm not sure how this write happens, maybe it gets written on an import attempt? This row should not write.
- Further import attempts fail because of a key collision on user_externalaccount.