# Can't delete file locally and in Nextcloud web-interface - file is present on database and remote on disk

**URL:** <https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904>\
**Category:** ℹ️ Support\
**Tags:** nextcloud, nc29, files\
**Created:** [January 14, 2025, 9:31am UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904 "2025-01-14T09:31:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![msg\_01](https://help.nextcloud.com/letter_avatar/msg_01/32/5_5575768a8748004e209b776fc1b2916d.png) [@msg\_01](https://help.nextcloud.com/u/msg_01)\
**Post date:** [January 14, 2025, 9:31am UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/1 "2025-01-14T09:31:55Z")

</div>

## The Basics

- Nextcloud Server version _(e.g., 29.x.x)_:

- Operating system and version _(e.g., Ubuntu 24.04)_:

- Web server and version _(e.g, Apache 2.4.25)_:

- PHP version _(e.g, 8.3)_:

- Is this the first time you’ve seen this error? (Yes / No):

- When did this problem seem to first start?

- Installation method _(e.g. AlO, NCP, Bare Metal/Archive, etc.)_

- Are you using CloudfIare, mod\_security, or similar? _(Yes / No)_

### Summary of the issue you are facing:

I want to delete a file on the Nextcloud web-userinterface , but I can’t, it says \>“Delete file” action failed\<. I already run  
files:scan --all  
files:cleanup  
files:repair-tree

I deleted the oc\_file\_locks table in my database like described here:

> [@File is locked - how to unlock](https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883/9):
>
> For those that do not know how to connect or even the owncloud database name in mysql (mariadb) , follow these instructions : 0 - put your nextcloud under maintenance mode on config.php , so no one access it while you are doing changes . 1st - open your config.php in your nextcloud server folder under “config” folder . 2nd - there should be a field the like this : " ‘dbname’ =\> " , in this field there is your database name . 3rd - open a terminal window and execute under a root account : m…

The file exists as physical file on the server when I acces my files via FTP but there it has a file size of 113Mb where as synced on my PC locally it only has 0kb. On the Webuser-Interface on Nextcloud it has 113Mb but I can’t access any info on it, it says \>“Open details” action failed\<.

When I delete the file locally it’s re-downloaded after a while. Like I mentioned I can’t delete the file on the Nextcloud webinterface.

Now, what should I do? Can I delete the file via FTP from the server? Or delete the entry from the database?

The Sync-Client-Log gives a “403 Forbidden” error, when trying to download that file.

2025-01-13 23:20:57:829 [warning nextcloud.sync.propagator C:\Users\User\AppData\Local\Temp\windows-27802\client-building\desktop\src\libsync\owncloudpropagator.cpp:288]: Could not complete propagation of “Steinberg\_Download\_Assistant\_1.35.0\_Installer\_win.exe” by OCC::PropagateDownloadFile(0x24258431930) with status OCC::SyncFileItem::BlacklistedError and error: “Server hat "403 Forbidden" auf "GET XXX/o/remote.php/dav/files/admin\_owncloud\_Ba3RMRVvL82di9r/Steinberg\_Download\_Assistant\_1.35.0\_Installer\_win.exe" geantwortet”

2025-01-13 23:20:57:829 [warning nextcloud.sync.credentials.webflow C:\Users\User\AppData\Local\Temp\windows-27802\client-building\desktop\src\gui\creds\webflowcredentials.cpp:208]: “Error transferring [https://XXX/o/remote.php/dav/files/admin\_owncloud\_Ba3RMRVvL82di9r/Steinberg\_Download\_Assistant\_1.35.0\_Installer\_win.exe](https://XXX/o/remote.php/dav/files/admin_owncloud_Ba3RMRVvL82di9r/Steinberg_Download_Assistant_1.35.0_Installer_win.exe) - server replied: Forbidden”

### Steps to replicate it (hint: details matter!):

I don’t know how this happened, I never played with the files in the Nextcloud data-directory via FTP. I guess there was an error uploading or syncing.

#### Nextcloud

The output of `occ config:list system` or similar is best, but, if not possible, the contents of your `config.php` file from `/path/to/nextcloud` is fine (make sure to remove any identifiable information!):

{  
“system”: {  
“instanceid”: “_ **REMOVED SENSITIVE VALUE** _”,  
“passwordsalt”: “_ **REMOVED SENSITIVE VALUE** _”,  
“secret”: “_ **REMOVED SENSITIVE VALUE** _”,  
“trusted\_domains”: [  
“[www.XXX.de](http://www.XXX.de)”,  
“[cloud.XXX.de](http://cloud.XXX.de)”  
],  
“datadirectory”: “_ **REMOVED SENSITIVE VALUE** _”,  
“dbtype”: “mysql”,  
“version”: “29.0.10.1”,  
“overwrite.cli.url”: “https://www.XXX.de/o”,  
“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,  
“trashbin\_retention\_obligation”: “15, auto”,  
“app\_install\_overwrite”: [  
“occweb”  
],  
“encryption.legacy\_format\_support”: false,  
“encryption.key\_storage\_migrated”: false,  
“default\_phone\_region”: “DE”,  
“mail\_smtpmode”: “smtp”,  
“mail\_smtpsecure”: “tls”,  
“mail\_sendmailmode”: “smtp”,  
“mail\_from\_address”: “_ **REMOVED SENSITIVE VALUE** _”,  
“mail\_domain”: “_ **REMOVED SENSITIVE VALUE** _”,  
“mail\_smtpauthtype”: “LOGIN”,  
“mail\_smtpauth”: 1,  
“mail\_smtphost”: “_ **REMOVED SENSITIVE VALUE** _”,  
“mail\_smtpname”: “_ **REMOVED SENSITIVE VALUE** _”,  
“mail\_smtppassword”: “_ **REMOVED SENSITIVE VALUE** _”,  
“maintenance\_window\_start”: 1,  
“preview\_max\_x”: 1024,  
“preview\_max\_y”: 1024,  
“maintenance”: false,  
“updater.release.channel”: “stable”  
}  
}

---

<div class="post-metadata">

**Author:** ![wbk](https://help.nextcloud.com/letter_avatar/wbk/32/5_5575768a8748004e209b776fc1b2916d.png) [@wbk](https://help.nextcloud.com/u/wbk)\
**Post date:** [January 15, 2025, 12:34pm UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/2 "2025-01-15T12:34:28Z")

</div>

Hi msg\_01,

I won’t be able to help you out, but can tell you something that I found after related trouble. It was years back, but I think the mechanism has remained the same.

For remote storage, the file itself stays remote. When accessing such a file though, Nextcloud will cache it in the database. It is now ‘some kind of local’, but it is a (large) entry in the database, not a file as such.

`occ files:scan` will scan Nextcloud’s data directories, not remote storage, to update/sync the database.

Are you somewhat familiar with SQL? If so, you could try finding the record for this remote file in the table oc\_filecache and delete it manually. Warnings apply. Perhaps another forum member can suggest a better option!

PS: to increase your chances of getting help: don’t make it difficult for knowledgeable people to read your post. There is a lot of text that seems default (but not answered, all the “paste here”) template.

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/5_5575768a8748004e209b776fc1b2916d.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [January 15, 2025, 2:09pm UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/3 "2025-01-15T14:09:51Z")

</div>

> [@msg\_01](#):
>
> I want to delete a file on the Nextcloud web-userinterface , but I can’t, it says \>“Delete file” action failed

Please check your Nextcloud log. It should have hints about why this part is occurring.

> OCC::SyncFileItem::BlacklistedError and error: “Server hat “403 Forbidden” auf "GET XXX/o/remote.php/dav/files/admin\_owncloud\_Ba3RMRVvL82di9r/Steinberg\_Download\_Assistant\_1.35.0\_Installer\_win.exe

Are you forbidding any file types/names/extensions on either the client-side or server-side?

---

<div class="post-metadata">

**Author:** ![msg\_01](https://help.nextcloud.com/letter_avatar/msg_01/32/5_5575768a8748004e209b776fc1b2916d.png) [@msg\_01](https://help.nextcloud.com/u/msg_01)\
**Post date:** [January 15, 2025, 10:43pm UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/4 "2025-01-15T22:43:43Z")

</div>

Hello wbk, thank you so much for your advice, I already edited my request. It’s my first time here, so thank you!  
I can access the database but is it really save to delete the record of the file from there?

What do you mean by remote storage? I have my domain and webspace on a shared hoster and there I installed Nextcloud. All files are stored there on my webspace. I don’t connect from there to another cloud service like Dropbox etc.

---

<div class="post-metadata">

**Author:** ![msg\_01](https://help.nextcloud.com/letter_avatar/msg_01/32/5_5575768a8748004e209b776fc1b2916d.png) [@msg\_01](https://help.nextcloud.com/u/msg_01)\
**Post date:** [January 15, 2025, 11:02pm UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/5 "2025-01-15T23:02:08Z")

</div>

Thank you for your help.

I increased the log-level to 0 in config.php  
Now, which log you mean? When I go to XXX/index.php/settings/admin/logging there doesn’t seem to be anything related to my action trying to delete the file. Just this, but I think it’s not related:

Exception dirty table reads: SELECT \* FROM `*PREFIX*jobs` WHERE (`reserved_at` \<= :dcValue1) AND (`last_checked` \<= :dcValue2) AND (`time_sensitive` = :dcValue3) ORDER BY `last_checked` ASC LIMIT 1

> Are you forbidding any file types/names/extensions on either the client-side or server-side?  
> No, no that I know of…

I discovered that there are more files, that are present remotely on my webspace/Nextcloud when accessed via Web-Interface and not present on my laptop locally (client log gives again 403 error). When I try to delete these files remotely via Web-Interface there’s the same error.

Is this maybe related to these issues here, where there are orphaned entries? I couldn’t really understand the solution:

> <https://github.com/nextcloud/server/issues/43964>
>
> \### ⚠️ This issue respects the following points: ⚠️
> 
> \- \[X\] This is a \*\*bug\*\*, …not a question or a configuration/webserver/proxy issue.
> \- \[X\] This issue is \*\*not\*\* already reported on \[Github\](https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3Abug) OR \[Nextcloud Community Forum\](https://help.nextcloud.com/) \_(I've searched it)\_.
> \- \[X\] Nextcloud Server \*\*is\*\* up to date. See \[Maintenance and Release Schedule\](https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule) for supported versions.
> \- \[X\] I agree to follow Nextcloud's \[Code of Conduct\](https://nextcloud.com/contribute/code-of-conduct/).
> 
> \### Bug description
> 
> I have over 1.4M stale entries in my \`oc\_filecache\` table under just a single path \`files/DesktopHome\`:
> \`\`\`
> \# echo 'select count(\*) from oc\_filecache where storage = 1 and path like "files/DesktopHome/%";' | mysql -t nextclouddb
> +----------+
> | count(\*) |
> +----------+
> | 1450799 |
> +----------+     
> \`\`\`
> 
> Here is the \`oc\_storages\` table for reference:
> \`\`\`
> +---------------------------------+------------+-----------+--------------+
> | id | numeric\_id | available | last\_checked |
> +---------------------------------+------------+-----------+--------------+
> | home::brian | 1 | 1 | NULL |
> | local::/usr/src/owncloud/data/ | 2 | 1 | NULL |
> | home::jennifer | 3 | 1 | NULL |
> | home::brianm | 4 | 1 | NULL |
> | local::/var/lib/owncloud/data/ | 5 | 1 | NULL |
> | local::/var/lib/nextcloud/data/ | 6 | 1 | NULL |
> +---------------------------------+------------+-----------+--------------+
> \`\`\`
> 
> But under that path on the actual filesystem there is nothing:
> 
> \`\`\`
> \[root@server ~\]# ls -l /var/lib/nextcloud/data/brian/files/DesktopHome/
> total 0
> \`\`\`
> 
> And yet \`occ files:cleanup\` does nothing to clean that mess up:
> 
> \`\`\`
> \# sudo -u apache php /usr/share/nextcloud/occ files:cleanup
> 0 orphaned file cache entries deleted
> 0 orphaned mount entries deleted           
> \`\`\`
> 
> Additionally such file appear in the NC files app but when you try to download or get details on them you get errors about them being non-available. The server also logs:
> 
> \`\`\`
> Mar 3 11:14:41 server Nextcloud\[318606\]: {"reqId":"ZeSh8KYbHCAExqsm5DVOlQAAABg","level":3,"time":"2024-03-03T16:14:41+00:00","remoteAddr":"10.75.22.192","user":"brian","app":"webdav","method":"GET","url":"/remote.php/dav/files/brian/DesktopHome/3","message":"{\\"Exception\\":\\"Sabre\\\\\\\\DAV\\\\\\\\Exception\\\\\\\\ServiceUnavailable\\",\\"Message\\":\\"Could not open file\\",\\"Code\\":0,\\"Trace\\":\[{\\"file\\":\\"/usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php\\",\\"line\\":85,\\"function\\":\\"get\\",\\"class\\":\\"OCA\\\\\\\\DAV\\\\\\\\Connector\\\\\\\\Sabre\\\\\\\\File\\",\\"type\\":\\"-\>\\",\\"args\\":\[\]},{\\"file\\":\\"/usr/share/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php\\",\\"line\\":89,\\"function\\":\\"httpGet\\",\\"class\\":\\"Sabre\\\\\\\\DAV\\\\\\\\CorePlugin\\",\\"type\\":\\"-\>\\",\\"args\\":\[\[\\"Sabre\\\\\\\\HTTP\\\\\\\\Request\\"\],\[\\"Sabre\\\\\\\\HTTP\\\\\\\\Response\\"\]\]},{\\"file\\":\\"/usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php\\",\\"line\\":472,\\"function\\":\\"emit\\",\\"class\\":\\"Sabre\\\\\\\\DAV\\\\\\\\Server\\",\\"type\\":\\"-\>\\",\\"args\\":\[\\"method:GET\\",\[\[\\"Sabre\\\\\\\\HTTP\\\\\\\\Request\\"\],\[\\"Sabre\\\\\\\\HTTP\\\\\\\\Response\\"\]\]\]},{\\"file\\":\\"/usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php\\",\\"line\\":253,\\"function\\":\\"invokeMethod\\",\\"class\\":\\"Sabre\\\\\\\\DAV\\\\\\\\Server\\",\\"type\\":\\"-\>\\",\\"args\\":\[\[\\"Sabre\\\\\\\\HTTP\\\\\\\\Request\\"\],\[\\"Sabre\\\\\\\\HTTP\\\\\\\\Response\\"\]\]},{\\"file\\":\\"/usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php\\",\\"line\\":321,\\"function\\":\\"start\\",\\"class\\":\\"Sabre\\\\\\\\DAV\\\\\\\\Server\\",\\"type\\":\\"-\>\\",\\"args\\":\[\]},{\\"file\\":\\"/usr/share/nextcloud/apps/dav/lib/Server.php\\",\\"line\\":370,\\"function\\":\\"exec\\",\\"class\\":\\"Sabre\\\\\\\\DAV\\\\\\\\Server\\",\\"type\\":\\"-\>\\",\\"args\\":\[\]},{\\"file\\":\\"/usr/share/nextcloud/apps/dav/appinfo/v2/remote.php\\",\\"line\\":35,\\"function\\":\\"exec\\",\\"class\\":\\"OCA\\\\\\\\DAV\\\\\\\\Server\\",\\"type\\":\\"-\>\\",\\"args\\":\[\]},{\\"file\\":\\"/usr/share/nextcloud/remote.php\\",\\"line\\":172,\\"args\\":\[\\"/usr/share/nextcloud/apps/dav/appinfo/v2/remote.php\\"\],\\"function\\":\\"require\_once\\"}\],\\"File\\":\\"/usr/share/nextcloud/apps/dav/lib/Connector/Sabre/File.php\\",\\"Line\\":505,\\"message\\":\\"Could not open file\\",\\"exception\\":{},\\"CustomMessage\\":\\"Could not open file\\"}","userAgent":"Mozilla/5.0 (X11; Linux x86\_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","version":"28.0.2.5"}
> \`\`\`
> 
> \### Steps to reproduce
> 
> Probably pretty obvious give the description above.
> 
> \### Expected behavior
> 
> \`occ files:cleanup\` should remove those 1.4M or so stale \`oc\_filecache\` entries.
> 
> \### Installation method
> 
> Other Community project
> 
> \### Nextcloud Server version
> 
> 29
> 
> \### Operating system
> 
> RHEL/CentOS
> 
> \### PHP engine version
> 
> PHP 8.0
> 
> \### Web server
> 
> Apache (supported)
> 
> \### Database engine version
> 
> MariaDB
> 
> \### Is this bug present after an update or on a fresh install?
> 
> None
> 
> \### Are you using the Nextcloud Server Encryption module?
> 
> None
> 
> \### What user-backends are you using?
> 
> \- \[\] Default user-backend \_(database)\_
> \- \[\] LDAP/ Active Directory
> \- \[\] SSO - SAML
> \- \[\] Other
> 
> \### Configuration report
> 
> \`\`\`json
> {
> "system": {
> "log\_type": "syslog",
> "datadirectory": "\*\*\*REMOVED SENSITIVE VALUE\*\*\*",
> "updatechecker": false,
> "check\_for\_working\_htaccess": false,
> "asset-pipeline.enabled": false,
> "assetdirectory": "\\/var\\/lib\\/nextcloud",
> "preview\_libreoffice\_path": "\\/usr\\/bin\\/libreoffice",
> "apps\_paths": \[
> {
> "path": "\\/usr\\/share\\/nextcloud\\/apps",
> "url": "\\/apps",
> "writable": false
> },
> {
> "path": "\\/var\\/lib\\/nextcloud\\/apps",
> "url": "\\/apps-appstore",
> "writable": true
> }
> \],
> "instanceid": "\*\*\*REMOVED SENSITIVE VALUE\*\*\*",
> "passwordsalt": "\*\*\*REMOVED SENSITIVE VALUE\*\*\*",
> "secret": "\*\*\*REMOVED SENSITIVE VALUE\*\*\*",
> "trusted\_domains": \[
> "owncloud.example.com",
> "www.example.com"
> \],
> "overwrite.cli.url": "http:\\/\\/owncloud.example.com\\/",
> "dbtype": "mysql",
> "dbname": "\*\*\*REMOVED SENSITIVE VALUE\*\*\*",
> "dbhost": "\*\*\*REMOVED SENSITIVE VALUE\*\*\*",
> "dbuser": "\*\*\*REMOVED SENSITIVE VALUE\*\*\*",
> "dbpassword": "\*\*\*REMOVED SENSITIVE VALUE\*\*\*",
> "version": "29.0.0.19",
> "installed": true,
> "theme": "",
> "maintenance": false,
> "forcessl": false,
> "loglevel": 1,
> "log\_authfailip": true,
> "mail\_from\_address": "\*\*\*REMOVED SENSITIVE VALUE\*\*\*",
> "mail\_smtpmode": "smtp",
> "mail\_domain": "\*\*\*REMOVED SENSITIVE VALUE\*\*\*",
> "mail\_smtphost": "\*\*\*REMOVED SENSITIVE VALUE\*\*\*",
> "trashbin\_retention\_obligation": "auto",
> "htaccess.RewriteBase": "\\/",
> "appstore.experimental.enabled": true,
> "mysql.utf8mb4": true
> }
> }
> \`\`\`
> \### List of activated Apps
> 
> \`\`\`
> Enabled:
> - activity: 2.21.1
> - calendar: 4.7.3
> - circles: 29.0.0-dev
> - cloud\_federation\_api: 1.12.0
> - comments: 1.19.0
> - contacts: 6.0.0
> - contactsinteraction: 1.10.0
> - dashboard: 7.9.0
> - dav: 1.30.1
> - federatedfilesharing: 1.19.0
> - federation: 1.19.0
> - files: 2.1.0
> - files\_downloadlimit: 2.0.0
> - files\_pdfviewer: 2.10.0
> - files\_reminders: 1.2.0
> - files\_sharing: 1.21.0
> - files\_trashbin: 1.19.0
> - files\_versions: 1.22.0
> - firstrunwizard: 2.18.0
> - logreader: 2.14.0
> - lookup\_server\_connector: 1.17.0
> - nextcloud\_announcements: 1.18.0
> - notes: 4.10.0
> - notifications: 2.17.0
> - oauth2: 1.17.0
> - password\_policy: 1.19.0
> - photos: 2.5.0
> - privacy: 1.13.0
> - provisioning\_api: 1.19.0
> - recommendations: 2.1.0
> - related\_resources: 1.4.0
> - serverinfo: 1.19.0
> - settings: 1.12.0
> - sharebymail: 1.19.0
> - support: 1.12.0
> - survey\_client: 1.17.0
> - systemtags: 1.19.0
> - text: 3.10.0
> - theming: 2.4.0
> - twofactor\_backupcodes: 1.18.0
> - updatenotification: 1.19.1
> - user\_status: 1.9.0
> - viewer: 2.3.0
> - weather\_status: 1.9.0
> - workflowengine: 2.11.0
> Disabled:
> - admin\_audit: 1.19.0
> - bruteforcesettings: 2.9.0
> - encryption: 2.17.0
> - files\_external: 1.21.0
> - files\_rightclick: 0.15.1 (installed 1.6.0)
> - files\_texteditor: 2.15.1 (installed 2.15.1)
> - suspicious\_login: 7.0.0
> - twofactor\_totp: 11.0.0-dev
> - user\_ldap: 1.20.0 (installed 1.14.1)
> 
> \`\`\`
> 
> \### Nextcloud Signing status
> 
> \_No response\_
> 
> \### Nextcloud Logs
> 
> \_No response\_
> 
> \### Additional info
> 
> \_No response\_

> [@Oc\_filecache full of orphaned files -- how to remove fast and efficiently?](https://help.nextcloud.com/t/oc-filecache-full-of-orphaned-files-how-to-remove-fast-and-efficiently/184151):
>
> Nextcloud version (eg, 20.0.5): 28.0.2 Operating system and version (eg, Ubuntu 20.04): AlmaLinux 8.9 Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.37 PHP version (eg, 7.4): 8.0.30 The issue you are facing: I am seeing a constant spew of {"reqId":"EKkY7U5bTUvDriPxJba7","level":3,"time":"2024-02-25T08:36:13+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"file\_get\_contents(/var/lib/nextcloud/data/brian/files/DesktopHome/.wine.old/fake\_windows/users…

Thanks!

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/5_5575768a8748004e209b776fc1b2916d.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [January 15, 2025, 11:30pm UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/6 "2025-01-15T23:30:51Z")

</div>

Let’s try this a different way:

- Post your config as requested in the [support template](https://help.nextcloud.com/t/support-template-please-use-this-when-you-request-support/137402) 😉 - i.e. output of `occ config:list system`
- Set your log level to something reasonable for now (2 is the default; 0 is way too noisy unless we really end up in the weeds troubleshooting something).
- See what log entries pop up in your Nextcloud log while reproducing the problem

The `403 Forbidden` is coming from somewhere. The transaction is being blocked server-side for something likely related to a forbidden filename, anti-virus scanner, or any number of other ways to block files/connections.

Ideally also check your web server error log, since it’s possible something else weird is going on such as filtering at your web server level outside of Nextcloud.

---

<div class="post-metadata">

**Author:** ![wbk](https://help.nextcloud.com/letter_avatar/wbk/32/5_5575768a8748004e209b776fc1b2916d.png) [@wbk](https://help.nextcloud.com/u/wbk)\
**Post date:** [January 16, 2025, 8:02am UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/7 "2025-01-16T08:02:12Z")

</div>

Hi msg\_01

> [@msg\_01](#):
>
> What do you mean by remote storage?

I must have gotten distracted by “remote” in the thread title. “Remote storage” is functionality of Nextcloud to make files available that are not in Nextcloud, and seems not to be of concern in your case. Sorry for the noise 😉

edit to add:

> [@msg\_01](#):
>
> - Operating system and version (e.g., Ubuntu 24.04):
> - Shared Hosting Netcup Linux 5.10.0-32-amd64 x86\_64
> 
> - Installation method _(e.g. AlO, NCP, Bare Metal/Archive, etc.)_
> - Webinstall

Seeing ‘shared hosting’ (not VPS): do you have full control over your server? I’m not too familiar with installation options; ‘Webinstall’, is that [GitHub - nextcloud/web-installer: 💊 The web installer for Nextcloud](https://github.com/nextcloud/web-installer) ?

---

<div class="post-metadata">

**Author:** ![msg\_01](https://help.nextcloud.com/letter_avatar/msg_01/32/5_5575768a8748004e209b776fc1b2916d.png) [@msg\_01](https://help.nextcloud.com/u/msg_01)\
**Post date:** [January 16, 2025, 10:41am UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/8 "2025-01-16T10:41:16Z")

</div>

Yes, I am on a shared hoster (Netcup) and don’t have full access to the server, so no VPS. Yes, I used the Web-installer from the Nextcloud homepage - now it’s a little hidden under “Community Projects”.

---

<div class="post-metadata">

**Author:** ![msg\_01](https://help.nextcloud.com/letter_avatar/msg_01/32/5_5575768a8748004e209b776fc1b2916d.png) [@msg\_01](https://help.nextcloud.com/u/msg_01)\
**Post date:** [January 16, 2025, 11:12am UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/9 "2025-01-16T11:12:49Z")

</div>

> Post your config as requested in the [support template](https://help.nextcloud.com/t/support-template-please-use-this-when-you-request-support/137402) 😉 - i.e. output of `occ config:list system`

Sorry, added this info above in my initial post.

> Set your log level to something reasonable for now (2 is the default; 0 is way too noisy unless we really end up in the weeds troubleshooting something).  
> See what log entries pop up in your Nextcloud log while reproducing the problem.

Did that, unfortunately no log entries here: XXX/index.php/settings/admin/logging or shall I look elsewhere?

> The `403 Forbidden` is coming from somewhere. The transaction is being blocked server-side for something likely related to a forbidden filename, anti-virus scanner, or any number of other ways to block files/connections.  
> Ideally also check your web server error log, since it’s possible something else weird is going on such as filtering at your web server level outside of Nextcloud.

If it is a filtering issue, shouldn’t the same file types always be blocked? I have the problem with various file-types: \*.log, \*.exe, \*.cmd, \*.psd

**What I found out right now:** The error goes away, if I delete the directory in which the file is located. Unfortunately, I can’t do that with the root directory.

Doesn’t the 403 perhaps mean that the files are in the database, but not actually physically on the server? It it advisable to delete the file-entries from the database via PHPMyAdmin / SQL?

Unfortunately, I also keep getting error messages that my server memory is insufficient, perhaps the shared hosting is simply undersized? Is there anything I can do here to make Nextcloud less resource-hungry or do I need to upgrade my shared hosting?

[PHP] Error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 100667392 bytes) at /var/www/vhosts/XXXXXX/lib/public/AppFramework/Http/JSONResponse.php#71  
GET /XXXXX/index.php/apps/logreader/api/poll?lastReqId=groUcfWgbvVdJXdNCMwn  
from 2a02:3100:1de2:6000:31bc:4536:4aaa:6d9b by XXXXXXXX at 16.01.2025, 11:50:54

---

<div class="post-metadata">

**Author:** ![scubamuc](https://help.nextcloud.com/user_avatar/help.nextcloud.com/scubamuc/32/63165_2.png) [@scubamuc](https://help.nextcloud.com/u/scubamuc)\
**Post date:** [January 16, 2025, 11:24am UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/10 "2025-01-16T11:24:05Z")

</div>

> [@msg\_01](#):
>
> shared hosting is simply undersized?

most probably, ask the service provider

**Disable file locking in Nextcloud config file**

One way to fix the file is locked error is to disable the file locking feature in Nextcloud. This feature is meant to prevent concurrent access and conflicts on files, but it can also cause problems if the locks are not released properly. To disable file locking, you need to edit the Nextcloud config file.

- edit config.php line that says `'filelocking.enabled' => true,` and change it to `'filelocking.enabled' => false,`

This will disable the file locking feature in Nextcloud and you should be able to edit or delete your files without any error.

see also [How to fix: File is locked error?](https://help.nextcloud.com/t/how-to-fix-file-is-locked-error/180356)

---

<div class="post-metadata">

**Author:** ![Mornsgrans](https://help.nextcloud.com/user_avatar/help.nextcloud.com/mornsgrans/32/40386_2.png) [@Mornsgrans](https://help.nextcloud.com/u/Mornsgrans)\
**Post date:** [January 16, 2025, 1:05pm UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/11 "2025-01-16T13:05:58Z")

</div>

I assume, that the permissions of the file in the file system of the server may be wrong, that neither read nor write/delete is possible (f.ex. root root instead of www-data www-data).

---

<div class="post-metadata">

**Author:** ![msg\_01](https://help.nextcloud.com/letter_avatar/msg_01/32/5_5575768a8748004e209b776fc1b2916d.png) [@msg\_01](https://help.nextcloud.com/u/msg_01)\
**Post date:** [January 16, 2025, 3:33pm UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/12 "2025-01-16T15:33:18Z")

</div>

Can I change the permission of the file via FTP or will this break anything? What would be the right permission? Thank you!

---

<div class="post-metadata">

**Author:** ![msg\_01](https://help.nextcloud.com/letter_avatar/msg_01/32/5_5575768a8748004e209b776fc1b2916d.png) [@msg\_01](https://help.nextcloud.com/u/msg_01)\
**Post date:** [January 16, 2025, 3:34pm UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/13 "2025-01-16T15:34:14Z")

</div>

Thank you, I will try that. I already deleted all file-locks in the Database, that didn’t help. As I am accessing my Nextcloud from two computers sometimes, file locking isn’t a bad idea…

---

<div class="post-metadata">

**Author:** ![msg\_01](https://help.nextcloud.com/letter_avatar/msg_01/32/5_5575768a8748004e209b776fc1b2916d.png) [@msg\_01](https://help.nextcloud.com/u/msg_01)\
**Post date:** [January 17, 2025, 10:32pm UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/14 "2025-01-17T22:32:17Z")

</div>

I looked via FTP: Permissions were ok.

---

<div class="post-metadata">

**Author:** ![msg\_01](https://help.nextcloud.com/letter_avatar/msg_01/32/5_5575768a8748004e209b776fc1b2916d.png) [@msg\_01](https://help.nextcloud.com/u/msg_01)\
**Post date:** [January 17, 2025, 10:35pm UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/15 "2025-01-17T22:35:15Z")

</div>

I got rid of the problem by deleting the files that were not synchronizing via FTP on the server. Not a good or permanent solution, I am afraid that this problem will come back. I suspect that my shared hosting can’t cope when I upload serveral files at once. Is there any way to reduce the impact of Nextcloud on the shared hosting? I have only a couple of essentials apps installed, nothing fancy.

---

<div class="post-metadata">

**Author:** ![Hendrik](https://help.nextcloud.com/letter_avatar/hendrik/32/5_5575768a8748004e209b776fc1b2916d.png) [@Hendrik](https://help.nextcloud.com/u/Hendrik)\
**Post date:** [January 21, 2025, 8:41am UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/16 "2025-01-21T08:41:40Z")

</div>

It would be the amount of processors on the shared hosting so the process of uploading is not finished. Try to set the max execution time to 900 sec. And perhaps you should set the maxpost size to 1GB.

---

<div class="post-metadata">

**Author:** ![msg\_01](https://help.nextcloud.com/letter_avatar/msg_01/32/5_5575768a8748004e209b776fc1b2916d.png) [@msg\_01](https://help.nextcloud.com/u/msg_01)\
**Post date:** [January 21, 2025, 8:26pm UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/17 "2025-01-21T20:26:01Z")

</div>

I just looked here in the Nextcloud PHP Serverinfo and found the info, that the max execution time seems to be 900 sec:

Version: _8.2.25_

Memory limit: _512 MB_

Max execution time: _3600_

Upload max size: _128 MB_

OPcache Revalidate Frequency: _2_

Extensions: _Core, date, libxml, openssl, pcre, zlib, bcmath, bz2, calendar, ctype, dba, dom, hash, fileinfo, filter, ftp, gettext, gmp, json, iconv, SPL, session, mbstring, pcntl, standard, exif, Phar, posix, random, readline, Reflection, imap, shmop, SimpleXML, soap, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlwriter, zip, mysqlnd, cgi-fcgi, imagick, curl, gd, mysqli, PDO, pdo\_mysql, xsl, sqlite3, intl, sodium, ldap, tidy, pdo\_pgsql, pdo\_sqlite, igbinary, redis, ionCube Loader, Zend OPcache_

---

<div class="post-metadata">

**Author:** ![Tri\_Minh\_Ngo](https://help.nextcloud.com/user_avatar/help.nextcloud.com/tri_minh_ngo/32/69101_2.png) [@Tri\_Minh\_Ngo](https://help.nextcloud.com/u/Tri_Minh_Ngo)\
**Post date:** [February 13, 2025, 10:35am UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/18 "2025-02-13T10:35:53Z")

</div>

i think you check permission for this file. check rule in flows (Files access control).

---

<div class="post-metadata">

**Author:** ![msg\_01](https://help.nextcloud.com/letter_avatar/msg_01/32/5_5575768a8748004e209b776fc1b2916d.png) [@msg\_01](https://help.nextcloud.com/u/msg_01)\
**Post date:** [February 17, 2025, 10:19am UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/19 "2025-02-17T10:19:39Z")

</div>

Hm, I already checked the file’s permissions via FTP, nothing unusual… I think my server is just not “strong” enough for Nextcloud and then things get mixed up…

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [May 18, 2025, 10:19am UTC](https://help.nextcloud.com/t/cant-delete-file-locally-and-in-nextcloud-web-interface-file-is-present-on-database-and-remote-on-disk/214904/20 "2025-05-18T10:19:51Z")

</div>

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