Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mDNS not working on Ubuntu core amd64 #176

Closed
seb2411 opened this issue Jan 15, 2017 · 14 comments
Closed

mDNS not working on Ubuntu core amd64 #176

seb2411 opened this issue Jan 15, 2017 · 14 comments

Comments

@seb2411
Copy link

seb2411 commented Jan 15, 2017

Hello,

I'm testing Nextcloud Snap on a Mini PC Celeron using this config to generate the img file of Ubuntu Core:
"architecture": "amd64",
"gadget": "pc",
"kernel": "pc-kernel",
Everything seem to work well but I can't access the Nexcloud instance using nexcloud.local . It seem to me that the mdns-publisher work well but the request is sending is not processed at some point.

If I launch mdns-publisher manually I got this:

./mdns-publisher nextcloud
2017/01/15 16:54:55 Publishing nextcloud.local -> [192.168.0.16 fe80::2e0:4cff:fe68:3d16] with 60-second TTL

So I have no idea how to debug at this point and how to fix this problem or if the problem comes from nextcloud-snap or from Ubuntu Core for PC.

Thx.

@kyrofa
Copy link
Member

kyrofa commented Jan 16, 2017

If you launch it manually does it work? Are you on the same network (192.168.0.0-254) as the device?

@seb2411
Copy link
Author

seb2411 commented Jan 16, 2017

Hi @kyrofa . As I put on the first message if I launch manually I have the following message:
2017/01/15 16:54:55 Publishing nextcloud.local -> [192.168.0.16 fe80::2e0:4cff:fe68:3d16] with 60-second TTL
But is not working either. And yes I m in the same network. I can ping the box and both IP are in the same range:
192.168.0.17 for my PC
192.168.0.16 for the Nexcloud PC
The only difference is that my PC is passing by the Wifi and my NextCloud box use the LAN.

@seb2411
Copy link
Author

seb2411 commented Jan 16, 2017

If I connect my PC on the Wired network, same.

@kyrofa
Copy link
Member

kyrofa commented Jan 16, 2017

What operating system is the PC running (i.e. the thing from which you're pinging nextcloud.local)?

@seb2411
Copy link
Author

seb2411 commented Jan 17, 2017

Ubuntu 16.04.1

@seb2411
Copy link
Author

seb2411 commented Jan 17, 2017

Ok so, some updates. I was looking for Avahi (who manage mDNS) on the Ubuntu core but didn't found it. Looking on google I found this page:
http://askubuntu.com/questions/853134/avahi-samba-on-snappy-core-16-04-arm

So I installed snapweb... and entering http://snapweb.local without the port my browser show me... Nextcloud ^^ .

So my theory is that we are missing Avahi so the nexcloud snap declare the mDNS domain but there no daemon to catch it and send it over the network.

@seb2411 seb2411 changed the title mDNS not working on amd64 mDNS not working on Ubuntu core amd64 Jan 17, 2017
@seb2411
Copy link
Author

seb2411 commented Jan 19, 2017

@kyrofa any idea how can I try to debug this problem ?

@kyrofa
Copy link
Member

kyrofa commented Jan 20, 2017

Neither snaps use avahi; avahi is a daemon that broadcasts mDNS for its clients. Both the nextcloud and snapweb snaps directly broadcast mDNS on their own. It's interesting that snapweb.local works and nextcloud.local does not! They use pretty similar (if not identical) code for doing this.

@kyrofa
Copy link
Member

kyrofa commented Jan 20, 2017

Can I see the output of ping nextcloud.local please?

@seb2411
Copy link
Author

seb2411 commented Jan 21, 2017

Hi ! Thank for taking time to respond.

Yes it's what I understand now. The difference I can see between Snapweb and Nextcloud is the lib you are using for publishing the domain on the network.

The one used on mdns-publisher is : github.com/davecheney/mdns
The one used on Snapweb in the avahi.go file is : github.com/presotto/go-mdns-sd
The lib used in snapweb look more advanced. It seem you can specify the port of the domain for example.

I have a second bug I didn't mention before but it can help. I have 2 network interfaces on the box eth1 and eth0. And if I connect the network on eth1 and run the mdns-publisher manually is returning an error telling me there are no IP on eth0. If I connect on eth0 and execute the mdns-publisher manually is returning me the message I post before.

I didn't mention before but when I execute mdns manually and I got the message :
2017/01/15 16:54:55 Publishing nextcloud.local -> [192.168.0.16 fe80::2e0:4cff:fe68:3d16] with 60-second TTL
Is not giving me back to the terminal and is like waiting. So I don't know if it's the normal behaviour or if is waiting something, like to get confirmation of the publication of the domain who never happen.

If I ping nextcloud.local:
ping nexcloud.local ping: unknown host nexcloud.local

if I ping snapweb:
ping snapweb.local PING snapweb.local (192.168.0.16) 56(84) bytes of data. 64 bytes from 192.168.0.16: icmp_seq=1 ttl=64 time=2.45 ms 64 bytes from 192.168.0.16: icmp_seq=2 ttl=64 time=1.86 ms 64 bytes from 192.168.0.16: icmp_seq=3 ttl=64 time=1.51 ms

thx ;-)

@seb2411
Copy link
Author

seb2411 commented Jan 24, 2017

Hi @kyrofa ,

So I did a small tweak in the mdns-publisher.go replacing github.com/davecheney/mdns by the lib used on snapweb : github.com/presotto/go-mdns-sd

And it's working fine. So do you think I can try to send a PR on mdns-publisher ?

@kyrofa
Copy link
Member

kyrofa commented Jan 25, 2017

@seb2411 yes, please do! I'm curious to see the difference.

@seb2411
Copy link
Author

seb2411 commented Jan 25, 2017

I'm not sure why but I found a way to fix the problem on my box. Replacing the hostname in Ubuntu Core (/etc/hostname) by nextcloud instead of localhost.localdomain. And it's working.

So I don't know if it's necessary to do a PR on mdns-publisher.

@kyrofa
Copy link
Member

kyrofa commented Apr 5, 2017

Sounds like this issue is resolved, although I'll poke at that on the mdns-publisher project.

@kyrofa kyrofa closed this as completed Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants