What happens:
- the bulk user import fails because an
InvalidSalesforceID exception is raised;
- the
ensure block deletes the uploaded file from the bucket;
- Sidekiq (not ActiveJob!) retries the failed job anyway, because Sidekiq doesn't respect or acknowledge the
discard_on instruction; that's an ActiveJob thing, too lowly for Sidekiq to bother with;
- the job fails because the file is not there;
- a baffling error appears in Rollbar.
Possible fix: instruct Sidekiq to not retry at all, by configuring sidekiq_options, and rely on ActiveJob's approach.