nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.91k stars 4.02k forks source link

[Bug]: nextcloud 26.0.1 [core] Error: OCP\Files\NotFoundException: /appdata_ocxqb3l0vb1a/theming/global a #38114

Open parided opened 1 year ago

parided commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Bug description

login as administrator and in the log section, it report to me:

[core] Error: OCP\Files\NotFoundException: /appdata_ocxqb3l0vb1a/theming/global at <>

<>
OC\Files\Node\Root->get()
/var/www/nextcloud/lib/private/Files/Node/LazyFolder.php line 72
call_user_func_array()
/var/www/nextcloud/lib/private/Files/Node/LazyFolder.php line 149
OC\Files\Node\LazyFolder->__call()
/var/www/nextcloud/lib/private/Files/AppData/AppData.php line 132
OC\Files\Node\LazyFolder->get()
/var/www/nextcloud/apps/theming/lib/Jobs/MigrateBackgroundImages.php line 168
OC\Files\AppData\AppData->getFolder()
/var/www/nextcloud/apps/theming/lib/Jobs/MigrateBackgroundImages.php line 100
OCA\Theming\Jobs\MigrateBackgroundImages->storeUserIdsToProcess()
/var/www/nextcloud/apps/theming/lib/Jobs/MigrateBackgroundImages.php line 79
OCA\Theming\Jobs\MigrateBackgroundImages->runPreparation()
/var/www/nextcloud/lib/public/BackgroundJob/Job.php line 78
OCA\Theming\Jobs\MigrateBackgroundImages->run()
/var/www/nextcloud/lib/public/BackgroundJob/QueuedJob.php line 57
OCP\BackgroundJob\Job->start()
/var/www/nextcloud/lib/public/BackgroundJob/QueuedJob.php line 47
OCP\BackgroundJob\QueuedJob->start()
/var/www/nextcloud/cron.php line 152
OCP\BackgroundJob\QueuedJob->execute()

Steps to reproduce

1.install nextcloud 26.0.1 2.login as admin user 3.read lon from nextcloud

Expected behavior

expect no error

Installation method

Community Manual installation with Archive

Nextcloud Server version

26

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "192.168.0.215",
            "speriamo.dedyn.io",
            "xx.241.xx.62"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "26.0.1.1",
        "overwrite.cli.url": "https:\/\/speriamo.dedyn.io",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "upgrade.disable-web": true,
        "log_type": "file",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "loglevel": "2",
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "mail_smtpmode": "smtp",
        "remember_login_cookie_lifetime": "1800",
        "log_rotate_size": "10485760",
        "trashbin_retention_obligation": "auto, 60",
        "versions_retention_obligation": "auto, 180",
        "activity_expire_days": "120",
        "simpleSignUpLink.shown": false,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": true,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0.5,
            "dbindex": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "default_phone_region": "it",
        "logtimezone": "Europe\/Rome",
        "htaccess.RewriteBase": "\/",
        "preview_concurrency_new": "4",
        "preview_concurrency_all": "8",
        "maintenance": false
    }
}

root@speriamo:/var/www/nextcloud# php occ config:list system
Console has to be executed with the user that owns the file config/config.php
Current user id: 0
Owner id of config.php: 33
Try adding 'sudo -u #33' to the beginning of the command (without the single quotes)
If running with 'docker exec' try adding the option '-u 33' to the docker command (without the single quotes)

root@speriamo:/var/www/nextcloud# ./occ config:list system
Console has to be executed with the user that owns the file config/config.php
Current user id: 0
Owner id of config.php: 33
Try adding 'sudo -u #33' to the beginning of the command (without the single quotes)
If running with 'docker exec' try adding the option '-u 33' to the docker command (without the single quotes)

List of activated Apps

root@speriamo:/var/www/nextcloud# sudo -u www-data php occ app:list
Enabled:
  - activity: 2.18.0
  - admin_audit: 1.16.0
  - calendar: 4.3.3
  - circles: 26.0.0
  - cloud_federation_api: 1.9.0
  - collectives: 2.4.0
  - comments: 1.16.0
  - contacts: 5.2.0
  - contactsinteraction: 1.7.0
  - dashboard: 7.6.0
  - dav: 1.25.0
  - deck: 1.9.0
  - federatedfilesharing: 1.16.0
  - federation: 1.16.0
  - files: 1.21.1
  - files_pdfviewer: 2.7.0
  - files_rightclick: 1.5.0
  - files_sharing: 1.18.0
  - files_trashbin: 1.16.0
  - files_versions: 1.19.1
  - firstrunwizard: 2.15.0
  - groupfolders: 14.0.2
  - issuetemplate: 0.7.0
  - logreader: 2.11.0
  - lookup_server_connector: 1.14.0
  - mail: 3.1.1
  - nextcloud_announcements: 1.15.0
  - notifications: 2.14.0
  - oauth2: 1.14.0
  - password_policy: 1.16.0
  - photos: 2.2.0
  - privacy: 1.10.0
  - provisioning_api: 1.16.0
  - recommendations: 1.5.0
  - related_resources: 1.1.0-alpha1
  - serverinfo: 1.16.0
  - settings: 1.8.0
  - sharebymail: 1.16.0
  - support: 1.9.0
  - survey_client: 1.14.0
  - systemtags: 1.16.0
  - text: 3.7.2
  - theming: 2.1.1
  - twofactor_backupcodes: 1.15.0
  - updatenotification: 1.16.0
  - user_status: 1.6.0
  - viewer: 1.10.0
  - weather_status: 1.6.0
  - workflowengine: 2.8.0
Disabled:
  - bruteforcesettings: 2.6.0
  - encryption: 2.14.0
  - extract: 1.3.5
  - files_external: 1.18.0
  - suspicious_login: 4.4.0
  - twofactor_totp: 8.0.0-alpha.0
  - user_ldap: 1.16.0

root@speriamo:/var/www/nextcloud# php occ app:list
Console has to be executed with the user that owns the file config/config.php
Current user id: 0
Owner id of config.php: 33
Try adding 'sudo -u #33' to the beginning of the command (without the single quotes)
If running with 'docker exec' try adding the option '-u 33' to the docker command (without the single quotes)

root@speriamo:/var/www/nextcloud# ./occ app:list
Console has to be executed with the user that owns the file config/config.php
Current user id: 0
Owner id of config.php: 33
Try adding 'sudo -u #33' to the beginning of the command (without the single quotes)
If running with 'docker exec' try adding the option '-u 33' to the docker command (without the single quotes)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

root@speriamo:~# find / -name nextcloud.log
/var/log/nextcloud/nextcloud.log
root@speriamo:~# 

