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

client for Android doesn't handle IPv6=>v4 fallback correctly #616

Closed
hlinden opened this issue Sep 10, 2014 · 21 comments
Closed

client for Android doesn't handle IPv6=>v4 fallback correctly #616

hlinden opened this issue Sep 10, 2014 · 21 comments

Comments

@hlinden
Copy link

hlinden commented Sep 10, 2014

At the moment, we're having trouble with the IPv6 connectivity to our OC server. Any browser does fallback to v4 almost immediately, as described in RFC 6555. The Owncloud client for Android only tries v6 and then fails.

Here's what happens, when I've taken a picture and it tries the auto upload:
01:51:42.081241 IP6 (hlim 64, next-header TCP (6) payload length: 40) 2001:470:2:2:2:2:2:2.43116 > our.owncloudserver.tld.https: Flags [S], cksum 0xb63c (correct), seq 2151544131, win 14400, options [mss 1440,sackOK,TS val 34809574 ecr 0,nop,wscale 6], length 0
01:51:43.075235 IP6 (hlim 64, next-header TCP (6) payload length: 40) 2001:470:2:2:2:2:2:2.43116 > our.owncloudserver.tld.https: Flags [S], cksum 0xb5d8 (correct), seq 2151544131, win 14400, options [mss 1440,sackOK,TS val 34809674 ecr 0,nop,wscale 6], length 0
01:51:45.072932 IP6 (hlim 64, next-header TCP (6) payload length: 40) 2001:470:2:2:2:2:2:2.43116 > our.owncloudserver.tld.https: Flags [S], cksum 0xb510 (correct), seq 2151544131, win 14400, options [mss 1440,sackOK,TS val 34809874 ecr 0,nop,wscale 6], length 0
01:51:49.085056 IP6 (hlim 64, next-header TCP (6) payload length: 40) 2001:470:2:2:2:2:2:2.43116 > our.owncloudserver.tld.https: Flags [S], cksum 0xb37f (correct), seq 2151544131, win 14400, options [mss 1440,sackOK,TS val 34810275 ecr 0,nop,wscale 6], length 0

(adresses redacted, of course)

...and that's that. The client then marks the upload as failed. Expected behaviour should be to fall back to v4 and try again.

Weirdly enough, it works nicely when used in a dual stack environment with ULA-v6 Adresses and NAT6 towards the internet. I dind't have a chance to inspect the traffic there, could it be that despite a working v6 connection it immediately uses v4?

@davivel
Copy link
Contributor

davivel commented Sep 17, 2014

Hi, @hlinden. AFAIK, nobody tested IPv6 with the app til now.

@hlinden
Copy link
Author

hlinden commented Sep 17, 2014

It works quite nicely with dual-stack servers and clients, it already did back in OC-v5 apart from the problem with fallback and the strange behaviour of using IPv4 immediately when in a network with ULA-v6-Adresses.

@davivel
Copy link
Contributor

davivel commented Sep 17, 2014

I must confess you caught me completely disarmed with this one.

I would appreciate you tell us how do you enter the URL address in the login view of the app: with domain name or with IP? ; both in the dual-stack environment and in the one failing.

@hlinden
Copy link
Author

hlinden commented Sep 17, 2014

Domain name. The url in question is [hidden] - as you can see, v6 connectivity is still not working, because out network engineers are on vacation and their replacement won't touch IPv6 with a long pole.

Situation: Server with dual stack, public v4 and v6 address. A and AAAA records exist. v6 connectivity to the server fails due to a Cisco dropping ACLs.

Client, Android 4.4, is in the following environments:

single stack environment: works
dual stack environment with private IPv4-address and public IPv6-address: fails, due to no fallback from v6
dual stack environment with private IPv4-address and ULA IPv6-address and an announced v6-gateway: works, can't diagnose because I can't capture traffic on that network

EDIT: I just checked again. Strike that, on the second network the NAT IPv6 to the internet was silently dropped a few weeks ago, so it's just a private v4 with NAT to the internet / ULA v6 with no router as we speak.

@davivel
Copy link
Contributor

davivel commented Sep 17, 2014

Thanks about the explanation. I'll have to ask about the priority of this, at this moment I have no idea.

I edited your URL for privacy.

@hlinden
Copy link
Author

hlinden commented Sep 17, 2014

I edited your URL for privacy.

And I was editing the post while you did and overwrote your changes -_- Can do you that again?

@davivel
Copy link
Contributor

davivel commented Sep 17, 2014

Done ;) .

We are available also in IRC at freenode.net , channel #owncloud-android . But probably no more until tomorrow.

@deekayen
Copy link

