Skip to main content

The documentation here is for an unreleased version of Recyclarr.

Visit the documentation site for the Current Version instead.

Instances

The server syncs Sonarr and Radarr instances from two sources:

  • YAML instances are the instances in your YAML configuration files. Only an edit to the file changes one; the server never writes to your files.
  • API instances are instances you add in the web UI or through the server's HTTP API. The server stores them in its database. See API Instances.

Instance names are unique across both sources, ignoring case, so Movies and movies are the same name. No two instances can share a base URL either. Base URLs that differ only by a trailing slash, the letter case of the scheme or host, or a default port name the same server, so http://sonarr:8989 and http://Sonarr:8989/ clash.

Instance Checks​

The server checks each instance on its own: when it starts, each time it loads your edited YAML files, and on each change to an API instance. A problem with one instance never stops the server or keeps the other instances from syncing.

  • An instance that passes is used by the next sync.
  • An instance that fails and has no earlier working version is left out of syncs. This applies to a new instance, and to every failing instance at startup. It is listed as an instanceLeftOut diagnostic with its errors. Fix it, and the next check adds it back.
  • An instance that worked before and fails after a change keeps syncing with its last working settings. The rejected change is listed as instanceChangeRejected.
  • Each instance is judged alone, even when one edit changes several. If one save fixes one instance and breaks another, the fix applies, and only the broken instance keeps its old settings.
  • When two instances share a name or a base URL, the one that changed is rejected and the other keeps syncing. At startup nothing has changed yet, so both are left out.
  • A YAML file that cannot be read, for example because of a YAML syntax error, has no instances the server can check. Its instances keep their last working settings, and one configFileUnreadable diagnostic names the file. At startup, none of its instances load.

For example, if one instance in your configuration has no api_key, the server still starts and syncs every other instance. The log and the server diagnostics show the problem:

Instance movies is left out of syncs until these errors are fixed: api_key must be set

API Instances​

Manage API instances in the web UI, or with these requests. The API reference describes each one:

  • GET /api/v1/instances lists every instance from both sources, with its source, the result of its instance check, and its last sync.
  • POST /api/v1/instances adds an API instance.
  • PATCH /api/v1/instances/{name} changes an API instance's name, base URL, or API key. To change its service, delete it and add it again.
  • DELETE /api/v1/instances/{name} deletes an API instance.
  • POST /api/v1/instances/test connects to a Sonarr or Radarr instance the way a sync does and returns its version. It takes a service, a base URL, and an API key, so you can test settings before you save them.
  • POST /api/v1/instances/{name}/test tests a saved YAML or API instance the same way. A base URL or API key in the request replaces the saved value for that test only, so you can test a new base URL with the stored key.

Neither test stores anything.

The server checks every instance with the change in place before it stores anything. If the change fails, the server rejects it with the errors and keeps everything as it was. An accepted change applies to syncs right away, without waiting for the next configuration check. The server refuses to change or delete a YAML instance; edit its file instead.

An API instance has only connection settings: a name, a service, a base URL, and an API key. It has no custom formats, quality profiles, or other sync settings yet, so syncing it changes nothing in its Sonarr or Radarr.

The server never returns an API key. A change that leaves out the key keeps the stored one, and a test of a saved instance that leaves out the key uses the stored one. The database stores keys as plain text, as your YAML files do.

API instances need a persistent server

An ephemeral server cannot see API instances. If you add any, run a persistent server and point the CLI at it with server.base_url in cli.yml or the RECYCLARR_SERVER_URL environment variable. Otherwise, recyclarr sync starts an ephemeral server that syncs only your YAML instances.