root@speriamo:~# more /var/log/nextcloud/nextcloud.log 
{"reqId":"awHZrOA2jdYQdV2WKLXK","level":3,"time":"2023-05-06T00:05:02+02:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job (cl
ass: OCA\\Theming\\Jobs\\MigrateBackgroundImages, arguments: Array\n(\n    [stage] => prepare\n)\n)","userAgent":"--","version":"26.0.1.1","exception":{"Exception":"OCP\\Files\\NotFoundExcep
tion","Message":"/appdata_ocxqb3l0vb1a/theming/global","Code":0,"Trace":[{"function":"get","class":"OC\\Files\\Node\\Root","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/Laz
yFolder.php","line":72,"function":"call_user_func_array"},{"file":"/var/www/nextcloud/lib/private/Files/Node/LazyFolder.php","line":149,"function":"__call","class":"OC\\Files\\Node\\LazyFold
er","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/AppData/AppData.php","line":132,"function":"get","class":"OC\\Files\\Node\\LazyFolder","type":"->"},{"file":"/var/www/nextcloud
/apps/theming/lib/Jobs/MigrateBackgroundImages.php","line":168,"function":"getFolder","class":"OC\\Files\\AppData\\AppData","type":"->"},{"file":"/var/www/nextcloud/apps/theming/lib/Jobs/Mig
rateBackgroundImages.php","line":100,"function":"storeUserIdsToProcess","class":"OCA\\Theming\\Jobs\\MigrateBackgroundImages","type":"->"},{"file":"/var/www/nextcloud/apps/theming/lib/Jobs/M
igrateBackgroundImages.php","line":79,"function":"runPreparation","class":"OCA\\Theming\\Jobs\\MigrateBackgroundImages","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.
php","line":78,"function":"run","class":"OCA\\Theming\\Jobs\\MigrateBackgroundImages","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/QueuedJob.php","line":57,"function":"s
tart","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/QueuedJob.php","line":47,"function":"start","class":"OCP\\BackgroundJob\\QueuedJob",
"type":"->"},{"file":"/var/www/nextcloud/cron.php","line":152,"function":"execute","class":"OCP\\BackgroundJob\\QueuedJob","type":"->"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Roo
t.php","Line":209,"message":"Error while running background job (class: OCA\\Theming\\Jobs\\MigrateBackgroundImages, arguments: Array\n(\n    [stage] => prepare\n)\n)","exception":{},"Custom
Message":"Error while running background job (class: OCA\\Theming\\Jobs\\MigrateBackgroundImages, arguments: Array\n(\n    [stage] => prepare\n)\n)"}}

Additional info

No response

joshtrichards commented 1 year ago

Can you confirm whether the folder /var/www/html/data/appdata_*/theming/ exists?

Also, what are the file permissions and ownership on:

Are things functioning reasonably otherwise?

parided commented 1 year ago

root@speriamo:/var# find ./ -name theming ./www/nextcloud/apps/theming

'datadirectory' => '/mnt/ncdata',

root@speriamo:/# find ./ -name appdata_* ./mnt/ncdata/appdata_ocxqb3l0vb1a

root@speriamo:/# find / -name theming /var/www/nextcloud/apps/theming /mnt/ncdata/appdata_ocxqb3l0vb1a/theming

"Are things functioning reasonably otherwise?" I don't understand what you mean. I encountered this error and since I have to update a production system, I want to be sure that everything works as it should, since they work purely with the client by synchronizing a directory on their desktop

that's all

I installed nextcloud 26.0.1, using vm script nextcloud_install_production.sh

parided commented 1 year ago

root@sysbox2:~# ll /var/www/nextcloud/apps/theming total 40 drwxr-x--- 10 www-data www-data 4096 Apr 19 17:42 ./ drwxr-x--- 52 www-data www-data 4096 May 10 09:53 ../ drwxr-x--- 2 www-data www-data 4096 Apr 19 17:43 appinfo/ drwxr-x--- 2 www-data www-data 4096 Apr 19 17:38 css/ drwxr-x--- 2 www-data www-data 4096 Apr 19 17:38 fonts/ drwxr-x--- 3 www-data www-data 4096 Apr 19 17:38 img/ drwxr-x--- 2 www-data www-data 4096 Apr 19 17:38 js/ drwxr-x--- 2 www-data www-data 4096 Apr 19 17:42 l10n/ drwxr-x--- 11 www-data www-data 4096 Apr 19 17:38 lib/ drwxr-x--- 2 www-data www-data 4096 Apr 19 17:38 templates/

drwxr-xr-x 8 www-data www-data 4096 May 8 16:29 appdata_

root@sysbox2:~# ll /mnt/ncdata/appdata_*/theming total 12 drwxr-xr-x 3 www-data www-data 4096 May 8 16:29 ./ drwxr-xr-x 8 www-data www-data 4096 May 8 16:29 ../ drwxr-xr-x 3 www-data www-data 4096 May 8 16:43 global/

joshtrichards commented 1 year ago

Was this a one-off error just after installation or are you seeing similar (new) log messages generated repeatedly?

Running ./occ files:scan-app-data from the command-line might address the issue. Though the root cause is another matter.

parided commented 1 year ago

I see similar log messages being generated repeatedly. Now it's been a few days that nextcloud writes this in the logs.

[index] Errore: TypeError: OCA\Files\Service\TagService::__construct(): Argument #4 ($homeFolder) must be of type OCP\Files\Folder, null given, called in /var/www/nextcloud/apps/files/lib/AppInfo/Application.php on line 111 at <>

  1. /var/www/nextcloud/apps/files/lib/AppInfo/Application.php line 111 OCA\Files\Service\TagService->__construct()
  2. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 171 OCA\Files\AppInfo\Application->OCA\Files\AppInfo{closure}(" sensitive parameters replaced ")
  3. /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php line 122 OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(" sensitive parameters replaced ")
  4. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 138 Pimple\Container->offsetGet()
  5. /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php line 487 OC\AppFramework\Utility\SimpleContainer->query()
  6. /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php line 465 OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
  7. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 65 OC\AppFramework\DependencyInjection\DIContainer->query()
  8. /var/www/nextcloud/apps/files/lib/AppInfo/Application.php line 90 OC\AppFramework\Utility\SimpleContainer->get()
  9. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 171 OCA\Files\AppInfo\Application->OCA\Files\AppInfo{closure}(" sensitive parameters replaced ")
  10. /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php line 122 OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}(" sensitive parameters replaced ")
    1. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 138 Pimple\Container->offsetGet()
    2. /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php line 487 OC\AppFramework\Utility\SimpleContainer->query()
    3. /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php line 465 OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
    4. /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php line 65 OC\AppFramework\DependencyInjection\DIContainer->query()
    5. /var/www/nextcloud/lib/private/AppFramework/App.php line 148 OC\AppFramework\Utility\SimpleContainer->get()
    6. /var/www/nextcloud/lib/private/Route/Router.php line 315 OC\AppFramework\App::main()
    7. /var/www/nextcloud/lib/base.php line 1055 OC\Route\Router->match()
    8. /var/www/nextcloud/index.php line 36 OC::handleRequest()

