FailedPrecondition: 400 Vertex AI Service Agent does not have permission to access Artifact Registry

In Google Console go to IAM (Identity and Access Management) / Roles. Create a new role with Artifact Registry permissions (writer, editor). After that, in IAM, attach this new role to the service account service 43726 …@…gserviceaccount.com being used by Vertex AI. That will solve the porblem.