SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.04k stars 1.23k forks source link

Sabnzbd : port 8080 already in use #878

Closed cdridi closed 10 years ago

cdridi commented 10 years ago

Hello and thanks in advance for your help. I have a DS212J and when I still was on DSM 4.xx I did install Sabnzbd and later on removed it. I then moved to DSM 5 and now trying to install Sabnzbd I get the error message that port 8080 is already in use.

I surfed the forums to try to find a solution but nothing found to date:

Is there a work around ?

By the way my knowledge of Linux is close to zero....

banshee1971 commented 10 years ago

For my case, i was force to reset the Synology (full reset... 2 sec, then 10 sec), and only then, i was able to re-install the Firmware, but trace of Sabnzb was there.... So i install Sabnzb frm Zebulon package, and then un-install it and reboot the NAS. It's only then that i was able to install the SABnzb (the latest version from here). It's working since then...

banshee1971 commented 10 years ago

Ho... i forget to mention : No help from Synology for the crash,... They were to slow to response, but i fix everything. And with the result i got (no lost at all), i will still recommend Synology as a good nas ! Anyway, every other NAS maker have the same issue... it's all build by human, so mistake could happen !

cdridi commented 10 years ago

@X4nder Still no news -----Original message----- From: X4ndor notifications@github.com Sent: Friday 25th April 2014 12:18 To: SynoCommunity/spksrc spksrc@noreply.github.com

@cdridi Any news?

— Reply to this email directly or view it on GitHub. http://cdn.mailscanner.info/1x1spacer.gif

cdridi commented 10 years ago

@X4ndor I finally received a response from Synology:

QUOTE

Seems like the original package was not uninstalled properly. Since we are not able to login SSH and we actually do not fully understand how the 3rd-party software works, it's recommended to follow the instruction below to clear all system partition then try again.

Please note that we do not officially support third party software as Sabnzb, Sick Beard and Couch Potato that may cause system crash. To confirm if it's caused by the applications above, please find a spare HDD with fresh system and see if the issue persists.

Also, installing 3rd party software may violate the warranty policy and we do not provide any type of support for DS with 3rd party software installed.

To perform a hard reset:

  1. Press the “RESET” button and hold it for about 4 seconds. Release the button when the Synology Disk Station emits a beep sound then immediately press the “RESET” button and hold it for about 4 seconds again. The system should emit multiple beeps.
  2. Run Synology Assistant to reinstall DSM onto the diskstation. Note: the data from the volume will NOT be deleted after performing this step.

If the issue still persists in a fresh system, please contact us again. ------------ UNQUOTE

Apparently they are proposing the same as what @banshee1971 tried.

For information I gave up with SabNzbd and I am using NzbGet now. I have to say I am very happy with it.

I think I will now close this post.

Dr-Bean commented 10 years ago

Thanks for the update.

Not very helpful from our point of view though ;) I'm considering to attempt to extract information on the checkport function, because I'm curious as to how it works. @cdridi, would you mind emailing me the ticket# you have? It might be easier if I can base my request off of real-life issue (although there's no guarantee on an outcome). Mail is []. Thanks.

cdridi commented 10 years ago

@Dr-Bean I tried to send you the email several times but it was rejected. The ticket# is 283419 Good luck with it.

Galork commented 10 years ago

Hi,

I have the same problem but I just figured out why it happens.

When I go to firewall settings I can see that transmission, sickbeard custom and nzbget (i have the problem with all those three apps) are in the list of integrated apps instead they are uninstalled (but they used to be installed). It's why synology don't let me install a new one because they are consider as part of standards application.

I don't have any idea how to remove them from this list...

Dr-Bean commented 10 years ago

When this issue was originally logged, we didn't have any firewall rules, those was just recently added in to the packages. So that can't have been the cause.

When packages are uninstalled, we remove the firewall rules of course (example: https://github.com/SynoCommunity/spksrc/blob/develop/spk/sabnzbd/src/installer.sh#L81), but the GUI won't show that without refreshing. So, if you refresh the Synology GUI, are those rules in the firewall settings still there? If so, please open a new ticket, so we can keep things separated.

General: In doing some tests, I did notice something strange: Synology blocks installation of a package if admin_port and a firewall rule are the same, even if the firewall rule isn't activated. I'll open a bugreport with Synology for that, because that's wrong imo.

Galork commented 10 years ago

Rules are still there (and I reboot my synology severall times just to be sure) instead my synocommunity apps are uninstalled! (I had a screenshot).

http://img4.hostingpics.net/pics/460846Example.jpg

I try yesterday differents things, if i install and then uninstalled any apps of synocommunity (apps that is using ports) on my nas I can't reinstall it after that because my Synology is saying that the port is already used (like you say in "General")

I use synocommunity 3rd packages since a long time and it's the first time it happens to me.

Thanks for your answer and your bugreport at Synology.

I expect that it will be fix quickly, I love synocommunity apps :'(

Regards

PS : sorry for bad english, i'm french :D

2014-06-04 10:18 GMT+02:00 Dr-Bean notifications@github.com:

When this issue was originally logged, we didn't have any firewall rules, those was just recently added in to the packages. So that can't have been the cause.

When packages are uninstalled, we remove the firewall rules of course (example: https://github.com/SynoCommunity/spksrc/blob/develop/spk/sabnzbd/src/installer.sh#L81), but the GUI won't show that without refreshing. So, if you refresh the Synology GUI, are those rules in the firewall settings still there? If so, please open a new ticket, so we can keep things separated.

General: In doing some tests, I did notice something strange: Synology blocks installation of a package if admin_port and a firewall rule are the same, even if the firewall rule isn't activated. I'll open a bugreport with Synology for that, because that's wrong imo.

— Reply to this email directly or view it on GitHub https://github.com/SynoCommunity/spksrc/issues/878#issuecomment-45063199 .

Dr-Bean commented 10 years ago

@Galork Your screenshot does not show Transmission or SABnzbd firewall rules, right? Question 1: After you uninstall Transmission and SABnzbd packages, are the firewall rules gone, or not? Please provide a screenshot of those two as well ;) Question 2: Can you provide your DSM version and Synology model please?

For NZBGet and NZBGet-Testing, you might have uncovered another bug...I'll have to test with it, and come back to that.

A possible solution: With Putty, or another terminal application, log in to your Synology as root, and enter the following command: /usr/syno/bin/servicetool --remove-configure-file --package nzbget.sc (replace nzbget with transmission, sabnzbd and nzbget-testing, leave the .sc part in)

Galork commented 10 years ago

No, but on my screenshot you can see sickbeard_custom and nzbget (and if I scroll Transmission is in the list), I have exactly the same problem with those apps than Transmission (I don't use SABnzbd).

Question 1 : no, the firewall rules are still there and if I open firewall settings I can still see Transmission, nzbget or Sickbeard_custom in the list of embedded apps (instead those apps are uninstalled) if I want to create of modify any rules.

Question 2 : DS213 / DS5.0 4482

I will give a try with your solution!

EDIT : as I look at my DSM version a new one just pop up! I will test it.

2014-06-04 12:02 GMT+02:00 Dr-Bean notifications@github.com:

@Galork https://github.com/Galork Your screenshot does not show Transmission or SABnzbd firewall rules, right? Question 1: After you uninstall Transmission and SABnzbd packages, are the firewall rules gone, or not? Please provide a screenshot of those two as well ;) Question 2: Can you provide your DSM version and Synology model please?

For NZBGet and NZBGet-Testing, you might have uncovered another bug...I'll have to test with it, and come back to that.

A possible solution: With Putty, or another terminal application, log in to your Synology as root, and enter the following command: /usr/syno/bin/servicetool --remove-configure-file --package nzbget.sc (replace nzbget with transmission, sabnzbd and nzbget-testing, leave the .sc part in)

— Reply to this email directly or view it on GitHub https://github.com/SynoCommunity/spksrc/issues/878#issuecomment-45072723 .

Galork commented 10 years ago

Problem still continue with DSM4493...

I try your solution but I have this :

/usr/syno/bin/servicetool --remove-configure-file --package nzbget.sc remove configure file fail! (nzbget.sc, No such file or directory)

If you need more informations tell me

Dr-Bean commented 10 years ago

It would be very surprising if 4493 would solve it, considering I entered the bug report this morning ;)

Well, I can't reproduce it...but we can still try and solve it. Create a file on your Synology (somewhere in a shared folder is easiest: /volume1/test), and put the following content in that file: https://raw.githubusercontent.com/SynoCommunity/spksrc/develop/spk/nzbget/src/nzbget.sc Then, via Putty, run /usr/syno/bin/servicetool --install-configure-file --package /volume1/test/nzbget.sc followed by /usr/syno/bin/servicetool --remove-configure-file --package nzbget.sc Let's see if you get an error message with that :)

