Sonarr/Sonarr · warning · InvalidOperationException
RemotePath already configured.
Error message
RemotePath already configured.
What it means
ValidateMapping rejects a mapping whose Host + RemotePath pair already exists among the configured mappings. Each host/remote-path combination must be unique because the remap logic selects the first matching pair and duplicates would be ambiguous. This is an InvalidOperationException, not a usage error.
Source
Thrown at src/NzbDrone.Core/RemotePathMappings/RemotePathMappingService.cs:124
if (remotePath.IsEmpty)
{
throw new ArgumentException("Invalid RemotePath. RemotePath cannot be empty.");
}
if (localPath.IsEmpty || !localPath.IsRooted)
{
throw new ArgumentException("Invalid LocalPath. LocalPath cannot be empty and must not be the root.");
}
if (!_diskProvider.FolderExists(localPath.FullPath))
{
throw new DirectoryNotFoundException("Can't add mount point directory that doesn't exist.");
}
if (existing.Exists(r => r.Host == mapping.Host && r.RemotePath == mapping.RemotePath))
{
throw new InvalidOperationException("RemotePath already configured.");
}
}
public OsPath RemapRemoteToLocal(string host, OsPath remotePath)
{
if (remotePath.IsEmpty)
{
return remotePath;
}
var mappings = All();
if (mappings.Empty())
{
return remotePath;
}
_logger.Trace("Evaluating remote path remote mappings for match to host [{0}] and remote path [{1}]", host, remotePath.FullPath);View on GitHub (pinned to da2284d7ea)
Solutions
- Delete or edit the existing mapping with the same Host/RemotePath before adding a new one.
- If you intended a different mapping, change either the Host or the RemotePath so the pair is unique.
- List current mappings (GET /api/v3/remotepathmapping) to identify the conflicting entry.
Defensive patterns
Strategy: try-catch
Validate before calling
var existing = _service.All();
if (existing.Any(r => r.Host.Equals(mapping.Host, StringComparison.OrdinalIgnoreCase) && r.RemotePath == mapping.RemotePath))
return Conflict("A mapping for this host and remote path already exists."); Try / catch
try { _service.Add(mapping); }
catch (InvalidOperationException ex) when (ex.Message == "RemotePath already configured.")
{ return Conflict(ex.Message); } Prevention
- List existing mappings before adding to avoid duplicates.
- Delete or update the conflicting mapping rather than re-adding.
When it happens
Trigger: Calling Add with a Host and RemotePath that match an existing mapping; or Update where the new Host/RemotePath collides with a different existing mapping (Update excludes the current Id from the check).
Common situations: Re-adding a mapping that was thought to be deleted but still cached; or editing a mapping to values that duplicate another.
Related errors
- Invalid Host
- Remote Path must not start with a space
- Invalid RemotePath. RemotePath cannot be empty.
- Invalid LocalPath. LocalPath cannot be empty and must not be
- Recent directory already exists.
AI-assisted analysis of Sonarr/Sonarr@da2284d7ea (2026-08-13).
Data as JSON: /api/errors/9596ee0831e6d09a.
Report an issue: GitHub.