azukaar / Cosmos-Server

☁️ The Most Secure and Easy Selfhosted Home Server. Take control of your data and privacy without sacrificing security and stability (Authentication, anti-DDOS, anti-bot)
https://cosmos-cloud.io
Other
2.99k stars 108 forks source link

[BUG]: Prowlarr installation #147

Closed barto95100 closed 3 months ago

barto95100 commented 7 months ago

What happened?

When I test to install I received the error message:

CleanShot 2023-11-27 at 23 07 01@2x

What should have happened?

the other app radarr,sonarr no problem to install

How to reproduce the bug?

  1. install prowlarr with default config

Relevant log output

Creating Service...                              
Starting creation of new service...
Creating volume Prowlarr-config...
Volume Prowlarr-config created
Pulling image lscr.io/linuxserver/prowlarr:latest
latest Pulling from linuxserver/prowlarr 
{"status":"Digest: sha256:5b458ad23f7d97e5fd9bdbcc733c39c5dcab9d435d8f976d883ed49b41b45f63"}
{"status":"Status: Image is up to date for lscr.io/linuxserver/prowlarr:latest"}
Image lscr.io/linuxserver/prowlarr:latest pulled
Checking service Prowlarr...
Forcing secure Prowlarr...
Created secure network cosmos-Prowlarr-AvG
Creating container Prowlarr...
[ERROR] Rolling back changes because of -- Link network creation error: Error response from daemon: No such container: nullRolled back container Prowlarr
Rolled back network cosmos-Prowlarr-AvG
Rolled back volume Prowlarr-config
[OPERATION FAILED]. CHANGES HAVE BEEN ROLLEDBACK.

Other details

No response

System details

I-Need-C8H10N4O2 commented 7 months ago

I can also reproduce this issue. This is because the cosmos-compose file for Prowlarr does not check whether you are actually linking it with other containers.

  "links": [
    "{Context.sonarr-name}", 
    "{Context.radarr-name}", 
    "{Context.lidarr-name}", 
    "{Context.readarr-name}", 
    "{Context.downloader-name}"
  ]

Therefore, if you have not assigned all of those values, one of them will be null and cause the issue. Note that the file causing this issue is available in the other repository here.

For other compose files where there is a link, there is a check like:

{if Context.sonarr}
"{Context.sonarr-name}"
{/if}

Unfortunately, since this container links to up to 4 service, implementing such check is not very easy due to the limitations of the templating engine used (Whiskers.js) since as far as I can see, it does not support logical operations like || or && so you will always have issues with commas in the JSON in some cases. Otherwise, it could be easily fixed.

One workaround is to make sure Prowlarr is linked to 5 containers (Sonarr, Radarr, Lidarr, Readarr, and a downloader), or simply modify the cosmos-compose.json file for Prowlarr to only include the containers you actually need to link.

@azukaar Any thoughts on this? Perhaps a potential change in the templating engine to allow for more flexibility?

azukaar commented 7 months ago

Cosmos is supposed to ignore null values there, but either way this will be fixed in 0.14, I must have forgotten an edge case

barto95100 commented 7 months ago

Ok no problem I install prowlarr manually with custom servAPP

When will version 0.14 be available?

azukaar commented 7 months ago

prob end of Jan

azukaar commented 3 months ago

Fixed in 0.14