Android Client - Unable to upload with wifi.. but 4g works?

Hello

For future readers: If you use cloudflare, disable browser integrity check in the firewall settings, as described in the solution down below.

I am running on a self-hosted Nextcloud 16.0.4 installation behind a reverse proxy.
I am able to access, upload, use and utilise the server to its full potential, except for when android clients try to sync with WiFi.
The issue I have is not very obvious, because the client says: Connection error.
great!

What is a connection error? Where are the logs I can check to dig further?

So reinstalling the app, I notice that the android client wants to sync new files I add, but after a while (15 minutes later) it stops working. New files fail to upload. Same problem on my work WiFi or on my friends WiFi’s. Just it being a WiFi, the Nextcloud app just blatantly fails.

My girlfriend has the same issue on her Nextcloud app. We both are running version 3.8.0. I also tried running the beta version. Issue started happening about 3 weeks ago, while host was not touched at all.

I have tried checking the logs live on my server, while trying to upload while it fails, and there is no output in the logs indicating any activity server side.

How do I proceed? Why does 4g work, and WiFi not?
Send heelph :exploding_head:

denNorske

So, your nextcloud server is open to the internet, but you can’t access it from its own WiFi with Android devices. Have you tried to open the server URL in your web browser while in local WiFi? Can you not access the web interface then either? If so, then your router might be filtering local redirects for security purposes


Edit: this thread might help you, too

Hi there @Gee858eeG - appreciate you took your time to reply!
Unfortunately, it is not only my router

Same problem on my work WiFi or on my friends WiFi’s. Just it being a WiFi, the Nextcloud app just blatantly fails.

So on any WiFi, my gf and I are having issues to sync the android client to the server. For context, my gf lives in a different country… :dancer:
Do you by any chance know if the android app leaves any useful logs to view ?

What a pity. Sorry, I couldn’t find any logs on my android phone for nextcloud. Don’t know if there are any and where they are located.

Check the link above in my previous comment. One user had a similar issue. The root of the problem was the “trusted domains” parameter in his config. It wasn’t set properly

As far as logs from the client the only way I’ve ever seen any is with the nextcloud dev version in f-droid. There is a Logs button in the Settings menu. I haven’t found them helpful yet but maybe it can help you.

1 Like

Thank you!
I have downloaded the dev version and found the logs now. I will try to proceed with the new app and see if I can reproduce the same issue and get more information. Thank you @Boballen55! :blush: I will update this thread once I get more info on what it could be

@Gee858eeG I tried altering the proxy settings and so, but there’s nothing wrong I could see. I would assume misconfiguration there would affect any connection, but I at least looked into it :slight_smile: thank you anyway!

@denNorske I actually meant the nextcloud config option… The file location is at nextcloud/config/config.php However it might as well not be the problem

  'trusted_domains' =>
  array (
    0 => '192.168.0.29',
    1 => 'cloud.example.com',
  ),

as stupid as it sounds, check if your device-settings allow wifi-access for the nextcloud-client.
if you haven’t already, try to open your nextcloud-installation in a webbrowser (on your phone) while you’re on wifi.

to see the log of your phone, enable developer options (i think you have to tap the build-number seven times) and if you have adb installed on a computer you can connect your phone with usb and use adb logcat to get the log (which should tell you something).
GOOD LUCK!

Thanks again! I checked that part of the configuration and it is correct according to my documentation. What I meant about the proxy, was that if the trusted domains were wrong, 4g should also have been affected, since all connections go through a reverse proxy through another ip/address.

@pete.dawgg thanks for the tip! I finally got the logs from the dev client, and it appears to be ssl related. Not sure what though. Here is a link: https://gist.github.com/simeneriks1/c4714c96dd3bdf28cf0f30d03fa2237d

Here is an error I see:

