* Fixed: RemotePathMappingCheck deals with case where path invalid
The `Ensure` built into `FileExists` and `FolderExists` was throwing
an exception previously.
* Fixed: RemotePathMappingCheck doesn't fail if client unavailable
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Remote download client {client.Definition.Name} places downloads in {folder.FullPath} but this is not a valid {_osInfo.Name} path. Review your remote path mappings and download client settings.","#bad-remote-path-mapping");
}
elseif(OsInfo.IsDocker)
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"You are using docker; download client {client.Definition.Name} places downloads in {folder.FullPath} but this is not a valid {_osInfo.Name} path. Review your remote path mappings and download client settings.","#docker-bad-remote-path-mapping");
}
else
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Local download client {client.Definition.Name} places downloads in {folder.FullPath} but this is not a valid {_osInfo.Name} path. Review your download client settings.","#bad-download-client-settings");
}
}
if(!_diskProvider.FolderExists(folder.FullPath))
if(!_diskProvider.FolderExists(folder.FullPath))
{
{
if(OsInfo.IsDocker)
if(OsInfo.IsDocker)
{
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"You are using docker; download client {client.Definition.Name} places downloads in {folder.FullPath} but this directory does not appear to exist inside the container. Review your remote path mappings and container volume settings.","#docker-bad-remote-path-mapping");
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"You are using docker; download client {client.Definition.Name} places downloads in {folder.FullPath} but this directory does not appear to exist inside the container. Review your remote path mappings and container volume settings.","#docker-bad-remote-path-mapping");
}
}
elseif(!client.GetStatus().IsLocalhost)
elseif(!status.IsLocalhost)
{
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Remote download client {client.Definition.Name} places downloads in {folder.FullPath} but this directory does not appear to exist. Likely missing or incorrect remote path mapping.","#bad-remote-path-mapping");
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Remote download client {client.Definition.Name} places downloads in {folder.FullPath} but this directory does not appear to exist. Likely missing or incorrect remote path mapping.","#bad-remote-path-mapping");
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Lidarr failed to import a track. Check your logs for details.");
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Lidarr failed to import a track. Check your logs for details.");
}
}
if(!dlpath.IsPathValid())
{
if(!status.IsLocalhost)
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Remote download client {client.Definition.Name} reported files in {dlpath} but this is not a valid {_osInfo.Name} path. Review your remote path mappings and download client settings.","#bad-remote-path-mapping");
}
elseif(OsInfo.IsDocker)
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"You are using docker; download client {client.Definition.Name} reported files in {dlpath} but this is not a valid {_osInfo.Name} path. Review your remote path mappings and download client settings.","#docker-bad-remote-path-mapping");
}
else
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Local download client {client.Definition.Name} reported files in {dlpath} but this is not a valid {_osInfo.Name} path. Review your download client settings.","#bad-download-client-settings");
}
}
if(_diskProvider.FolderExists(dlpath))
if(_diskProvider.FolderExists(dlpath))
{
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Lidarr can see but not access download directory {dlpath}. Likely permissions error.","#permissions-error");
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Lidarr can see but not access download directory {dlpath}. Likely permissions error.","#permissions-error");
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"You are using docker; download client {client.Definition.Name} reported files in {dlpath} but this directory does not appear to exist inside the container. Review your remote path mappings and container volume settings.","#docker-bad-remote-path-mapping");
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"You are using docker; download client {client.Definition.Name} reported files in {dlpath} but this directory does not appear to exist inside the container. Review your remote path mappings and container volume settings.","#docker-bad-remote-path-mapping");
}
}
elseif(!client.GetStatus().IsLocalhost)
elseif(!status.IsLocalhost)
{
{
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Remote download client {client.Definition.Name} reported files in {dlpath} but this directory does not appear to exist. Likely missing remote path mapping.","#bad-remote-path-mapping");
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Remote download client {client.Definition.Name} reported files in {dlpath} but this directory does not appear to exist. Likely missing remote path mapping.","#bad-remote-path-mapping");
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Download client {client.Definition.Name} reported files in {dlpath} but Lidarr cannot see this directory. You may need to adjust the folder's permissions.","#permissions-error");
returnnewHealthCheck(GetType(),HealthCheckResult.Error,$"Download client {client.Definition.Name} reported files in {dlpath} but Lidarr cannot see this directory. You may need to adjust the folder's permissions.","#permissions-error");
}
}
}
}
catch(DownloadClientUnavailableExceptionex)
{
_logger.Debug(ex,"Unable to communicate with {0}",client.Definition.Name);
}
catch(Exceptionex)
{
_logger.Error(ex,"Unknown error occured in RemotePathMapping HealthCheck");