Can't use OwnCloud on my phone

First of all, I would like to apologize for my poor English.
I don’t know where to place my topic, I think it’s a problem with my server configuration but I’m not sure.

### Actual behaviour

I can’t connect to my OwnCloud server from the application or from chrome. But I can from Opera.

I will be more specific:
I have an owncloud server, I access it with the URL “cloud.rpi.l”
It works perfectly from my computer.
On the other hand, when I go to this address from my chrome phone, I sometimes get to the login page but if I update to try to connect, I get an error “DNS_PROBE_FINISHED_NXSOMAIN” (I don’t think it’s a DNS problem). Then, whatever I do, I fall back on that mistake.
To be able to display the login page again I must reconnect from my wifi and then reconnect to it.
From the application, I enter the server address, it tells me that the server is OK, I enter my connection information but when I validate, it tells me “The server could not be reached”. If I close and reopen the application, when I enter the server address, it tells me directly “The server could not be reached”.
As if my phone is being “banned”

Once, I tried to connect with the Opera browser it works perfectly, I can browse folders, download files…

### Expected behaviour

Connect me.

### Can this problem be reproduced with the official owncloud server?

No.

### Environment data

Android version:

8.0

Device model:

Honor 8

Stock or customized system:

EMUI Stock

ownCloud app version:

ownCloud 2.10.1 (last) / oCloud 2.8.2 (last)

ownCloud server version:

1.10.1.1.1 (last)

### Logs

#### Web server error log

NO ERROR

#### ownCloud log (data/owncloud.log)

{"reqId":"c80b5b01-9df9-46a8-b2ad-6c6a6ea66b3d","level":0,"time":"2019-05-19T18:23:40+00:00","remoteAddr":"192.168.0.36","user":"--","app":"webdav","method":"PROPFIND","url":"\/remote.php\/dav\/files\/\/","message":"Exception: HTTP\/1.1 401 No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotAuthenticated\",\"Message\":\"No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured\",\"Code\":0,\"Trace\":\"#0 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Server.php(288): Sabre\\\\DAV\\\\Server->exec()\\n#5 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#6 \\\/var\\\/www\\\/owncloud\\\/remote.php(165): require_once('\\\/var\\\/www\\\/ownclo...')\\n#7 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php\",\"Line\":168}"}

I have tried to be as clear as possible but do not hesitate to ask me for more details.
Thank you.

Hi,
Reading your description I would suspect that there is some problem connecting to your owncloud.
Can you explain a little more about your network setup? Is it a self-hosted ownCloud behind some router vs a publicly accessible instance?

Perhaps Opera has some kind of VPN option on the phone, which would allow you to connect? But I’m not sure as I don’t use Opera.

Cheers,
Erik

1 Like

Thank you for answering me.

It’s a local self-hosted server behind my router. It is only accessible locally.
Opera integrates a VPN system but I have disabled it.

I assume you have installed your ownCloud server on a RaspberryPi (RPi) inside your network, probably connected via Ethernet, your phone is connected to the WiFi via the same router & WiFi access point (box).

Make sure that your phone is not connected to some Guest-WiFi and double check the IP address of phone and RPi. Ping between the two IP addresses (there are terminal apps for Android phones).

The next step is to test DNS, so try to resolve the hostname (cloud.rpi.l) on the phone, for example by pinging the hostname. Perhaps you have some kind of configurable DNS server in your box (or somewhere else [is your phone using that one?]), which needs to be set up correctly. How do you resolve that hostname on your PC? Hosts file?

Then, are you connecting to your ownCloud via HTTP or HTTPS? Do you have a system like fail2ban installed and configured for your ownCloud? When you get the error, check on the RPi’s apache access logs, are you still hitting the web server? Do you have 2-factor auth enabled? Can you still access the ownCloud via your PC at the same time? Which version of PHP are you using (php --version)? PHP-FPM?

I’ve googled about the webdav error in your ownCloud log, and many people seem to think it’s just part of very verbose logging. Are there any other errors in your owncloud.log?

Sorry for so many questions, hopefully we’ll find what’s going wrong here.

That’s right.

IP address of my raspberry: 192.168.0.2
IP of my PC: 192.168.0.4
IP of my phone: 192.168.0.35

I have a DNS server on the raspberry (192.168.0.2). It is specified in my DHCP. When I access cloud.rpi.l from opera on my phone, I access the login page. On the other hand, if I ping “cloud.rpi.l” I get an error (unknow host)
Besides, I have other DNS inputs that work perfectly on my phone (even with chrome). This makes me think that the error comes from OwnCloud and not from my DNS.

