Mirror_later not doesn't think I have a mirror

I wanted to mirror my active storage files from local to s3. I set up a mirror service, then call mirror_later on each of the blobs.

Unfortunately this fails because mirror_later checks for service.respond_to?(:mirror) which my service doesn’t.

  def mirror_later #:nodoc:
    ActiveStorage::MirrorJob.perform_later(key, checksum: checksum) if service.respond_to?(:mirror)
  end

https://apidock.com/rails/v6.1.3.1/ActiveStorage/Blob/mirror_later

However, if I just manually call

ActiveStorage::MirrorJob.perform_later(blob.key, checksum: blob.checksum)

then everything works just fine

My mirror is set up as follows:

local:
  service: Disk
  root: <%= Rails.root.join("storage") %>

amazon:
  service: S3
  access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
  secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
  region: us-west-1
  bucket: <my bucket>

mirror:
  service: Mirror
  primary: local
  mirrors: [ amazon ]

any ideas what I might be doing to confuse Rails like this?

Did you configured config.active_storage.service = :mirror or has_one(many)_attached ... service: :mirror?

config.active_storage.service = :mirror

is that wrong?

Nope, this is correct. If you still have a problem, you can try to create a minimal repro app and post a link here. So we could help.