[SOLVED] Getting Error "Encountered problem accessing the folder /" on fresh and old install

Steps to reproduce

  1. Install owncloud
  2. Login

Expected behaviour

Folders should show up and default sample files

Actual behaviour

Showing no folders and instead Error “Encountered problem accessing the folder /”
It seems that it is trying to access / path, which is why it is getting this error
Even when in configuration the path is /var/www/html/owncloud/data

Server configuration

Operating system: Ubuntu 20.04

Web server: Nginx

Database: MySQL

PHP version: 7.4

ownCloud version: 10.7

Updated from an older ownCloud or fresh install: Fresh Install. Even old version on a different server is giving same problem even when it was working before

Where did you install ownCloud from: From Owncloud Website manual install

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
No errors have been found.

The content of config/config.php:

1 <?php
1 $CONFIG = array (
2 ‘instanceid’ => ‘occpw3kbfa63’,
3 ‘passwordsalt’ => ‘fmObTjxEtbqro2FhhLW6bI2P/D+TFb’,
4 ‘secret’ => ‘qRqZEcDouq+9BPPfYPCcwgkE92zx9rsSDEJiCcr5ioX7EpXR’,
5 ‘trusted_domains’ =>
6 array (
7 0 => ‘192.168.1.70’,
8 ),
9 ‘datadirectory’ => ‘/var/www/html/owncloud/data’,
10 ‘overwrite.cli.url’ => ‘http://192.168.1.70’,
11 ‘dbtype’ => ‘mysql’,
12 ‘version’ => ‘10.7.0.4’,
13 ‘dbname’ => ‘owncloud’,
14 ‘dbhost’ => ‘localhost’,
15 ‘dbtableprefix’ => ‘oc_’,
16 ‘mysql.utf8mb4’ => true,
17 ‘dbuser’ => ‘ownclouduser’,
18 ‘dbpassword’ => ‘test’,
19 ‘logtimezone’ => ‘UTC’,
20 ‘apps_paths’ =>
21 array (
22 0 =>
23 array (
24 | ‘path’ => ‘/var/www/html/owncloud/apps’,
25 | ‘url’ => ‘/apps’,
26 | ‘writable’ => false,
27 ),
28 1 =>
29 array (
30 | ‘path’ => ‘/var/www/html/owncloud/apps-external’,
31 | ‘url’ => ‘/apps-external’,
32 | ‘writable’ => true,
33 ),
34 ),
35 ‘installed’ => true,
36 );

{
    "system": {
        "instanceid": "occpw3kbfa63",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.1.70"
        ],
        "datadirectory": "\/var\/www\/html\/owncloud\/data",
        "overwrite.cli.url": "http:\/\/192.168.1.70",
        "dbtype": "mysql",
        "version": "10.7.0.4",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/owncloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/owncloud\/apps-external",
                "url": "\/apps-external",
                "writable": true
            }
        ],
        "installed": true
    }
}

List of activated apps:

Enabled:
  - activity:
    - Version: 2.6.0
    - Path: /var/www/html/owncloud/apps/activity
  - comments:
    - Version: 0.3.0
    - Path: /var/www/html/owncloud/apps/comments
  - configreport:
    - Version: 0.2.0
    - Path: /var/www/html/owncloud/apps/configreport
  - dav:
    - Version: 0.6.0
    - Path: /var/www/html/owncloud/apps/dav
  - federatedfilesharing:
    - Version: 0.5.0
    - Path: /var/www/html/owncloud/apps/federatedfilesharing
  - federation:
    - Version: 0.1.0
    - Path: /var/www/html/owncloud/apps/federation
  - files:
    - Version: 1.5.2
    - Path: /var/www/html/owncloud/apps/files
  - files_external:
    - Version: 0.7.1
    - Path: /var/www/html/owncloud/apps/files_external
  - files_mediaviewer:
    - Version: 1.0.4
    - Path: /var/www/html/owncloud/apps/files_mediaviewer
  - files_pdfviewer:
    - Version: 0.11.2
    - Path: /var/www/html/owncloud/apps/files_pdfviewer
  - files_sharing:
    - Version: 0.14.0
    - Path: /var/www/html/owncloud/apps/files_sharing
  - files_texteditor:
    - Version: 2.3.0
    - Path: /var/www/html/owncloud/apps/files_texteditor
  - files_trashbin:
    - Version: 0.9.1
    - Path: /var/www/html/owncloud/apps/files_trashbin
  - files_versions:
    - Version: 1.3.0
    - Path: /var/www/html/owncloud/apps/files_versions
  - firstrunwizard:
    - Version: 1.2.0
    - Path: /var/www/html/owncloud/apps/firstrunwizard
  - market:
    - Version: 0.6.0
    - Path: /var/www/html/owncloud/apps/market
  - notifications:
    - Version: 0.5.2
    - Path: /var/www/html/owncloud/apps/notifications
  - provisioning_api:
    - Version: 0.5.0
    - Path: /var/www/html/owncloud/apps/provisioning_api
  - systemtags:
    - Version: 0.3.0
    - Path: /var/www/html/owncloud/apps/systemtags
  - templateeditor:
    - Version: 0.4.0
    - Path: /var/www/html/owncloud/apps/templateeditor
  - updatenotification:
    - Version: 0.2.1
    - Path: /var/www/html/owncloud/apps/updatenotification
Disabled:
  - admin_audit:
    - Path: /var/www/html/owncloud/apps/admin_audit
  - announcementcenter:
    - Path: /var/www/html/owncloud/apps/announcementcenter
  - customgroups:
    - Path: /var/www/html/owncloud/apps/customgroups
  - encryption:
    - Path: /var/www/html/owncloud/apps/encryption
  - enterprise_key:
    - Path: /var/www/html/owncloud/apps/enterprise_key
  - external:
    - Path: /var/www/html/owncloud/apps/external
  - files_antivirus:
    - Path: /var/www/html/owncloud/apps/files_antivirus
  - files_classifier:
    - Path: /var/www/html/owncloud/apps/files_classifier
  - files_external_dropbox:
    - Path: /var/www/html/owncloud/apps/files_external_dropbox
  - files_external_ftp:
    - Path: /var/www/html/owncloud/apps/files_external_ftp
  - files_ldap_home:
    - Path: /var/www/html/owncloud/apps/files_ldap_home
  - files_lifecycle:
    - Path: /var/www/html/owncloud/apps/files_lifecycle
  - firewall:
    - Path: /var/www/html/owncloud/apps/firewall
  - graphapi:
    - Path: /var/www/html/owncloud/apps/graphapi
  - guests:
    - Path: /var/www/html/owncloud/apps/guests
  - metrics:
    - Path: /var/www/html/owncloud/apps/metrics
  - oauth2:
    - Path: /var/www/html/owncloud/apps/oauth2
  - openidconnect:
    - Path: /var/www/html/owncloud/apps/openidconnect
  - password_policy:
    - Path: /var/www/html/owncloud/apps/password_policy
  - ransomware_protection:
    - Path: /var/www/html/owncloud/apps/ransomware_protection
  - sharepoint:
    - Path: /var/www/html/owncloud/apps/sharepoint
  - systemtags_management:
    - Path: /var/www/html/owncloud/apps/systemtags_management
  - theme-enterprise:
    - Path: /var/www/html/owncloud/apps/theme-enterprise
  - user_external:
    - Path: /var/www/html/owncloud/apps/user_external
  - user_ldap:
    - Path: /var/www/html/owncloud/apps/user_ldap
  - user_shibboleth:
    - Path: /var/www/html/owncloud/apps/user_shibboleth
  - windows_network_drive:
    - Path: /var/www/html/owncloud/apps/windows_network_drive
  - wopi:
    - Path: /var/www/html/owncloud/apps/wopi
  - workflow:
    - Path: /var/www/html/owncloud/apps/workflow

Are you using external storage, if yes which one: NO

Are you using encryption: yes/no - SSL

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

LDAP configuration (delete this part if not used)

 There are no commands defined in the "ldap" namespace.

Client configuration

Browser: Safari / Firefox

Operating system: MacOSX

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

{"reqId":"jfswMEI1LfppwDxEDoJV","level":3,"time":"2021-06-28T08:04:57+00:00","remoteAddr":"192.168.1.12","user":"admin","app":"PHP","method":"GET","url":"\/index.php\/core\/ajax\/appconfig.php?app=core&key=umgmt_set_password&defaultValue=false&action=getValue","message":"Undefined variable: app at \/var\/www\/html\/owncloud\/core\/ajax\/appconfig.php#38"}

Before what? Upgrade?

Either the access rights for the ownCloud tree are not set properly, or there is something wrong in your webserver config.

1 Like

@alfredb

These are two servers. On one server I did a fresh install, still facing the same issue

I have shared configuration file. Let me know what are the access rights of the owncloud folders - if there is an link

As described here: Post-Installation Steps

1 Like

owncloud is also set to www-data:www-data

but still this issue

As I mentioned above, if the access rights are OK

you should check the webserver config. Unfortunately I cannot help here, as I don’t know how to config Nginx. And AFAIK it is not officially recommended by ownCloud.

1 Like

@alfredb one observation of nginx access.log as there are some 404

“GET /index.php/apps/files/ajax/getstoragestats.php?dir=%2F HTTP/1.1” 404 201 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15”

is that how it should be like

GET /index.php/apps/files/ajax/getstoragestats.php?dir=%2F

Also nginx in sites-available folder has owncloud file, which is as follows

server {
listen 80;
root /var/www/html/owncloud;
index index.php index.html index.htm;
server_name 192.168.1.70;
location / {

try_files $uri /index.php$is_args$args;
}

location ~ .php$ {
try_files $uri =404;
fastcgi_pass unix:/run/php/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

This is the correct nginx file format with SSL and it works with OwnCloud version 10
Sharing so that anyone else needs can use it

server {
     listen 80;
     if ($host = domain_name.tld) {
        return 301 https://$host$request_uri:443;
     } 
	server_name domain_name.tld;
}

server {
    listen 443 ssl;
    
    server_name domain_name.tld;

    ssl_certificate /etc/ssl/certs/domain_name.tld_ssl_certificate.cer;
    ssl_certificate_key /etc/ssl/certs/domain_name.tld_private_key.key;

    # Add headers to serve security related headers
    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;
    add_header Referrer-Policy no-referrer;

    #I found this header is needed on Ubuntu, but not on Arch Linux. 
    add_header X-Frame-Options "SAMEORIGIN";

    # Path to the root of your installation
    root /var/www/html/owncloud;

    access_log /var/log/nginx/owncloud.access;
    error_log /var/log/nginx/owncloud.error;

    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 /public.php?service=host-meta last;
    #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
    # last;

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

    location ~ /.well-known/acme-challenge {
      allow all;
    }

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

    # Disable gzip to avoid the removal of the ETag header
    gzip off;

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

    error_page 403 /core/templates/403.php;
    error_page 404 /core/templates/404.php;

    location / {
       rewrite ^ /index.php;
    }

    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/.+|core/templates/40[34])\.php(?:$|/) {
       include fastcgi_params;
       fastcgi_split_path_info ^(.+\.php)(/.*)$;
       try_files $fastcgi_script_name =404;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       fastcgi_param PATH_INFO $fastcgi_path_info;
       #Avoid sending the security headers twice
       fastcgi_param modHeadersAvailable true;
       fastcgi_param front_controller_active true;
       fastcgi_pass unix:/run/php/php7.4-fpm.sock;
       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)$ {
        try_files $uri /index.php$uri$is_args$args;
        add_header Cache-Control "public, max-age=7200";
        # Add headers to serve security related headers (It is intended to
        # have those duplicated to the ones above)
        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;
        add_header Referrer-Policy no-referrer;
        # Optional: Don't log access to assets
        access_log off;
   }

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

Glad to read it works now. So it really was the webserver config, as I guessed.

2 Likes

Hi @alfredb yes, it was indeed nginx configuration. I didn’t think that so many parameters of nginx were really required. Thank you so much

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.