Can't access file named 'index.html'

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, 20.0.5): 23.0.0
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.52 behind nginx reverse proxy 1.18.0
PHP version (eg, 7.4): 7.4

The issue you are facing:

I uploaded a file called “index.html” (just working on a site) to a folder in my Nextcloud account using the Windows sync client. The file is shown in the Web GUI, however when I try to download it, i get “404 not found”, when I try to open the file details it returns “Error while loading the file data”
It happens no matter which folder I’m in, and by using “create text document” function in web gui I get error “Could not fetch file details “index.html””
Such file cannot be deleted, the only way I could get rid of it was to delete it from the server’s file system and then use occ files:scan.

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

Steps to replicate it:

  1. upload or create a file called “index.html”

The output of your Nextcloud log in Admin > Logging:

nothing related to the file, the only thing in the log is

/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.

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

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***my domains***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "23.0.0.10",
        "overwrite.cli.url": "https:\/\/192.168.0.230",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "PL",
        "htaccess.RewriteBase": "\/",
        "installed": true,
        "maintenance": false,
        "mysql.utf8mb4": true,
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "simpleSignUpLink.shown": false,
        "mail_smtpsecure": "tls",
        "mail_smtpport": "587",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": "true",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "theme": "",
        "loglevel": 0,
        "app_install_overwrite": [
            "calendar"
        ],
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory"
    }
}

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

nothing besides

GET /remote.php/path-to-file/index.html?downloadStartSecret=4ekprf1md4 HTTP/2.0" 404 114 "-" "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0

Is is normal because of rewrite settings in /path/to/www/nextcloud/.htaccess .
file on Github: https://github.com/nextcloud/server/blob/master/.htaccess
Please do not change it. Use normal websites (webserver settings) outside of your nextcloud.

For single files (but not HTML files) you can use the app Sharing Path.

Normal settings:

cloud.server.tld: Nextcloud `/path/to/www/nextcloud`
www.server.tld: websites `/path/to/www`
server.tld: same websites `/path/to/www`

I’m not sure I understand. Is it normal behaviour for a file that I upload, that just happens to have a name “index.html”, to be impossible to delete and download?

I tested it for you.

If i share the directory i see on public share “index.html” and on click nextcloud editor (md) or OnlyOffice is opened with html code.
If i share the file i see on public share “index.html” direct the nextcloud editor or OnlyOffice with the html code.

Nextcloud does not interpret HTML files. That would be a security risk.
Also rm -rf / is not executed :wink:

1 Like