[PHP] Error: unlink(/var/www/nextcloud/data/appdata_ocgfs89mpg4c/richdocuments/remoteData/capabilities): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#348

[/details]

Nextcloud version (eg, 29.0.5): 29.0.4
Operating system and version (eg, Ubuntu 24.04): Pop_OS 22.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.52
PHP version (eg, 8.3): 8.3.9

The issue you are facing:

[PHP] Error: unlink(/var/www/nextcloud/data/appdata_ocgfs89mpg4c/richdocuments/remoteData/capabilities): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#348
GET /ocs/v2.php/apps/notifications/api/v2/notifications?format=json

I’m getting multiple entries in logs for this error since version nc28.
Entries show IP of 2 different computers.

/var/www/nextcloud/data/appdata_ocgfs89mpg4c/richdocuments/remoteData/capabilities
and
/var/www/nextcloud/lib/private/Files/Storage/Local.php
do exist and appear to be valid.

I’ve tried clearing browser cache on both computers that get the error.

I’ve run the following at various times to try to find/fix the error:
occ maintenance:repair
occ files:cleanup
occ files:repair-tree
occ files:scan jim
occ files:scan-app-data
occ check
occ setupchecks

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

Steps to replicate it:

  1. check logs

The output of your Nextcloud log in Admin > Logging:

[PHP] Error: unlink(/var/www/nextcloud/data/appdata_ocgfs89mpg4c/richdocuments/remoteData/capabilities): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#348
	GET /ocs/v2.php/apps/notifications/api/v2/notifications?format=json

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

<?php
$CONFIG = array (
  'instanceid' => 'XXXXXXXXXXX',
  'passwordsalt' => 'XXXXXXXXXXX',
  'secret' => 'XXXXXXXXXXX',
  'trusted_domains' =>
  array (
    0 => 'XXXXXXXXXXX',
    1 => 'XXXXXXXXXXX',
  ),
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
    'timeout' => 1.5,
    'read_timeout' => 1.5,
    'dbindex' => 0,
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '29.0.4.1',
  'overwrite.cli.url' => 'https://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'XXXXXXXXXXX',
  'installed' => true,
  'memories.db.triggers.fcu' => true,
  'memories.exiftool' => '/var/www/nextcloud/apps/memories/bin-ext/exiftool-amd64-glibc',
  'memories.vod.path' => '/var/www/nextcloud/apps/memories/bin-ext/go-vod-amd64',
  'memories.vod.ffmpeg' => '/usr/bin/ffmpeg',
  'memories.vod.ffprobe' => '/usr/bin/ffprobe',
  'app_install_overwrite' =>
  array (
    0 => 'news',
  ),
  'htaccess.RewriteBase' => '/',
  'default_phone_region' => 'US',
  'maintenance_window_start' => 1,
  'default_locale' => 'en_US',
  'mail_from_address' => 'XXXXXXXXXXX',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'XXXXXXXXXXX',
  'mail_smtphost' => 'XXXXXXXXXXX',
  'mail_smtpport' => 'XXXXXXXXXXX',
  'mail_smtpauth' => '1',
  'mail_smtpname' => 'XXXXXXXXXXX',
  'mail_smtppassword' => 'XXXXXXXXXXX',
  'maintenance' => false,
  'memories.gis_type' => 1,
  'overwriteprotocol' => 'https',
  'trusted_proxies' =>
  array (
    0 => '127.0.0.1',
    1 => '::1',
  ),
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\Image',
    1 => 'OC\\Preview\\HEIC',
    2 => 'OC\\Preview\\TIFF',
    3 => 'OC\\Preview\\Movie',
  ),
  'preview_max_x' => 1024,
  'preview_max_y' => 1024,
  'memories.vod.disable' => false,
  'memories.vod.vaapi' => true,
  'memories.vod.use_transpose' => true,
  'updater.release.channel' => 'stable',
  'theme' => '',
  'loglevel' => 2,
  'debug' => false,
);

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