I don’t use HTTPS.
Fail2ban is not installed.
access.log (When I go with Opera):
192.168.0.35 - - [22/May/2019:10:09:02 +0100] “GET /index.php/login HTTP/1.1” 200 2833 “http://cloud.rpi.l/” “Mozilla/5.0 (Linux; Android 8.0.0; FRD-L09 Build/HUAWEIFRD-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Mobile Safari/537.36 OPR/51.2.2461.137690”
192.168.0.35 - - [22/May/2019:10:09:02 +0100] “GET /index.php/core/js/oc.js?v=698f48e2aa3e518d6933cac91093baa6 HTTP/1.1” 200 3196 “-” “Mozilla/5.0 (Linux; Android 8.0.0; FRD-L09 Build/HUAWEIFRD-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Mobile Safari/537.36 OPR/51.2.2461.137690”
192.168.0.35 - - [22/May/2019:10:09:03 +0100] “GET /core/vendor/browser-update/browser-update.js?_=1558516142148 HTTP/1.1” 200 11201 “-” “Mozilla/5.0 (Linux; Android 8.0.0; FRD-L09 Build/HUAWEIFRD-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Mobile Safari/537.36 OPR/51.2.2461.137690”
192.168.0.35 - - [22/May/2019:10:09:03 +0100] “GET /cron.php HTTP/1.1” 200 725 “-” “Mozilla/5.0 (Linux; Android 8.0.0; FRD-L09 Build/HUAWEIFRD-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Mobile Safari/537.36 OPR/51.2.2461.137690”
I do not use two-factor authentication.
Yes, I can still access it from my computer.
I use php 7.0.33
I don’t use PHP-FPM.

No, it’s the only error and it only appears in verbose mode.

No problem, thank you for spending this time trying to help me.

As it seems to work when you access it via Opera, this leads me to believe that the other browsers on your phone are not honoring - pun intended :wink: - your DNS resolver configuration.

You can find out the currently configured DNS resolver on your android phone by running the following command in a terminal on your phone: getprop net.dns1

So this should show your RPi with the IP 192.168.0.2

And perhaps for good measure you should also check secondary and tertiary DNS resolvers with getprop net.dns2 and getprop net.dns3 (perhaps for some reason some apps don’t use the first resolver…)

If these are incorrect you should be able to override them. On my Android 7 phone I can long press the connected WiFi network and then modify it to static IP configuration. I would assume this still works the same on Android 8.

While researching some of these commands on my phone for you, I noticed that some apps keep using Google resolvers (8.8.8.8) no matter the configuration. This would definitely break access to your ownCloud.

So I did some research and there seems to be some very old bug:

Perhaps you need to supply some DNS search domains via your DHCP so that Android starts honoring your local DNS resolver for these local domains. Please let me know what you find.

EDIT: I forgot to mention that there is also the command getprop net.dns.search to display search domains on the android phone.

Excellent pun.

More seriously.
Well, I disabled the DHCP and filled in the information myself (DNS1: 192.168.0.2, DNS2: 1.1.1.1.1)
the results:
DNS1: fd0f:ee:b0::1 (???)
DNS2: 192.168.0.2 (What I asked for)
DNS3: 1.1.1.1.1.1 (What I asked for)

I didn’t know about this bug.
So I tried to create a new DNS entry (www.rpicloud.net). It works on my computer, but it only worked once again followed by the error “DNS_PROBE_FINISHED_NXSOMAIN” when I update.

I don’t really understand when you talk about DNS search domains, or can I add some more?

getprop net.dns.search doesn’t send me anything back.

DNS1 is IPv6, not sure why this is in there first. Your phone might default to IPv6 configuration, and bypass your IPv4 DNS settings completely this way. Perhaps there is somewhere in your box where you can disable IPv6 completely.
DNS2 is fine.
DNS3 I guess should be 1.1.1.1, which would be a public DNS server. Which obviously can’t resolve your made up domain name. Neither cloud.rpi.l nor the new domain rpicloud.net.

While preparing your reply I started reading a little bit more about Search domains and the .local domain.

Perhaps you just have to use a .local domain for your ownCloud, so for example cloud.rpi.local.
Can you give that a go?

on your computer is this somewhere defined in a hosts or something?

otherwise:

The reason for DNS_PROBE_FINISHED_NXDOMAIN is typically due to a misconfiguration or problem with your DNS.

And your phone doesn’t know that address.

As far as I understood it, I thought that @lapourgagner has his own DNS, where the hostname is configured, and a DHCP server, which sets the DNS server for the clients on the network, but Android keeps ignoring it still.

1 Like

my bad I was not reading entirely the thread…

Could be that the DNS is not listening on IPv6 address.

@lapourgagner: In the meantime there are many ideas and rumors, but we’re still no closer to any solution. I think it could be very helpful, if you could post all the relevant config files, anonymized if required.

I thought I had it some time ago but I just turned myself in to the option and now it’s unavailable. IPV6 is enabled by default and cannot be disabled.
EDIT: I just found two options: DNSIPv6 and DHCPv6 which are both disabled.
I also noticed that my raspberry has a local IPv6. Do you think it is possible to enable DNSIPv6 and configure it to my raspberry? But would that solve my problems?

Yes, I added it in case my DNS is down

J’ai essayé mais c’est comme d’habitude : fonctionne une fois mais c’est tout.

Apparently.

Okay, I’ll put as many useful files as I can here: https://1drv.ms/f/s!AvZ2J_--Xorl5ElkqqqE6TD3R64L
EDIT2: If you want other files, don’t hesitate to ask.

To rule out a problem with the ownCloud installation itself can you add the RPi IP address to the trusted domains in the config and try to connect your phone using this IP address?

Thank you for your answer. I’m on vacation, I’m telling you that on Sunday or Monday.
EDIT: I just rethought something: some time ago, I installed 1.1.1.1.1 (the DNS application) on my phone. I’ll try to completely uninstall it when I get home.

I have a android phone and I want to use my owncloud in my phone but I can’t it. I also face some problem to install it.