Sonarr saying port is in use, but it's not?

Hi,

I seem to have issues with Sonarr, as of right now it’s not running as it says port is in use but it’s not. Fresh install of Dietpi on a x64 PC.

root@# netstat -ltnp | grep -w ":8989"
root@# netstat -ltnp | grep -w ":7878"
tcp6       0      0 :::7878                 :::*                    LISTEN      594/Radarr

Thanks

can you share following

ss -tulpn | grep LISTEN

If possible, try to avoid screen prints. You should be able to copy everything from SSH terminal directly.

Hello Joulinar,

root@dietp ss -tulpn | grep LISTEN
tcp   LISTEN 0      128          0.0.0.0:57966      0.0.0.0:*    users:(("transmission-da",pid=4094,fd=15))
tcp   LISTEN 0      128          0.0.0.0:22         0.0.0.0:*    users:(("sshd",pid=526,fd=3))
tcp   LISTEN 0      128          0.0.0.0:9091       0.0.0.0:*    users:(("transmission-da",pid=4094,fd=14))
tcp   LISTEN 0      512                *:7878             *:*    users:(("Radarr",pid=594,fd=218))
tcp   LISTEN 0      128             [::]:57966         [::]:*    users:(("transmission-da",pid=4094,fd=16))
tcp   LISTEN 0      128             [::]:22            [::]:*    users:(("sshd",pid=526,fd=4))

I have notied that it’s always Sonarr that gives me issues in the past it was a chmod issue, now it’s a port issue?

Doesn’t looks like there is anything blocking Sonarr. Would it be possible to restart your system and check following afterwards