cat nextcloud_error.log
[Sat Jul 20 00:00:02.162235 2024] [proxy_fcgi:error] [pid 267772:tid 128630459991616] [client 127.0.0.1:52048] AH01071: Got error 'PHP message: PHP Warning:  http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:285) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 292'


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

{"reqId":"22OTaPLUHmCqkxxtLQjr","level":2,"time":"2024-07-20T10:35:11+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Host localhost was not connected to because it violates local access rules","userAgent":"--","version":"29.0.4.1","data":[]}
{"reqId":"2t9EEMUeg3gT7Hqf5Kps","level":2,"time":"2024-07-20T10:36:56+00:00","remoteAddr":"100.69.251.54","user":"jim","app":"suspicious_login","method":"PROPFIND","url":"/remote.php/dav/principals/users/jim/","message":"Could not predict suspiciousness: No models found","userAgent":"macOS/14.5 (23F79) dataaccessd/1.0","version":"29.0.4.1","data":{"app":"suspicious_login"}}
{"reqId":"oezME4tJmiDxcU9yfizj","level":2,"time":"2024-07-20T10:36:56+00:00","remoteAddr":"100.69.251.54","user":"jim","app":"suspicious_login","method":"OPTIONS","url":"/remote.php/dav/principals/users/jim/","message":"Could not predict suspiciousness: No models found","userAgent":"macOS/14.5 (23F79) dataaccessd/1.0","version":"29.0.4.1","data":{"app":"suspicious_login"}}
{"reqId":"100buz1EqJxrYInHxZDw","level":2,"time":"2024-07-20T10:43:21+00:00","remoteAddr":"100.105.163.64","user":"jim","app":"suspicious_login","method":"OPTIONS","url":"/remote.php/dav/principals/users/jim/","message":"Could not predict suspiciousness: No models found","userAgent":"iOS/17.5.1 (21F90) dataaccessd/1.0","version":"29.0.4.1","data":{"app":"suspicious_login"}}
{"reqId":"eMR2JLJP4U2cWE96xIdg","level":2,"time":"2024-07-20T10:43:22+00:00","remoteAddr":"100.105.163.64","user":"jim","app":"suspicious_login","method":"REPORT","url":"/remote.php/dav/addressbooks/users/jim/contacts/","message":"Could not predict suspiciousness: No models found","userAgent":"iOS/17.5.1 (21F90) dataaccessd/1.0","version":"29.0.4.1","data":{"app":"suspicious_login"}}
{"reqId":"AV6l0zLVSy6yHgsY1yUs","level":2,"time":"2024-07-20T10:43:22+00:00","remoteAddr":"100.105.163.64","user":"jim","app":"suspicious_login","method":"REPORT","url":"/remote.php/dav/addressbooks/users/jim/z-server-generated--system/","message":"Could not predict suspiciousness: No models found","userAgent":"iOS/17.5.1 (21F90) dataaccessd/1.0","version":"29.0.4.1","data":{"app":"suspicious_login"}}
{"reqId":"kBKjbMfLMyoe3U1svqPD","level":2,"time":"2024-07-20T10:43:23+00:00","remoteAddr":"100.105.163.64","user":"jim","app":"suspicious_login","method":"PROPFIND","url":"/remote.php/dav/addressbooks/users/jim/z-app-generated--contactsinteraction--recent/","message":"Could not predict suspiciousness: No models found","userAgent":"iOS/17.5.1 (21F90) dataaccessd/1.0","version":"29.0.4.1","data":{"app":"suspicious_login"}}
{"reqId":"jROvGVvJHP6TejSEd4Jp","level":2,"time":"2024-07-20T10:45:25+00:00","remoteAddr":"100.92.218.8","user":"jim","app":"suspicious_login","method":"OPTIONS","url":"/remote.php/dav/principals/users/jim/","message":"Could not predict suspiciousness: No models found","userAgent":"iOS/17.5.1 (21F90) dataaccessd/1.0","version":"29.0.4.1","data":{"app":"suspicious_login"}}
{"reqId":"aw2bTx0OlM7dcgpIENRg","level":2,"time":"2024-07-20T10:45:25+00:00","remoteAddr":"100.92.218.8","user":"jim","app":"suspicious_login","method":"REPORT","url":"/remote.php/dav/addressbooks/users/jim/contacts/","message":"Could not predict suspiciousness: No models found","userAgent":"iOS/17.5.1 (21F90) dataaccessd/1.0","version":"29.0.4.1","data":{"app":"suspicious_login"}}
{"reqId":"qky5UzHl1Q1RKDS55iiJ","level":2,"time":"2024-07-20T10:45:26+00:00","remoteAddr":"100.92.218.8","user":"jim","app":"suspicious_login","method":"REPORT","url":"/remote.php/dav/addressbooks/users/jim/z-server-generated--system/","message":"Could not predict suspiciousness: No models found","userAgent":"iOS/17.5.1 (21F90) dataaccessd/1.0","version":"29.0.4.1","data":{"app":"suspicious_login"}}
{"reqId":"6u0RCnC9eiqbXqCPhP4y","level":2,"time":"2024-07-20T10:45:26+00:00","remoteAddr":"100.92.218.8","user":"jim","app":"suspicious_login","method":"PROPFIND","url":"/remote.php/dav/addressbooks/users/jim/z-app-generated--contactsinteraction--recent/","message":"Could not predict suspiciousness: No models found","userAgent":"iOS/17.5.1 (21F90) dataaccessd/1.0","version":"29.0.4.1","data":{"app":"suspicious_login"}}
{"reqId":"HxqCJHonpZGIyMVmUO1q","level":3,"time":"2024-07-20T10:55:02+00:00","remoteAddr":"100.69.251.54","user":"jim","app":"PHP","method":"POST","url":"/apps/notify_push/pre_auth","message":"unlink(/var/www/nextcloud/data/appdata_ocgfs89mpg4c/richdocuments/remoteData/capabilities): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#348","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36","version":"29.0.4.1","data":{"app":"PHP"}}
{"reqId":"YqQRA5IUEa1S11OqZgqB","level":2,"time":"2024-07-20T10:58:53+00:00","remoteAddr":"100.105.163.64","user":"jim","app":"suspicious_login","method":"OPTIONS","url":"/remote.php/dav/principals/users/jim/","message":"Could not predict suspiciousness: No models found","userAgent":"iOS/17.5.1 (21F90) dataaccessd/1.0","version":"29.0.4.1","data":{"app":"suspicious_login"}}
{"reqId":"HJ0H6BbgRGoApQ2pweh8","level":2,"time":"2024-07-20T10:58:54+00:00","remoteAddr":"100.105.163.64","user":"jim","app":"suspicious_login","method":"REPORT","url":"/remote.php/dav/addressbooks/users/jim/contacts/","message":"Could not predict suspiciousness: No models found","userAgent":"iOS/17.5.1 (21F90) dataaccessd/1.0","version":"29.0.4.1","data":{"app":"suspicious_login"}}
{"reqId":"ahXynKLRl905Si7ZQWAy","level":2,"time":"2024-07-20T10:58:54+00:00","remoteAddr":"100.105.163.64","user":"jim","app":"suspicious_login","method":"REPORT","url":"/remote.php/dav/addressbooks/users/jim/z-server-generated--system/","message":"Could not predict suspiciousness: No models found","userAgent":"iOS/17.5.1 (21F90) dataaccessd/1.0","version":"29.0.4.1","data":{"app":"suspicious_login"}}
{"reqId":"7lYlTwRemHLHX2iDeUTr","level":2,"time":"2024-07-20T10:58:55+00:00","remoteAddr":"100.105.163.64","user":"jim","app":"suspicious_login","method":"PROPFIND","url":"/remote.php/dav/addressbooks/users/jim/z-app-generated--contactsinteraction--recent/","message":"Could not predict suspiciousness: No models found","userAgent":"iOS/17.5.1 (21F90) dataaccessd/1.0","version":"29.0.4.1","data":{"app":"suspicious_login"}}
{"reqId":"M4kbLSeSgnmZFc6gzMl2","level":4,"time":"2024-07-20T11:00:04+00:00","remoteAddr":"100.69.251.54","user":"jim","app":"no app in context","method":"GET","url":"/apps/serverinfo/update","message":"Could not boot richdocuments: /appdata_ocgfs89mpg4c/richdocuments/remoteData/discovery","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36","version":"29.0.4.1","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"/appdata_ocgfs89mpg4c/richdocuments/remoteData/discovery","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":135,"function":"get","class":"OC\\Files\\Node\\Root","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php","line":75,"function":"get","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/richdocuments/lib/Service/CachedRequestService.php","line":89,"function":"getFile","class":"OC\\Files\\SimpleFS\\SimpleFolder","type":"->"},{"file":"/var/www/nextcloud/apps/richdocuments/lib/AppInfo/Application.php","line":206,"function":"resetCache","class":"OCA\\Richdocuments\\Service\\CachedRequestService","type":"->"},{"file":"/var/www/nextcloud/apps/richdocuments/lib/AppInfo/Application.php","line":165,"function":"checkAndEnableCODEServer","class":"OCA\\Richdocuments\\AppInfo\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":200,"function":"boot","class":"OCA\\Richdocuments\\AppInfo\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":437,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":216,"function":"loadApp","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":128,"function":"loadApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":1030,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Root.php","Line":212,"message":"Could not boot richdocuments: /appdata_ocgfs89mpg4c/richdocuments/remoteData/discovery","exception":{},"CustomMessage":"Could not boot richdocuments: /appdata_ocgfs89mpg4c/richdocuments/remoteData/discovery"}}
{"reqId":"4cEX5VTdyCBNkwhHv3DD","level":2,"time":"2024-07-20T11:00:31+00:00","remoteAddr":"100.100.234.145","user":"jim","app":"suspicious_login","method":"OPTIONS","url":"/remote.php/dav/principals/users/jim/","message":"Could not predict suspiciousness: No models found","userAgent":"macOS/14.5 (23F79) AddressBookCore/2571.3","version":"29.0.4.1","data":{"app":"suspicious_login"}}

3 Likes

Same issue :sob: But I found no solution at the moment and need help also. If I find a solution, I will inform you.

2 Likes

What’s the underlying filesystem?

Also, any symbolic links involved?

ext4 and neither file in the error is a symbolic link

1 Like

:thinking: These errors are likely due the new fallback code introduced recently in richdocuments (Nextcloud Office).

But the weirdest part is we don’t even try remove (unlink) them unless we already have confirmed they exist. So not sure why a couple of you are seeing this happen in your environments, but not others.

It’s not clear how to reproduce this (I can’t so far).

What are the date/times on the capabilities and discovery files located in your /appdata_{instanceid}/richdocuments/ folders? Are they recent?

Also, which CO/CODE are you using (Built-in or separate instance)?

capabilities has been updated as of today
Local.php last updated on the 18th:

Jul 22 10:30 capabilities
Jul 18 11:33 Local.php

CO is built-in, currently version 24.4.502

1 Like

Everything is updated for me too. I even uninstalled and reinstalled Nextcloud Office and Collabora Online - Built-in CODE Server (ARM64). No improvement and same error message.

I even get a fatal error

NotFoundException
/appdata_oc3onsqf2o5z/richdocuments/remoteData/capabilities
Could not boot richdocuments: /appdata_oc3onsqf2o5z/richdocuments/remoteData/capabilities

I’ve uninstalled and reinstalled CO as well. AMD64

I have this issue as well and it’s funny I never had it before 29.0.3, and I updated to 29.0.4 today hoping it would fix and same deal.

Googling it looks like this has been an issue before, and most of the forum posts are like this one with a dead end.

I should add that everything SEEMS to be working just fine, I can access all my documents and sheets without issue, just everyday I have like 500 of these entries in my log.

1 Like

have an update I found interesting and a bit perplexing…
on July 20th I noticed that the “suspicious login” app was generating a huge amount of entries in my logs, so much so that if I were to set the web interface to view all of them, it would crash.
Being as how I’m just a home user with one account in my NC instance and was just testing “suspicious login” I decided to delete it from my NC.
Here’s the interesting and perplexing part…
since deleting “suspicious login” I have not had the ‘[PHP] Error: unlink(/var/www/nextcloud/data/appdata_ocgfs89mpg4c/richdocuments/remoteData/capabilities): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#348’
Since “suspicious login” has nothing to do with CO, I’m not sure what to make of this. Coincidence? The huge amount of logs somehow causing an issue with CO? Something completely different?

I am experiencing the same issue.
Data is on a NFS share and I also use built in CODE.
But I am not running “suspicious login”.

Since I don’t know what triggers the logs, I could imagine that disabling it for you @KwisatzJim was just correlation but not causation :slight_smile:

Happy to provide further information that can help track down the issue.

Do we have a gh issue yet?

1 Like

I am not doing anything fancy and I too am not running “suspicious login” My install is local and I too am just a home user.

It has been inconsistent, as I haven’t cleared my logs since I posted 3 days ago and I have 300 log entries. Where in the same amount of time I had over 1000 last time I checked.

I know none of this really helps. I use the office stuff a lot so for now I just have to live with it and clear my logs as a cron job lol

1 Like

finally got another related entry in my logs:

[PHP] Error: unlink(/var/www/nextcloud/data/appdata_ocgfs89mpg4c/richdocuments/remoteData/discovery): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#348
GET /ocs/v2.php/apps/user_status/api/v1/user_status?format=json
from 100.110.195.24 by jim at Aug 2, 2024, 11:18:28 AM

and one a bit later, here’s the raw entry:

{“reqId”:“JjVpXW39xm3omTjssBz6”,“level”:3,“time”:“2024-08-02T16:18:28+00:00”,“remoteAddr”:“100.110.195.24”,“user”:“jim”,“app”:“PHP”,“method”:“GET”,“url”:“/ocs/v2.php/apps/user_status/api/v1/user_status?format=json”,“message”:“unlink(/var/www/nextcloud/data/appdata_ocgfs89mpg4c/richdocuments/remoteData/discovery): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#348”,“userAgent”:“Mozilla/5.0 (Linux) mirall/3.4.2-1ubuntu1 (Nextcloud, pop-6.9.3-76060903-generic ClientArchitecture: x86_64 OsArchitecture: x86_64)”,“version”:“29.0.4.1”,“data”:{“app”:“PHP”},“id”:“66ae02d15b2f9”}

and scrolling back through I see a few more. [I just woke up, sloooowwwllly sipping coffee and scrolling through logs to start my day :yawning_face:]

found several other kinds of errors, not unlink errors, but still richodcuments related. here’s one:

[no app in context] Fatal: Could not boot richdocuments: /appdata_ocgfs89mpg4c/richdocuments/remoteData/capabilities
GET /ocs/v2.php/apps/user_status/api/v1/user_status?format=json
from 100.100.234.145 by jim at Aug 2, 2024, 10:40:28 AM

but now that I think about it, I think there was maintenance being done by my internet providor around this time, so maybe that explains some of these during the same time?

I doubt that is was your internet connection, since I get similar errors

[PHP] error: unlink(/mnt/nextcloud/data/appdata_ocyao8xfftvv/richdocuments/remoteData/discovery): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#348
GET /index.phps/api/v1/stats
von ip von user um 31.07.2024, 10:25:05

and also

[index] error: Exception thrown: OCP\Files\NotFoundException
GET /index.phpndar/public/getCalendarDotSvg/%23BC5C91.svg
von ip von user um 04.08.2024, 15:11:23

@KwisatzJim Did you find any solution for this? Otherwise I will open up a GH issue.

I haven’t yet. Still getting the errors

thanks!

1 Like

Hey all posters,

please add your valuable input to GitHub issue. Thx.

Closing here and we will stay with GH issue.

1 Like

This topic was automatically closed after 35 hours. New replies are no longer allowed.