iPhone error | 401 remote.php/webdav | error

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2): Nextcloud V12
Operating system and version (eg, Ubuntu 17.04): Debian 10.2 x64
Apache or nginx version (eg, Apache 2.4.25): Apache2 & Nginx reverse proxy
PHP version (eg, 7.1): 7.4

The issue you are facing: iPhone users are able to use the app but with 401 error about webdav. Android users are fine.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Tested 3 differetn iphones with new user accounts.
  2. none
  3. none

The output of your Nextcloud log in Admin > Logging:

Only LDAP errors here nothing else much.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'trusted_proxies' =>
  array (
    0 => '192.168.1.158',
  ),
  'overwriteprotocol' => 'https',
  'passwordsalt' => '###############',
  'secret' => '###############',
  'trusted_domains' =>
  array (
    0 => 'cloud.eeeeee.org',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '18.0.0.10',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => '########',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncuser',
  'dbpassword' => '###########',
  'installed' => true,
  'instanceid' => '##########',
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => 'true',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'mail_from_address' => 'support',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => '#########',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauth' => 1,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => 'smtp.######',
  'mail_smtpport' => '465',
  'mail_smtpname' => '##########',
  'mail_smtppassword' => '############',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
);

The output of your Apache/nginx/system log in /var/log/____:

Unable to post - sensitive information about other websites here.

Nginx Config here -

server {
    listen 80;
    server_name cloud.eeeeee.org;
    return 301 https://$host$request_uri;
}

server {

    listen 443;
    server_name cloud.eeeeee.org;
    keepalive_timeout 300;
    ssl_certificate           /home/sesipod/SSL/fullchain.cer;
    ssl_certificate_key       /home/sesipod/SSL/cloud.eeeeee.org.key;
    ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;

    access_log            /var/log/nginx/jenkins.access.log;


    location / {

      client_max_body_size 0;
      add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
      proxy_http_version 1.1;
      proxy_buffering off;
      proxy_buffer_size  128k;
      proxy_buffers 100  128k;
      proxy_set_header        Host $host;
      proxy_set_header        X-Real-IP $remote_addr;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header        X-Forwarded-For $remote_addr;
###   proxy_set_header        X-Forwarded-Proto $scheme;
      proxy_set_header        HTTP_X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
###   add_header X-Cache-Status $upstream_cache_status;

#######
      proxy_cache off;
      proxy_pass          http://192.168.1.152:80;
      proxy_read_timeout  90;
      proxy_redirect      http://192.168.1.152:80 https://cloud.eeeeee.org;
#######
    }

    location /.well-known/carddav {
      return 301 $scheme://$host/remote.php/dav;
    }
    location /.well-known/caldav {
      return 301 $scheme://$host/remote.php/dav;
    }
#######
}

Here is the error iPhone users are getting. This is happening any time a user logins-in / tries to create a new file. Also there seems to no options for Document creations like Word/excel/powerpoint. ( Side note- Android phones have 0 issues. Can upload / download / create and view documents. )


Nextcloud is installed on Debian 10.2 using apache2. Everything works perfectly if I connect form within my network directly to the server using DNS. However I am using an NGINX proxy on the wan side. So it looks like it’s an error with NGINX config.

If I connect to my server form within my wifi network at home everything works perfectly. This is making a connection directly to the Debian server and skipping Nginx RVP.

Outside of my home network say 4g or other peoples home network all connections go through the Nginx RVP server and then to the nextcloud server. That is where the issues begin. (:exclamation: NOTE: :exclamation: android devices and web browsers seem to have no issues with this. Only iPhones )

1 Like

Getting the same error for our users.
No nginx though…
Commenting to follow :slight_smile:

1 Like

@Powered-Dan are you using cloudflare by a chance for dns ?

No, not unfortunately.
It seems to be isolated to iOS devices at this point.
I even upgraded to 18.0.1 and it hasnt helped.

Error seems to coincide with an update that was released for the iOS app last week.

Already an issue at GitHub

Tried my iPad over 4G and the app is working correctly. I wonder if this is only related to iPhones :thinking::face_with_monocle:
I even reinstalled the app to make sure I had a fresh copy.

Apparently there is an update out?
@Powered-Dan can you test this? I don’t have an iPhone only my iPad.

Do you have LDAP enabled on your nextcloud instance ?

It seems better now. There is still a small 401 error on opening the app. The big banner error is gone.

Actually, it’s a 404 error now…
but much better than it was at least.

Can you use documentserver stuff ?

Now I get a 403 when trying to open a TXT oder MD file… very annoying.

I’m guessing here that all of us have LDAP configuration on the server ? To auth user accounts ?

Looks like quite a few GitHub issues have been merged with a single issue: https://github.com/nextcloud/ios/issues/1159