GET /apps/files/api/v1/stats from 151.84.70.186 at 2023-05-16T09:05:18+02:00

parided commented 1 year ago

Any other suggestions on what to see?

loelkes commented 7 months ago

@parided I see that it wants to access /appdata_ocxqb3l0vb1a/theming/global and not /mnt/ncdata/appdata_ocxqb3l0vb1a/theming/global

Looks very similar to #43218 and #42509

MrRinkana commented 4 months ago

I get these errors with photo previews /appdata_ocfipsbj1v0e/preview/c/e/6/5/3/0/1/9063 and similar. I'm on 28.0.5.1, but got them on earlier versions as well.

Should I open a new issue about it or keep it here? If I'm to keep it here maybe the title should be updated to not be nc 26 specific, and add feature:previews aswell..

An example error: ```json { "reqId": "0H4oL7oOAdwuPW8eFjUd", "level": 3, "time": "2024-05-06T21:19:53+00:00", "remoteAddr": "xxx.xxx.xxx.xxx", "user": "Auser", "app": "index", "method": "GET", "url": "/apps/photos/api/v1/preview/9063?etag=baca60313ec33e4dba2eb8ddabbb225c&x=512&y=512", "message": "Could not create folder \"/appdata_ocfipsbj1v0e/preview/c/e/6/5/3/0/1/9063\"", "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0", "version": "28.0.5.1", "exception": { "Exception": "OCP\\Files\\NotPermittedException", "Message": "Could not create folder \"/appdata_ocfipsbj1v0e/preview/c/e/6/5/3/0/1/9063\"", "Code": 0, "Trace": [ { "file": "/srv/www/nextcloud/lib/private/Files/AppData/AppData.php", "line": 147, "function": "newFolder", "class": "OC\\Files\\Node\\Folder", "type": "->" }, { "file": "/srv/www/nextcloud/lib/private/Preview/Storage/Root.php", "line": 74, "function": "newFolder", "class": "OC\\Files\\AppData\\AppData", "type": "->" }, { "file": "/srv/www/nextcloud/lib/private/Preview/Generator.php", "line": 607, "function": "newFolder", "class": "OC\\Preview\\Storage\\Root", "type": "->" }, { "file": "/srv/www/nextcloud/lib/private/Preview/Generator.php", "line": 133, "function": "getPreviewFolder", "class": "OC\\Preview\\Generator", "type": "->" }, { "file": "/srv/www/nextcloud/lib/private/Preview/Generator.php", "line": 110, "function": "generatePreviews", "class": "OC\\Preview\\Generator", "type": "->" }, { "file": "/srv/www/nextcloud/lib/private/PreviewManager.php", "line": 187, "function": "getPreview", "class": "OC\\Preview\\Generator", "type": "->" }, { "file": "/srv/www/nextcloud/apps/photos/lib/Controller/PreviewController.php", "line": 178, "function": "getPreview", "class": "OC\\PreviewManager", "type": "->" }, { "file": "/srv/www/nextcloud/apps/photos/lib/Controller/PreviewController.php", "line": 144, "function": "fetchPreview", "class": "OCA\\Photos\\Controller\\PreviewController", "type": "->" }, { "file": "/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line": 230, "function": "index", "class": "OCA\\Photos\\Controller\\PreviewController", "type": "->" }, { "file": "/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line": 137, "function": "executeController", "class": "OC\\AppFramework\\Http\\Dispatcher", "type": "->" }, { "file": "/srv/www/nextcloud/lib/private/AppFramework/App.php", "line": 184, "function": "dispatch", "class": "OC\\AppFramework\\Http\\Dispatcher", "type": "->" }, { "file": "/srv/www/nextcloud/lib/private/Route/Router.php", "line": 315, "function": "main", "class": "OC\\AppFramework\\App", "type": "::" }, { "file": "/srv/www/nextcloud/lib/base.php", "line": 1069, "function": "match", "class": "OC\\Route\\Router", "type": "->" }, { "file": "/srv/www/nextcloud/index.php", "line": 39, "function": "handleRequest", "class": "OC", "type": "::" } ], "File": "/srv/www/nextcloud/lib/private/Files/Node/Folder.php", "Line": 162, "message": "Could not create folder \"/appdata_ocfipsbj1v0e/preview/c/e/6/5/3/0/1/9063\"", "exception": [], "CustomMessage": "Could not create folder \"/appdata_ocfipsbj1v0e/preview/c/e/6/5/3/0/1/9063\"" }, "id": "664da9691f30b" } ```

I have gotten quite a few of these, but they are not spammed constantly.