I noticed my Android app failing to synchronize or do instant uploads while on wifi today. The ownCloud server (https://deekayen.net/owncloud) has both IPv4 and IPv6 addresses.

The error is "Failed to synchronize". Yeah, I know, not very helpful. In the app, I went to Settings, then long-tapped on the account, and did "Change password" which showed a connection test. It said it failed to respond quickly the first two times, then the third said it couldn't connect to the ownCloud server.

ownCloud Android App 1.6.1
Android 4.4.4
ownCloud server 7.0.2

After a few hours of debugging, I think I have to blame it on IPv6. The Internet connection is a Comcast Business line with native IPv6 delegation of a /64 block. I'm able to navigate to the ownCloud site on that network from a Mac using Chrome or use the ownCloud Mac sync client. I used several IPv6 test utilities which all seemed to be happy.

This thread seems to match what I've found, though disabling IPv6 for the whole network to make one phone app work seems like a heavy hammer:
http://forum.owncloud.org/viewtopic.php?f=24&t=23018

@danimo
Copy link
Contributor

danimo commented Mar 21, 2015

@davivel I sent you the credentials to a dual-stack-served owncloud instance. We should fix this.

@AlterDepp
Copy link

I think it's the same problem at me. I have a server which is connected by ipv4 and ipv6, but I'm not sure, if ipv6 is working. My client is from f-droid, version 1.7.2, owncloud server is 8.1.3. I turned off ipv6 on my router and connection was fine. After configuring the owncloud client, I reenabled ipv6 and everything worked fine. Other apps like owncloud news reader, owncloud bookmarks, DAVdroid did not have this problem.
Stefan

@corneverbruggen
Copy link

I can confirm this. Also had to disable IPv6 on my router to make the android app connect to my owncloud server, while the same device can connect to the OC web interface in a browser just fine and the CalDAV-sync/CardDAV-sync also have no problems.

@bebehei
Copy link

bebehei commented Jan 25, 2016

So I had the same issue as #516 but there was no entry showing up in the log on my server. Finally, I found out, it had to do with my setup provided by KabelBW. They use mainly IPv6.

wget with -4 and -6 both work without any flaws. ... But my phone fails!?

Could someone please fix this? (Or at least mark it as a bug? This is clearly not an enhancement.)

@zem
Copy link

zem commented Mar 26, 2016

Hello together, same problem here. The problem is that my phone does not get an IPv6 address at all from the router. So only the Link local v6 is there, but the client is trying to connect even without that v6 address. I would not be surprised if that problem is more android related, however I would like to see a hotfix that does not include to deactivate the IPv6 Stack in all the hotspots of the world.

@haarp
Copy link

haarp commented Apr 23, 2016

This is indeed still a problem. And not easy to discover. If IPv6 is available and the app connects to a domain that has both A and AAAA records, it tries IPv6 and aborts if that fails.

This was referenced Apr 25, 2016
@kdickerson
Copy link

kdickerson commented May 13, 2016

I can confirm this issue.

I have OwnCloud running on a server on my home network (with firewall rules allowing outside connections).

I recently configured my router for IPv6 (so the OwnCloud server gets IPv6 and my wifi devices get IPv6). When my Android devices have IPv6 addresses the Owncloud app can no longer connect to the server. I can't upload files or refresh folder lists.

I just disabled IPv6 and reconnected my phone (server and client now both using IPv4) and everything works again. I re-enabled IPv6 and it stops working.

My OwnCloud server uses dynamic DNS to set its public IPv4 into the A DNS record. I have manually set the AAAA DNS record for now (as my DNS provider doesn't support dynamic IPv6). I can successfully connect to my server and OwnCloud using IPv6 from PCs inside and outside my home network (I don't have any non-Android mobile devices to try).

I can try to gather any further information if desired.

Edit: I got distracted and submitted this before I was finished.

Since the AAAA record is set manually, it is when the actual IPv6 address changes (really seems silly for it to do so considering, but it does) that ownCloud stops working. When the AAAA record is correct then OwnCloud works via IPv6 without issue. It's the fallback to IPv4 when the IPv6 connection fails that is broken (which is what this issue is titled).

@blubbsy
Copy link

blubbsy commented Sep 3, 2016

I ran into the same issue, because my provider changed to ipv6 and the provided solution up there is not suitable to me, because i cant turn off ipv6 on my router.

@davivel davivel added this to the backlog milestone Sep 12, 2016
@zem
Copy link

zem commented Oct 1, 2016

At thy moment I have a special DNS entry for my cloud returning only the ipv4 address as a workaround.

@9662
Copy link

9662 commented Oct 26, 2016

Seeing the same issue here. But the weirdest thing is that it wasn't happening until now. I last used the Android client on my home WiFi on Sunday and it worked fine. The only thing changed since is the ownCloud server having had its kernel upgraded by the automatic patching system and rebooted manually yesterday, but I can't see how that could possibly have an impact.

If in a hurry and unable to switch to data connection or similar, what @zem proposes is an option (you will have to add the new hostname to your X.509 cert though).

@kesavanm
Copy link

Switching from auto config to DHCP Server on Pv6 settings inside Gateway router can let Android ownCloud sync with self certified one.
dhcp-server

@9662
Copy link

9662 commented May 13, 2017

Seeing the same issue here. But the weirdest thing is that it wasn't happening until now. I last used the Android client on my home WiFi on Sunday and it worked fine.

To comment on this, what happened between that Sunday and when I posted the above was that my ISP had an IPv6 meltdown thanks to an internal equipment upgrade, so while the phone did get an IPv6 address and could talk IPv6 with my router, all IPv6 was being dropped at some point latter in my ISP's network.

@michaelstingl
Copy link
Contributor

In version 2.9, the ownCloud Android app switched to a new networking library. I'd assume this issue is gone. In case this happens again, please open a new issue. (too many things changed)

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