systemctl status sonarr
journalctl -u sonarr
root@:~# systemctl status sonarr
● sonarr.service - Sonarr (DietPi)
     Loaded: loaded (/etc/systemd/system/sonarr.service; disabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-07-22 11:19:30 BST; 2s ago
   Main PID: 1653 (mono)
      Tasks: 9 (limit: 9496)
     Memory: 81.3M
        CPU: 2.024s
     CGroup: /system.slice/sonarr.service
             └─1653 /usr/bin/mono /usr/lib/sonarr/bin/Sonarr.exe -nobrowser -data=/mnt/dietpi_userdata/sonarr

Jul 22 11:19:30 Downloader-VM Sonarr[1653]: [Info] Bootstrap: Starting Sonarr - /usr/lib/sonarr/bin/Sonarr.exe - Version 3.0.8.1507
Jul 22 11:19:31 Downloader-VM Sonarr[1653]: [Info] AppFolderInfo: Data directory is being overridden to [/mnt/dietpi_userdata/sonarr]
Jul 22 11:19:31 Downloader-VM Sonarr[1653]: [Info] Router: Application mode: Interactive
Jul 22 11:19:31 Downloader-VM Sonarr[1653]: [Info] MigrationLogger: *** Checking database for required migrations data source=/mnt/dietpi_userdata/sonarr/sonarr.db;cache size=-10000;datetimekind=Utc;journal mode=Wal;pooling=True;version=3 ***
Jul 22 11:19:31 Downloader-VM Sonarr[1653]: [Info] MigrationLogger: *** Checking database for required migrations data source=/mnt/dietpi_userdata/sonarr/logs.db;cache size=-10000;datetimekind=Utc;journal mode=Wal;pooling=True;version=3 ***
Jul 22 11:19:31 Downloader-VM Sonarr[1653]: [Info] OwinHostController: Listening on the following URLs:
Jul 22 11:19:31 Downloader-VM Sonarr[1653]: [Info] OwinHostController:   http://*:7878/
Jul 22 11:19:31 Downloader-VM Sonarr[1653]: [Info] SonarrBootstrapper: Starting Web Server
Jul 22 11:19:32 Downloader-VM Sonarr[1653]: [Fatal] ConsoleApp: Address already in use. This can happen if another instance of Sonarr is already running another application is using the same port (default: 8989) or the user has insufficient permissions
Jul 22 11:19:32 Downloader-VM Sonarr[1653]: Press enter to exit...
root@:~#
root@:~# journalctl -u sonarr

=Wal;pooling=True;version=3 ***
Jul 22 11:20:19  Sonarr[1846]: [Info] MigrationLogger: *** Checking database for required migrations data source=/mnt/dietpi_userdata/sonarr/logs.db;cache size=-10000;datetimekind=Utc;journal mode=Wal;pooling=True;version=3 ***
Jul 22 11:20:19  Sonarr[1846]: [Info] OwinHostController: Listening on the following URLs:
Jul 22 11:20:19  Sonarr[1846]: [Info] OwinHostController:   http://*:7878/
Jul 22 11:20:19  Sonarr[1846]: [Info] SonarrBootstrapper: Starting Web Server
Jul 22 11:20:20  Sonarr[1846]: [Fatal] ConsoleApp: Address already in use. This can happen if another instance of Sonarr is already running another application is using the same port (default: 8989) or the user has insufficient permissions
Jul 22 11:20:20  Sonarr[1846]: Press enter to exit...
Jul 22 11:20:21  systemd[1]: sonarr.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 22 11:20:21  systemd[1]: sonarr.service: Failed with result 'exit-code'.
Jul 22 11:20:21  systemd[1]: sonarr.service: Consumed 2.221s CPU time.
Jul 22 11:20:21  systemd[1]: sonarr.service: Scheduled restart job, restart counter is at 47.
Jul 22 11:20:21  systemd[1]: Stopped Sonarr (DietPi).
Jul 22 11:20:21  systemd[1]: sonarr.service: Consumed 2.221s CPU time.
Jul 22 11:20:21  systemd[1]: Started Sonarr (DietPi).

I got it working in the end,

I looked at the file /mnt/dietpi_userdata/sonarr/config.xml

<Config>
  <LogLevel>info</LogLevel>
  <UrlBase></UrlBase>
  <UpdateMechanism>BuiltIn</UpdateMechanism>
  <AuthenticationMethod>None</AuthenticationMethod>
  <ApiKey>2329d0fc000741f48fc39cb7a6347593</ApiKey>
  <Branch>master</Branch>
  <BindAddress>*</BindAddress>
  <Port>7878</Port>
  <SslPort>9898</SslPort>
  <EnableSsl>False</EnableSsl>
  <LaunchBrowser>True</LaunchBrowser>
  <SslCertPath></SslCertPath>
  <SslCertPassword></SslCertPassword>

Changed the port to 8989
restarted sonarr, and all is good.

Again this was a fresh install, and I never touched this file.

Hmm did you tried to install Sonarr a different way before? Or did you copied the configuration from somewhere? Because we don’t do anything on that configuration file during installation, and yours looks different than expected. Beside the port, your branch is incorrect as well

<Branch>master</Branch>

But it should be

<Branch>main</Branch>

image

A master branch did not exist on the official Sonarr repository.

1 Like

Hello Joulinar,

Nope the same method I do every time, I downloaded the Native PC for UEFI, used etcher (windows)
Did the install, used sudo dietpi-software and picked Sonarr.

The only change I did was I ran this " sudo dietpi-software reinstall 144", thinking it would fix the first issue I had; it never did hence this post.

Should I change my Branch to main, or will I have more issues?

Thanks

I guess, like many other projects, Sonarr changed/renamed the primary branch from master to main. So yes would be good to change it, even that requests to master might be redirected.

1 Like

I was able to change it from Master to Main, but now it says Main? I never changed anything the only thing I did was reset my API key (which restarts Sonarr) I can promise you, I never touched this file

  <LogLevel>info</LogLevel>
  <EnableSsl>False</EnableSsl>
  <Port>8989</Port>
  <SslPort>9898</SslPort>
  <UrlBase></UrlBase>
  <BindAddress>*</BindAddress>
  <ApiKey>ae2810a59dcf479da3ff3692a7e2b771</ApiKey>
  <AuthenticationMethod>None</AuthenticationMethod>
  <UpdateMechanism>BuiltIn</UpdateMechanism>
  <Branch>main</Branch>
  <LaunchBrowser>True</LaunchBrowser>
  <SslCertHash></SslCertHash>

My Sonarr reports:
The latest version of Sonarr is already installed
3.0.8.1507

Apr 24 2022
main Currently Installed

Weird…