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

Android clients fail to upload to server over WiFi, but works over 4g? (Server issue) #17226

Closed
dennorske opened this issue Sep 21, 2019 · 5 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info

Comments

@dennorske
Copy link

dennorske commented Sep 21, 2019


name: Android app fails upload (upload only) on WiFi connection
about: https://help.nextcloud.com/t/android-client-unable-to-upload-with-wifi-but-4g-works/60204
labels: bug

Steps to reproduce

  1. Get an account on my server
  2. Add the account to your nextcloud application on android
  3. Let some hours pass, try to upload files on WiFi.
  4. Get error "Upload failed" and app reports no network connection found.
  5. This only happens on my server, and not on other servers. Believe this is server related, hence why it is reported here.

Expected behaviour

I expect that WiFi uploads should work to my server

Actual behaviour

WiFi works shortly after adding the account. After some time passes, it fails to perform PUT requests to my server. Nextcloud Android app complains that "connection error". When you switch to 4G, the uploading works immediately with no problem. Switching back to WiFi, the upload stops and it fails again. Re-adding the account lets the wifi work for a few moments (didn't catch for how long, but for an hour or so), until it stops working again.

I can create new folders, browse the server directories, download files. Only thing not working is uploading new content.

Server configuration

Note: I do have HSTS enabled, but with a short TTL. Currently in a testing phase to see if it works, before I go ahead and enforce/register it. Not sure if this plays any role in this.

Operating system: Linux 4.15.0-62-generic #69-Ubuntu SMP Wed Sep 4 20:55:53 UTC 2019 x86_64

Web server: Apache/2.4.41 (Ubuntu) (apache2handler)

Database: mysql 5.7.27

PHP version: 7.2.19-0ubuntu0.18.04.2

Nextcloud version: 16.0.4 - 16.0.4.1

Updated from an older Nextcloud/ownCloud or fresh install: Updated from 15, I think - some time back now.

Where did you install Nextcloud from: https://nextcloud.com/install/#instructions-server (Official webpage)

Signing status:

Signing status
No errors have been found

List of activated apps:

App list
 - accessibility: 1.2.0
 - activity: 2.9.1
 - admin_audit: 1.6.0
 - announcementcenter: 3.5.1
 - audioplayer: 2.8.4
 - bruteforcesettings: 1.4.0
 - calendar: 1.7.1
 - camerarawpreviews: 0.7.0
 - cloud_federation_api: 0.2.0
 - comments: 1.6.0
 - dav: 1.9.2
 - deck: 0.6.6
 - external: 3.3.0
 - federatedfilesharing: 1.6.0
 - federation: 1.6.0
 - files: 1.11.0
 - files_external: 1.7.0
 - files_pdfviewer: 1.5.0
 - files_readmemd: 1.1.1
 - files_rightclick: 0.15.1
 - files_sharing: 1.8.0
 - files_texteditor: 2.8.0
 - files_trackdownloads: 1.5.0
 - files_trashbin: 1.6.0
 - files_versions: 1.9.0
 - files_videoplayer: 1.5.0
 - firstrunwizard: 2.5.0
 - gallery: 18.3.0
 - logreader: 2.1.0
 - lookup_server_connector: 1.4.0
 - nextcloud_announcements: 1.5.0
 - notifications: 2.4.1
 - oauth2: 1.4.2
 - onlyoffice: 3.0.0
 - password_policy: 1.6.0
 - previewgenerator: 2.1.0
 - privacy: 1.0.0
 - provisioning_api: 1.6.0
 - quota_warning: 1.5.0
 - ransomware_protection: 1.4.0
 - recommendations: 0.4.0
 - serverinfo: 1.6.0
 - sharebymail: 1.6.0
 - socialsharing_email: 1.0.5
 - spreed: 6.0.4
 - support: 1.0.0
 - survey_client: 1.4.0
 - suspicious_login: 1.0.0
 - systemtags: 1.6.0
 - theming: 1.7.0
 - twofactor_backupcodes: 1.5.0
 - twofactor_nextcloud_notification: 1.1.2
 - unsplash: 1.1.3
 - updatenotification: 1.6.0
 - viewer: 1.1.0
 - workflowengine: 1.6.0

Nextcloud configuration:

Config report
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "ducky.rocks"
    ],
    "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "16.0.4.1",
    "overwrite.cli.url": "https:\/\/172.16.0.16:81",
    "overwriteprotocol": "https",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "theme": "",
    "loglevel": 2,
    "maintenance": false,
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauthtype": "LOGIN",
    "mail_smtpauth": 1,
    "mail_smtpport": "465",
    "mail_sendmailmode": "smtp",
    "mail_smtpsecure": "ssl",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "appstoreurl": "https:\/\/api.nextcloud.com\/v1",
    "filesystem_check_changes": 1,
    "forwarded_for_headers": [
        "HTTP_X_FORWARDED_FOR"
    ],
    "memcache.local": "\\OC\\Memcache\\APCu",
    "memcache.distributed": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 0
    }
}

Are you using external storage, if yes which one: Multiple, FTP, SFT and Local. Not applicable for this report though.

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Android Client

Operating system: Android 9, Android 7

Logs

Web server error log

Web server error log
No errors or warnings reported.

Nextcloud log (data/nextcloud.log)

Nextcloud log
No server logs generated when having the connection error. I changed to debugging (Loglevel 0) while testing. What does my server do ,that makes the client fail? 

android

Android log

https://gist.github.com/simeneriks1/c4714c96dd3bdf28cf0f30d03fa2237d

pic

@dennorske dennorske changed the title Android clients fail to upload to server over WiFi, but works over 4g? Android clients fail to upload to server over WiFi, but works over 4g? (Server issue) Sep 21, 2019
@kesselb kesselb added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info labels Sep 21, 2019
@kesselb
Copy link
Contributor

kesselb commented Sep 21, 2019

Screenshot from 2019-09-21 16-35-31

Is "ducky.rocks" your nextcloud instance? If so your configuration is invalid. Add the cloudflare reverse proxies (https://www.cloudflare.com/ips/) to the trusted_proxies configuration. IPv4 support wildcards with newer nextcloud versions.

There are some (older) reports that cloudflare is not working (at least the js optimization): #4840 #10557

Would you mind to check your nextcloud instance without cloudflare?

@dennorske
Copy link
Author

Thanks @kesselb

Wifi uploads now work. Could it be dns related? Regarding the report..

And when it comes to the failed logins, I repeatedly see that ip 127.0.0.1 fails login, almost like the http header doesn't work.. I'll give it a try to add the IPs and see if it helps.

@kesselb
Copy link
Contributor

kesselb commented Sep 22, 2019

I suspect that if you switch from wifi to 4g another cloudflare node is used (they have many) which is not blocked by bruteforce. Check https://support.cloudflare.com/hc/en-us/articles/200170986-How-does-CloudFlare-handle-HTTP-Request-headers- for more details.

Do we agree that this is a configuration issue and close it?

@dennorske
Copy link
Author

Thank you for the information and help.

Just to clarify, is cloudflare preventing PUT commands to my server or so? Dont understand what's really happening, could it be the headers getting modified?

@kesselb
Copy link
Contributor

kesselb commented Sep 22, 2019

Just to clarify, is cloudflare preventing PUT commands to my server or so?

I don't think so. I assume that your client is blocked by the bruteforce protection. Check the image from cloudflare. You don't need mod_cloudflare or mod_remoteip. Just tell nextcloud where to find the real ip of the client.

cloudflare image

Please use https://help.nextcloud.com for configuration support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info
Projects
None yet
Development

No branches or pull requests

2 participants