eizedev / AirConnect-Synology

Updated AirConnect packages for Synology NAS and Synology Router
https://github.com/philippe44/AirConnect
MIT License
315 stars 14 forks source link

Failed to start AirConnect #11

Closed apple521 closed 3 years ago

apple521 commented 3 years ago

AirConnect: [21:31:21] Failed to start AirConnect on ip "192.168.1.126", stopping it... [21:31:33] Failed to start AirConnect on any of the local interfaces, please make sure you have at least one UPnP/Sonos/Chromecast device on your network

DS120J DSM 6.2.3-25426 Update 3

eizedev commented 3 years ago

Hi, for which speakers (name/model) do you want to use AirConnect? Sonos?

391P commented 3 years ago

Hi @eizedev. I have a similar problem. However AirConnect is not receiving network information on my Synology DS918+. I have installed the x64 version without any problems. Unfortunately the service does not start! Failure Message: "The service can not be executed: Failed to get local Ethernet interfaces". I have seen that a user is created during the installation. Are special permissions necessary? My Synology is also available via the Internet (DYNDNS), because I have a few services online. Is there perhaps a problem here?

I would like to include my Sonos system for your package. I have a couple of Sonos One speakers and a soundbar. I would be very grateful for some help. 391P

System: Synology DS918+ DSM: 6.2.3-25426 Update 3 IP Adresse: Fixed (LAN1 & LAN2)

eizedev commented 3 years ago

Hi @391P

The error message Failed to get local Ethernet interfaces is issued if the start script cannot uniquely identify the "correct matching" local network interface.

Background

The processes will only recognize your devices if they are bound to the appropriate local network IP, but this is not trivial as there are various Synology devices and network setups out there.
The start script will check all your local network interfaces for private ip addresses (Ranges: 192.168.* or 10.* or 172.16.* - 172.31.*).

In some environments this detection will not work. If you are using another local network range or more interfaces it could be the problem. I can also implement your ip range in the startup script.

The script uses the following oneliner for detection, you can try to execute this line of code via ssh on your NAS.

/sbin/ifconfig -a | grep 'Ethernet' -A 1 | grep -E 'inet (addr:)?(192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[01])\.)' -B 1 | grep 'Ethernet' | grep -v "lbr0" | grep -v "docker" | cut -d ' ' -f 1

Example on my synology nas:

image

The account does not need special permissions. The user will be created during installation to start the processes as this low privileged user to not run as root for security reasons.
dyndns is no problem, i am also using this.

391P commented 3 years ago

Hello @eizedev. Thank you for your detailed message. Then for sure my IP range will cause the problem. I would be very pleased if you could add my IP data. IPv4: 17.* Subnet-Mask: 255.255.192.0 I am waiting for a new release from you for that. Thank you very much. 391P

eizedev commented 3 years ago

@391P sure, no problem. i will include your local subnet in the next release. Could you please share a "test" ip address of your subnet with me? 17.* does not directly match the subnet with mask 255.255.192.0. (Example: 255.255.192.0 could match to a address range of 17.16.0.1 - 17.16.63.254, so i would add something like 17.16.0.x - 17.16.63.x to the filter) Your local subnet is also not an official private subnet, so I like to keep the range I add as small as possible.

Small side note: It is advisable to limit your local subnet to the official private address spaces, this eliminates future problems:

image Wikipedia private network

391P commented 3 years ago

Hi @eizedev. Sorry, just wanted to be as global as possible. My IP address is 17.0.64.0/18, and this covers the range 17.0.64.0 to 17.0.127.254. The 17.0.127.255 is the broadcast address.

Currently, the network includes different segments, where certain hardware categories are placed. Basically I agree that a private network will cause less problems in the future, but so far it doesn't! Using your script for AirConnect has created a problem for the first time.

Maybe your script can be extended to read the data from the Synology? With DSM 7 it should also be possible to create sub-administrators as users, where individual admin rights can be assigned, without all admin rights must be with a technical user. 391P

eizedev commented 3 years ago

Hi @eizedev. Sorry, just wanted to be as global as possible. My IP address is 17.0.64.0/18, and this covers the range 17.0.64.0 to 17.0.127.254. The 17.0.127.255 is the broadcast address.

Thanks, i will include your range in the next release. I will let you know here again.

I am currently working on an extended version which I want to integrate step by step in the upcoming releases. With this it will be possible to specify some essential settings already during the installation in the GUI of the Package Center. Also a few small bugs will be fixed. Furthermore I want to have a closer look at the part of the airconnect user including the detection of the right interface. Also there will be new packages for DSM7 soon, here some small things have changed so that the DSM6 packages are not compatible anymore.

Actually, I wouldn't need to check the local interface, but there are so many different NAS systems and so many different configurations that I built this in as a security mechanism.

eizedev commented 3 years ago

@391P you local network range should be included in the last release 0.2.43.1-20210115.

@apple521 Could you please share your local subnet details with me? So i can add the ip range to the next release for testing if the problem is also solved for you

391P commented 3 years ago

Good morning @eizedev.

Thank you for your quick feedback and providing a new release. Unfortunately I still get the same error message, so I can't get your package to run on my synology. What can I do? 391P Screenshot01 Screenshot02

eizedev commented 3 years ago

@391P hmm... strange. I will provide you with a test package in the next few days as soon as I get the chance, which should run in any case in your environment. Do you have the possibility via ssh to log on to your NAS and send commands?

391P commented 3 years ago

Hi @eizedev. Thanks for your info. I have the possibility to access my Synology via SSH. Still wanted to give you the log to evaluate, however, there is only the same text for the service as you can see in the screenshot. Unfortunately not more details. 391P

eizedev commented 3 years ago

@391P At the moment that is correct. The start script fails on your NAS directly at startup, because it cannot evaluate the appropriate network interface. As I said, I will build a test package in the next few days where this check is disabled. Then it should start in any case and we can look at more details.

(Übrigens, wenn das nicht hilft, können wir uns außerhalb von Github gerne auch in Deutsch das Ganze mal genauer ansehen ;-) )

eizedev commented 3 years ago

Another bug in the filter for detecting the local network interfaces was found and this was fixed in 0.2.43.1-20210119. @391P has tested the new version and it is working in his environment. So i will close this issue for now.

If you still have problems with this kind of bug, please open a new issue to track the problem there.