Dr-Bean commented 10 years ago

And, while you're logged in with Putty, can you do ls -al /usr/local/etc/services.d, and provide the output of that command here?

Galork commented 10 years ago

xx> /usr/syno/bin/servicetool --install-configure-file --package /volume1/Dom/nzbget.sc xx> /usr/syno/bin/servicetool --remove-configure-file --package nzbget.sc remove configure file fail! (nzbget.sc, No such file or directory)

xx> ls -al /usr/local/etc/services.d drwxr-xr-x 2 root root 4096 Jun 4 14:27 . drwxr-xr-x 6 root root 4096 Jun 4 14:27 .. -rw-r--r-- 1 root root 98 Jun 4 14:27 cloudstation_port -rwxr-xr-x 1 root root 107 Jun 4 14:27 nzbget-testing.sc -rwxr-xr-x 1 root root 83 Jun 4 14:27 nzbget.sc -rwxr-xr-x 1 root root 113 Jun 4 14:27 sickbeard-custom.sc -rw-r--r-- 1 root root 400 Jun 4 14:27 synoaudio_port -rwxr-xr-x 1 root root 105 Jun 4 14:27 transmission.sc -rw-r--r-- 1 root root 262 Jun 4 14:27 videostation_port

Woot, why I have uninstalled software in this list!!!!

I think we are in the good way :D

2014-06-04 13:38 GMT+02:00 Dr-Bean notifications@github.com:

And, while you're logged in with Putty, can you do ls -al /usr/local/etc/services.d, and provide the output of that command here?

— Reply to this email directly or view it on GitHub https://github.com/SynoCommunity/spksrc/issues/878#issuecomment-45080132 .

Dr-Bean commented 10 years ago

For some reason, /usr/syno/bin/servicetool --remove-configure-file isn't doing what it's supposed to on your device...I can't replicate that, but maybe it's an issue in the tool or something like that.

The workaround would be to simply remove the sc files you don't want from the /usr/local/etc/services.d directory. Then, when you open the GUI, the removed files should no longer have an entry in the firewall screen, and it should be possible to install the packages again.

Dr-Bean commented 10 years ago

Afterthought: can you check if the behavior is the same with an official Synology package? For instance (checking for a package you don't use): the DNS Server package.

After installation, the directory should contain a synodns.sc file. Uninstall the DNS Server package, and that file should be gone. We use the exact same command as Synology does for adding and removing the firewall rules, so it would be surprising if it were removed. If it also stays behind, and the command line also gives an error that it cannot find the file, you found a bug.

Galork commented 10 years ago

It works, I manually remove .sc files and the problem is gone, if I uninstall and reinstall apps now, it works!!!

Maybe the new DSM correct the problem of files not being removed on service.d, I don't know :/

Thanks a lot for your help, you made my day :)

2014-06-04 14:32 GMT+02:00 Dr-Bean notifications@github.com:

For some reason, /usr/syno/bin/servicetool --remove-configure-file isn't doing what it's supposed to...I can't replicate that, but maybe it's an issue in the tool or something like that.

The workaround would be to simply remove the sc files you don't want from the /usr/local/etc/services.d directory. Then, when you open the GUI, the removed files should no longer have an entry in the firewall screen, and it should be possible to install the packages again.

— Reply to this email directly or view it on GitHub https://github.com/SynoCommunity/spksrc/issues/878#issuecomment-45084348 .

Galork commented 10 years ago

As I said after I remove manually incorrect files the problem is gone! But i don't know why it happens at start...

Maybe last DSM fix my problem.

Ex :

transmission install

