"Cannot find user foreman_admin when switching context" or "Cannot find user foreman_api_admin when switching context"

These are two special built-in users. The first (foreman_admin) is used when Foreman itself needs to make changes to its own database, and foreman_api_admin is used for anonymous API access (e.g. OAuth without user mapping).

Recreate them by running foreman-rake db:seed