No "Add files" button

Nextcloud version: 12.0.2
Operating system and version: Debian 9
Apache or nginx version: Nginx 1.10.3-1
PHP version: 7.1.9-1
Is this the first time you’ve seen this error?: no

Can you reliably replicate it? (If so, please outline steps): yes

The issue you are facing:

N.B. I am currently on v12 but the same exact thing happened with v11.

I installed a fresh copy of NC by unpacking the tar file and pointing my nginx configuration to it.

I created a separate data directory, gave www-data (the nginx process owner) read/write permissions to it and changed the configuration to reflect this setup.

When I initialize the application I create an admin user and the app creates the files in the data directory following the skeleton directory.

If I browse the files on the NC interface, the “All files” directory is empty. I can only see the home button, and no “Add files” button. If I go to “Recent files” I see the sample files that are in the directory but attempting to download or display them results in an error. No errors are reported in my nginx log, php-errors log (from php-fpm) or the NC log file.

My configuration is as follows:

Also, in the admin panel I see the message “Your web server is not yet set up properly to allow file synchronization because the WebDAV interface seems to be broken.”. I have seen possible solutions for that in separate forums but I’m trying to solve one thing at a time. Could that be related?

Any help would be appreciated.

Thanks,

s

The output of your Nextcloud log in Admin > Logging: Nothing

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

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

$CONFIG = array (
  'instanceid' => '*******',
  'passwordsalt' => '*******************',
  'secret' => '******************************************',
  'trusted_domains' => 
  array (
    0 => 'cloud.mydomain.net',
  ),
  'datadirectory' => '/data/nextcloud/',
  'overwrite.cli.url' => 'https://mydomain.net',
  'dbtype' => 'pgsql',
  'version' => '12.0.2.0',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '***********',
  'logtimezone' => 'America/Chicago',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'updater.secret' => '****************************************************************',
  'theme' => '',
  'loglevel' => 1,
  'log_rotate_size' => 104857600,
  'maintenance' => false,
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/nextcloud/current/apps',
      'url' => '/apps',
      'writable' => true,
    ),
  ),
);

Remember, this information may be requested if it isn’t supplied; for fastest response please provide as much as you can :heart: Feel free to use a pastebin service, otherwise log files can be indented with 4 spaces on each line to present them in a friendlier way on the forum.

When I had a similar problem, it turned out to be a result of incorrect operating system file permissions.

Can the web server definitely read/write to the all sub directories in the data directory?

Hi thatscoteng, thanks for the reply.

The application and data directories are, to my knowledge, all owned by www-data:www-data, the nginx process owner. Whenever I add a user (not only the admin) I see the skeleton directory being created in the filesystem.

Thanks,
Stefano

If you modified permissions manually, it’s possible something got missed somewhere. Try running the chown and chmod commands shown in this part of the documentation, just to be sure permissions and ownership are set correctly.

https://docs.nextcloud.com/server/12/admin_manual/configuration_files/external_storage/local.html?highlight=permission

I did that. No change.

Could it be nginx-related?

This is my config:

server {
    include snippets/sslonly.conf;

    server_name mydomain.net;

    ssl_certificate /path/to/cert.pem
    ssl_certificate_key /path/to/key.pem
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

    access_log  /var/log/nginx/mydomain.net.access.log main;
    error_log  /var/log/nginx/mydomain.net.error.log;

    root /var/www/nextcloud/current;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?url=$args; 
    }

    location ~ \.php$ {
        include snippets/php.conf;
    }

    location = /data/htaccesstest.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

}

The only other thing that I can think of is that /var/www/nextcloud/current is a symlink to /var/www/nextcloud/<latest version>.

Resurfacing this issue which I haven’t been able to resolve yet.

It looks like JS files are not loading (404).

I installed v12 fresh and followed the instructions on how to set up Nginx: https://docs.nextcloud.com/server/12/admin_manual/installation/nginx.html

Right now NC is completely broken for me.

Below is my nginx config file, with only a few modifications account for my environment. I will greatly appreciate your help as I make one last ditch effort to make it work:

# NextCloud
upstream php-handler {
    server unix:/var/run/php/php7.1-fpm.sock;
}

server {
    listen 443 ssl;
    server_name cloud.mydomain.net;

    ssl_certificate /etc/letsencrypt/live/cloud.mydomain.net/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/cloud.mydomain.net/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot

    # Add headers to serve security related headers
    # Before enabling Strict-Transport-Security headers please read into this
    # topic first.
    # add_header Strict-Transport-Security "max-age=15768000;
    # includeSubDomains; preload;";
    #
    # WARNING: Only add the preload option once you read about
    # the consequences in https://hstspreload.org/. This option
    # will add the domain to a hardcoded list that is shipped
    # in all major browsers and getting removed from this list
    # could take several months.
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Robots-Tag none;
    add_header X-Download-Options noopen;
    add_header X-Permitted-Cross-Domain-Policies none;


    access_log  /var/log/nginx/cloud.mydomain.net.access.log main;
    error_log  /var/log/nginx/cloud.mydomain.net.error.log;

    root /var/www/nextcloud/current;
    #index index.php;

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    # The following 2 rules are only needed for the user_webfinger app.
    # Uncomment it if you're planning to use this app.
    # rewrite ^/.well-known/host-meta /nextcloud/public.php?service=host-meta
    # last;
    #rewrite ^/.well-known/host-meta.json
    # /nextcloud/public.php?service=host-meta-json last;

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

    #location /.well-known/acme-challenge { }

    # set max upload size
    client_max_body_size 512M;
    fastcgi_buffers 64 4K;

    # Enable gzip but do not remove ETag headers
    gzip on;
    gzip_vary on;
    gzip_comp_level 4;
    gzip_min_length 256;
    gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
    gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;

    # Uncomment if your server is build with the ngx_pagespeed module
    # This module is currently not supported.
    #pagespeed off;

    location / {
        rewrite ^ /index.php$uri;
    }

    location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
        deny all;
    }
    location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
        deny all;
    }

    location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS on;
        #Avoid sending the security headers twice
        fastcgi_param modHeadersAvailable true;
        fastcgi_param front_controller_active true;
        fastcgi_pass php-handler;
        fastcgi_intercept_errors on;
        fastcgi_request_buffering off;
    }

    location ~ ^/(?:updater|ocs-provider)(?:$|/) {
        try_files $uri/ =404;
        index index.php;
    }

    # Adding the cache control header for js and css files
    # Make sure it is BELOW the PHP block
    location ~ \.(?:css|js|woff|svg|gif)$ {
        try_files $uri /index.php$uri$is_args$args;
        add_header Cache-Control "public, max-age=15778463";
        # Add headers to serve security related headers (It is intended to
        # have those duplicated to the ones above)
        # Before enabling Strict-Transport-Security headers please read into
        # this topic first.
        # add_header Strict-Transport-Security "max-age=15768000;
        #  includeSubDomains; preload;";
        #
        # WARNING: Only add the preload option once you read about
        # the consequences in https://hstspreload.org/. This option
        # will add the domain to a hardcoded list that is shipped
        # in all major browsers and getting removed from this list
        # could take several months.
        add_header X-Content-Type-Options nosniff;
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Robots-Tag none;
        add_header X-Download-Options noopen;
        add_header X-Permitted-Cross-Domain-Policies none;
        # Optional: Don't log access to assets
        access_log off;
    }

    location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
        try_files $uri /index.php$uri$is_args$args;
        # Optional: Don't log access to other assets
        access_log off;
    }
}