drwxr-xr-x 2 root root 4096 Jun 4 14:48 . drwxr-xr-x 6 root root 4096 Jun 4 14:41 .. -rw-r--r-- 1 root root 98 Jun 4 14:27 cloudstation_port -rw-r--r-- 1 root root 400 Jun 4 14:27 synoaudio_port -rwxr-xr-x 1 root root 105 Jun 4 14:48 transmission.sc -rw-r--r-- 1 root root 262 Jun 4 14:27 videostation_port

transmission uninstall

drwxr-xr-x 2 root root 4096 Jun 4 14:50 . drwxr-xr-x 6 root root 4096 Jun 4 14:50 .. -rw-r--r-- 1 root root 98 Jun 4 14:27 cloudstation_port -rw-r--r-- 1 root root 400 Jun 4 14:27 synoaudio_port -rw-r--r-- 1 root root 262 Jun 4 14:27 videostation_port

Now all is alright

Dr-Bean commented 10 years ago

Could be :) It's not mentioned in the release notes, so it's hard to tell. Thanks for your time, and glad it worked out :)

Galork commented 10 years ago

Thanks for YOUR time :D

2014-06-04 14:57 GMT+02:00 Dr-Bean notifications@github.com:

Could be :) It's not mentioned in the release notes, so it's hard to tell. Thanks for your time, and glad it worked out :)

— Reply to this email directly or view it on GitHub https://github.com/SynoCommunity/spksrc/issues/878#issuecomment-45086582 .

X4ndor commented 10 years ago

This new information was just enough to solve the original problem for me. I opened the different files in /usr/local/etc/services.d and found that Zarafa is using port 8080 for ical. Afther I edited the port in Zarafa.sc and stopped the Zarafa and Z-Push services, I could install SABnzbd without problems! The ical site of my Zarafa server was still available on port 8080 as soon as I changed the port in SABnzbd to 9090 and restarted the Zarafa services. I feel that this problem is finally solved. (And I'm glad that I hadn't resorted to reinstalling DSM yet.)

Thanks for all your help everyone!

Dr-Bean commented 10 years ago

Just added that info into the ticket I had opened for it. Thanks @X4ndor.

X4ndor commented 10 years ago

No problem @Dr-Bean. I find it strange that in an earlier effort the uninstall of Zarafa didn't solve the problem. It seems that the .sc files are not updated at all, just created when installed. I tried uninstalling a different package, and the corresponding .sc file was deleted just fine. I checked today what port SABnzbd was using according to /usr/local/etc/services.d/sabnzbd.sc. It was 8080, but I had changed to 9090 in the SABnzbd interface right after install. I fixed that now as well.

A little summary just to let other people with the same problem know what I did: 1) I changed the "ical" port in /usr/local/etc/services.d/Zarafa.sc from 8080 to 8089 2) I changed the "ical" port in /etc/zarafa/ical.cfg from 8080 to 8089 as well, so that ical actually works on 8089. Stop and start web services before this takes effect. 3) Then I installed SABnzbd 4) After installation I changed the port settings in SABnzbd to 9090 (and https, which I'd recommend if your server is accessible from the internet) 5) Finally I changed the port in /usr/local/etc/services.d/sabnzbd.sc from 8080 to 9090.

All I can do now is wait for a new SABnzbd and a new Zarafa update, to see if both install without a problem. Maybe some of the config files are overwritten with the updates, but I have no way to be sure yet.

Dr-Bean commented 10 years ago

@X4ndor Nice writeup :)

By the way, the Zarafa package doesn't remove it's firewall file during uninstall. It should though, and I guess it was simply overlooked in the maze of configuration stuff in that package...

As an fyi, when new packages for SAB or Zarafa are released, the following happens: Both packages overwrite their existing sc files with defaults. If you use the Synology firewall, either manually allow the correct ports through in the firewall settings, or change these two files back again. If you don't use the firewall, you might as well leave the files as-is, or even remove them, because once the packages are installed, you shouldn't have issues with upgrading.

The configuration files and the changed settings (9090 for SAB in settings.conf and 8089 for Zarafa in ical.cfg) will be retained. It won't be too difficult to get things going again with that.