2019-09-19T12:47:24.149+0200;V;UploadsStorageManager;Updating /storage/emulated/0/Download/Billett (2).pdf with status:UPLOAD_FAILED and result:NETWORK_CONNECTION (old:/storage/emulated/0/Download/Billett (2).pdf status:UPLOAD_IN_PROGRESS result:-1)
2019-09-19T12:47:24.149+0200;V;UploadsStorageManager;Updating /storage/emulated/0/Download/Billett (2).pdf with status=UPLOAD_FAILED
2019-09-19T12:47:24.151+0200;D;UploadsStorageManager;updateUpload returns with: 1 for file: /storage/emulated/0/Download/Billett (2).pdf
2019-09-19T12:47:24.151+0200;D;UploadsStorageManager;notifyObserversNow
2019-09-19T12:47:24.152+0200;D;FileUploader;NotifyUploadResult with resultCode: NO_NETWORK_CONNECTION
2019-09-19T12:47:24.154+0200;D;FileUploader;Stopping command after id 1```

@denNorske try this:

From the logs it looks like the directories you browse through are being updated from the server. just file transfers fail.

Thanks!

Yes nextcloud works 100% fine elsewise. Got smb drive attached locally in Windows, I have Web interface working flawlessly, but android app fails on WiFi. I can also use phone browser and upload normally there.

When I installed the dev version of the app, shortly after adding the server, the uploading worked nicely. This morning though, it did not work.

I also notice, if I try to add the server over again as a “new” account in the app, the app will complain that this server/user is already added. Then I close the warning and go back to the app. After I get that notification, the uploads works again on WiFi. Until it stops working again sometime later…

Edit: I also checked pure DAV over WiFi, and it works, while the android client doesn’t.

That’s odd! I guess increasing log verbosity on your reverse proxy won’t help? Have you tried that?

Found this tho… Seems pretty similar…

Thanks again, yes that sounds very similar to the issue I have.

I just ensured that the application on my device have full rights to WiFi and Internet, and it should. It lists directories just fine (GET and PROPFIND requests) but no traffic is sent out when there are PUT requests. Neither reverse proxy nor the nextcloud host see any traffic PUT traffic. I have had trace level 4 in apache to determine traffic on both servers (I run reverse proxy between two servers) and there’s nothing to gain from it.

How far I can see, is that the application is having issues. Is the application bugged? What if I create you an account in my server, would you experience the same issue after a day?
Pm me if you’re up to test that.

I just started having this same issue on Android. Also running 16.0.4. Images upload fine over Verizon 4G but not on any wifi. I am able to create a folder manually through the Android app and it is synced. It also seems I can delete anything through the app. But it will not upload any files I try.

I am able to login to Nextcloud via Chrome and upload files over wifi, but the Android app always fails.

1 Like

UPDATE: I uninstalled the 3.8 Android app and reinstalled 3.7.2 and it’s back to working. So it must be a bug in 3.8?

Does it work for a longer period?

For me it stops working after a day or so, sometimes 15 minutes…

Edit: could you show your server Config, so I can compare with mine? To see if there’s anything in common. Remember to remove sensitive data

@denNorske I can confirm your issue. I have the exact same problem with your nextcloud server while not having any issues with my server. So the core problem should be on the server side… Uploads via app don’t work on WiFi, while downloads and everything else works fine… the web interface works without issues at any time. And if I use mobile data instead of WiFi I can do everything with the android app again… This is a very strange issue indeed. I would create an issue on GitHub. I don’t have an idea yet, what the cause could be

1 Like

Thanks! I’ll try to make an issue. A bit scared away by pages on pages with information required, but hopefully someone will be able to help.

Thank you very much for testing!!

1 Like

So I created an issue on GitHub under the server repository today.

Here is a link for tracking: https://github.com/nextcloud/server/issues/17226

My initial thoughts are:

  1. Either the server is doing some operation that makes the client fail to sync over WiFi
  2. Or the Server doesn’t like clients over Wifi.

It could reside on either of the sides, so I would need further digging to solve this one…

Thank you for the info. Well, if you try to re-add the account on a new update, does the same happen?

Could it be our memcache causing it or something? :slight_smile: