Trigger files scan without occ web app in TrueNAS Scale container? (Can't write to External Storage)

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): 29
Operating system and version (eg, Ubuntu 20.04): TrueNAS-SCALE-23.10.1.1
Apache or nginx version (eg, Apache 2.4.25): don’t know where to find
PHP version (eg, 7.4): don’t know where to find

The issue you are facing:

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

Steps to replicate it:

  1. When i go to NextCloud web / phone app and login, it shows nothing under Files
  2. Can see some of the content when i click on Photos or go into the SMB share, i see some data. The create folder option is grayed out too

The output of your Nextcloud log in Admin > Logging: (this is part of the log, browser crashes if I try to paste entire log file (incl. pastebin)

"reqId":"Q4uH9vZddmBQB2L2Hnnh","level":3,"time":"2024-03-19T03:25:58+00:00","remoteAddr":"192.168.41.123","user":"admin","app":"index","method":"GET","url":"/core/preview?c=1ea09708119834b5e13388ae0e22a429&fileId=47&x=256&y=256","message":"Could not get appdata folder for preview","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0","version":"28.0.3.2","exception":{"Exception":"RuntimeException","Message":"Could not get appdata folder for preview","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/AppData/AppData.php","line":147,"function":"getAppDataFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":[]},{"file":"/var/www/html/lib/private/Preview/Storage/Root.php","line":74,"function":"newFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":["6/7/c/6/a/1/e/47"]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":607,"function":"newFolder","class":"OC\\Preview\\Storage\\Root","type":"->","args":["47"]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":133,"function":"getPreviewFolder","class":"OC\\Preview\\Generator","type":"->","args":[["OC\\Files\\Node\\File"]]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":110,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->","args":[["OC\\Files\\Node\\File"],[[256,256,true,"fill"]],"image/jpeg"]},{"file":"/var/www/html/lib/private/PreviewManager.php","line":187,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->","args":[["OC\\Files\\Node\\File"],256,256,true,"fill",null]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":173,"function":"getPreview","class":"OC\\PreviewManager","type":"->","args":[["OC\\Files\\Node\\File"],256,256,true,"fill"]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":141,"function":"fetchPreview","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[["OC\\Files\\Node\\File"],256,256,false,true,"fill",false]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getPreviewByFileId","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[47,256,256,false,true,"fill",false]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OC\\Core\\Controller\\PreviewController"],"getPreviewByFileId"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OC\\Core\\Controller\\PreviewController"],"getPreviewByFileId"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\PreviewController","getPreviewByFileId",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["core.Preview.getPreviewByFileId"]]},{"file":"/var/www/html/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/core/preview"]},{"file":"/var/www/html/index.php","line":39,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Files/AppData/AppData.php","Line":108,"message":"Could not get appdata folder for preview","exception":{},"CustomMessage":"Could not get appdata folder for preview"}}
{"reqId":"6EcwdPPBBSvRRPIH28i0","level":3,"time":"2024-03-19T03:36:10+00:00","remoteAddr":"::1","user":"admin","app":"files_external","method":"POST","url":"/apps/files_external/globalstorages","message":"Local storage path does not exist \"photos/\"","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0","version":"28.0.3.2","exception":{"Exception":"OCP\\Files\\StorageNotAvailableException","Message":"Local storage path does not exist \"photos/\"","Code":1,"Trace":[{"file":"/var/www/html/apps/files_external/lib/MountConfig.php","line":128,"function":"__construct","class":"OC\\Files\\Storage\\Local","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/files_external/lib/Controller/StoragesController.php","line":245,"function":"getBackendStatus","class":"OCA\\Files_External\\MountConfig","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/files_external/lib/Controller/GlobalStoragesController.php","line":134,"function":"updateStorageStatus","class":"OCA\\Files_External\\Controller\\StoragesController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"create","class":"OCA\\Files_External\\Controller\\GlobalStoragesController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Files_External\\Controller\\GlobalStoragesController"],"create"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Files_External\\Controller\\GlobalStoragesController"],"create"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Files_External\\Controller\\GlobalStoragesController","create",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["files_external.global_storages.create"]]},{"file":"/var/www/html/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/files_external/globalstorages"]},{"file":"/var/www/html/index.php","line":39,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Files/Storage/Local.php","Line":106,"Hint":"Storage is temporarily not available","message":"Local storage path does not exist \"photos/\"","exception":{},"CustomMessage":"Local storage path does not exist \"photos/\""}}
{"reqId":"U785cNacW5GJWXNlHoY7","level":3,"time":"2024-03-19T03:36:13+00:00","remoteAddr":"192.168.41.123","user":"admin","app":"files_external","method":"GET","url":"/apps/files_external/globalstorages/1?testOnly=true","message":"Local storage path does not exist \"photos/\"","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0","version":"28.0.3.2","exception":{"Exception":"OCP\\Files\\StorageNotAvailableException","Message":"Local storage path does not exist \"photos/\"","Code":1,"Trace":[{"file":"/var/www/html/apps/files_external/lib/MountConfig.php","line":128,"function":"__construct","class":"OC\\Files\\Storage\\Local","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/files_external/lib/Controller/StoragesController.php","line":245,"function":"getBackendStatus","class":"OCA\\Files_External\\MountConfig","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/files_external/lib/Controller/StoragesController.php","line":298,"function":"updateStorageStatus","class":"OCA\\Files_External\\Controller\\StoragesController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"show","class":"OCA\\Files_External\\Controller\\StoragesController","type":"->","args":[1,"*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Files_External\\Controller\\GlobalStoragesController"],"show"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Files_External\\Controller

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

PASTE HERE

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

PASTE HERE

PASTE HERE


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.

![image|690x363](upload://qtCP85EZlZHCtgcMFuVlVDJ1rLh.png)

Hi,

To launch occ commands in your conatiner from Truenas ( i’m assuming you are using k3s directly from the webUI of Truenas ) :

In WebUI go to apps, select nextcloud and in the right colonn click the console icon :

Then make sure to select the nextcloud pod :

Once you are in console :

su
then
su -m www-data -c 'php occ files:scan --all'

And you are good to go.

1 Like