[SOLVED] Scan new files on an external HDD

plesk
external_storage

#1

Hi Forum!

I'm trying to initialize a fresh instance from files currently stored on a NAS. I managed to perform a rsync from the NAS to our private server with no error and now want ownCloud to scan those new files. The files are stored on an additional hard disk which is mounted in /media/diskext and I've created a /oc/data to store the files.

I've launched a occ files:scan command, which fails with errors. I don't understand these errors as the command is ran with the proper admin user for the domain.

What should I check to fix the configuration and scan all files?

Any advice greatly appreciated!


Steps to reproduce

  1. rsync a complete NAS folder to ownCloud instance on our virtual private server (about 7000 files).
  2. files are stored on a secondary hard-disk on our serve, in a dedicated folder: /media/diskext/oc/data
  3. try to scan the new files with occ files:scan command (sudo -u admin_webbca php /var/www/vhosts/bcasmart.com/httpdocs/oc/occ files:scan --all)

Expected behaviour

ownCloud should scan all newly added files.

Actual behaviour

Seems the command cannot get write access to the folders:

Scanning files for 5 users
Starting scan for user 1 out of 5 (admin_jlgarnier)
**Home storage for user admin_jlgarnier not writable**
Make sure you're running the scan command only as the user the web server runs as
Starting scan for user 2 out of 5 (admin_live)
**Exception during scan**: Undefined index: size
#0 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Files/Cache/Scanner.php(421): OCA\Files\Command\Scan->exceptionErrorHandler(8, 'Undefined index...', '/var/www/vhosts...', 421, Array)
#1 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Files/Cache/Scanner.php(382): OC\Files\Cache\Scanner->handleChildren('', true, 3, '44', true, 0)
#2 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Files/Cache/Scanner.php(316): OC\Files\Cache\Scanner->scanChildren('', true, 3, '44', true)
#3 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Files/Utils/Scanner.php(235): OC\Files\Cache\Scanner->scan('', true, 3)
#4 /var/www/vhosts/bcasmart.com/httpdocs/oc/apps/files/lib/Command/Scan.php(159): OC\Files\Utils\Scanner->scan('/admin_live')
#5 /var/www/vhosts/bcasmart.com/httpdocs/oc/apps/files/lib/Command/Scan.php(228): OCA\Files\Command\Scan->scanFiles('admin_live', '/admin_live', false, Object(Symfony\Component\Console\Output\ConsoleOutput), false)
#6 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/composer/symfony/console/Command/Command.php(262): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/vhosts/bcasmart.com/httpdocs/oc/core/Command/Base.php(159): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/composer/symfony/console/Application.php(826): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/composer/symfony/console/Application.php(189): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/composer/symfony/console/Application.php(120): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Console/Application.php(160): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/vhosts/bcasmart.com/httpdocs/oc/console.php(106): OC\Console\Application->run()
#13 /var/www/vhosts/bcasmart.com/httpdocs/oc/occ(11): require_once('/var/www/vhosts...')
#14 {main}
Starting scan for user 3 out of 5 (ccianchi)
Starting scan for user 4 out of 5 (flhermitte)
Starting scan for user 5 out of 5 (jlgarnier)
Home storage for user jlgarnier not writable
Make sure you're running the scan command only as the user the web server runs as

+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 8 | 8 | 00:00:01 |
+---------+-------+--------------+

Server configuration

Ubuntu 16.04.3 LTS‬

Web server:
Apache 2.4.18

Database:
mySQL 5.7.19

PHP version:
PHP 7.0.22

ownCloud version: (see ownCloud admin page)
ownCloud 10.0.3

Updated from an older ownCloud or fresh install:
Fresh install

Where did you install ownCloud from:
setup-owncloud.php

Signing status (ownCloud 9.0 and above):
???

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

The content of config/config.php:

{
    "system": {
        "instanceid": "oct9c3w7wtcx",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "intranet.bcasmart.com"
        ],
        "datadirectory": "\/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/data",
        "overwrite.cli.url": "https:\/\/intranet.bcasmart.com",
        "dbtype": "mysql",
        "version": "10.0.3.3",
        "dbname": "ocbcalive",
        "dbhost": "localhost:3306",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": "true",
        "redis": {
            "host": "localhost",
            "port": 6379,
            "timeout": 0,
            "dbindex": 0
        },
        "files_external_allow_create_new_local": true,
        "mail_smtpmode": "php",
        "mail_smtpsecure": "ssl",
        "mail_from_address": "owncloud",
        "mail_domain": "bcasmart.com",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtphost": "mail.bcasmart.com",
        "mail_smtpport": "465",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated apps:

Enabled:
- comments: 0.3.0
- configreport: 0.1.1
- dav: 0.3.0
- federatedfilesharing: 0.3.1
- federation: 0.1.0
- files: 1.5.1
- files_external: 0.7.1
- files_sharing: 0.10.1
- files_trashbin: 0.9.1
- files_versions: 1.3.0
- files_videoplayer: 0.9.8
- firstrunwizard: 1.1
- market: 0.2.2
- notifications: 0.3.1
- provisioning_api: 0.5.0
- systemtags: 0.3.0
- templateeditor: 0.1
- updatenotification: 0.2.1
Disabled:
- encryption
- external
- files_antivirus
- theme-example
- user_external

Are you using external storage, if yes which one: local/smb/sftp/...
local: /media/diskext/oc/data

Are you using encryption: yes/no
NO

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
NO

Client configuration

Browser:
Chrome (latest version)

Operating system:
Windows 10

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

{"reqId":"cav6oIuh7YDvqiyvCxlq","level":3,"time":"2017-10-11T16:24:36+00:00","remoteAddr":"88.179.69.9","user":"--","app":"mysql.setup","method":"POST","url":"\/index.php","message":"Specific user creation failed: An exception occurred while executing 'SELECT user FROM mysql.user WHERE user=?' with params [\"oc_admin_jlgarni\"]:\n\nSQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'admin_oc_live'@'localhost' for table 'user'"}
{"reqId":"cav6oIuh7YDvqiyvCxlq","level":3,"time":"2017-10-11T16:24:36+00:00","remoteAddr":"88.179.69.9","user":"--","app":"mysql.setup","method":"POST","url":"\/index.php","message":"Database creation failed: An exception occurred while executing 'CREATE DATABASE IF NOT EXISTS `oc_bca_live` CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;':\n\nSQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'admin_oc_live'@'%' to database 'oc_bca_live'"}
{"reqId":"ik5VHlhlqVuyxT0Bxt8v","level":3,"time":"2017-10-11T16:26:03+00:00","remoteAddr":"88.179.69.9","user":"--","app":"mysql.setup","method":"POST","url":"\/index.php","message":"Database creation failed: An exception occurred while executing 'CREATE DATABASE IF NOT EXISTS `oc_bca_live` CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;':\n\nSQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'admin_oc_live'@'%' to database 'oc_bca_live'"}
{"reqId":"zFOerF1EjVjDnjyGw5h4","level":3,"time":"2017-10-11T16:35:05+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"GET","url":"\/index.php\/settings\/admin?sectionid=general","message":"opendir(\/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/themes): failed to open dir: No such file or directory at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/apps\/templateeditor\/lib\/mailtemplate.php#155"}
{"reqId":"pvHC3BbF2lrilIVjQLEB","level":3,"time":"2017-10-11T16:38:52+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"GET","url":"\/index.php\/apps\/templateeditor\/settings\/mailtemplate?theme=&template=core%2Ftemplates%2Flostpassword%2Femail.php","message":"opendir(\/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/themes): failed to open dir: No such file or directory at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/apps\/templateeditor\/lib\/mailtemplate.php#155"}
{"reqId":"5Mw8M4pXniBSAFLaAhou","level":3,"time":"2017-10-11T16:40:52+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"GET","url":"\/index.php\/settings\/admin?sectionid=general","message":"opendir(\/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/themes): failed to open dir: No such file or directory at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/apps\/templateeditor\/lib\/mailtemplate.php#155"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#421"}
{"reqId":"Rmvut9EqALXf1uuLhD2r","level":3,"time":"2017-10-16T06:11:16+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"PROPFIND","url":"\/remote.php\/webdav\/BCA-DATA","message":"Undefined index: size at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/lib\/private\/Files\/Cache\/Scanner.php#424"}
{"reqId":"HI87EgUy7Va9ak8z786z","level":3,"time":"2017-10-16T06:12:21+00:00","remoteAddr":"88.179.69.9","user":"admin_live","app":"PHP","method":"GET","url":"\/index.php\/settings\/admin?sectionid=general","message":"opendir(\/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/themes): failed to open dir: No such file or directory at \/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/apps\/templateeditor\/lib\/mailtemplate.php#155"}


#2

Hi Jean-Luc,

It seems the path to data files in your config files does not correspond to the actual path of your data files.
In your config file : "datadirectory": "\/var\/www\/vhosts\/bcasmart.com\/httpdocs\/oc\/data",
which is not
/media/diskext/oc/data


#3

Hi René,

Nice to meet you again! :wink:

Regarding your answer: should I update the config file with the actual data directory "/media/diskext/oc/data"?

Thanks for your help!


#4

Hi René,

Just checked again: tried to update the data directory in config.php and got the following error
Your Data directory is invalid
Please check that the data directory contains a file ".ocdata" in its root.

Maybe there's a misunderstanding: /media/diskext/oc/data is an external disk which is mounted as an External Storage in webUI admin console. This is probably different from the data directory ownCloud is using...

I then need to be able to scan files on any external storage: any advice for this?

Thanks in advance for any help!


#5

Applied sudo -u ocadmin chmod -R 0750 /media/diskext/oc, then relaunched sudo -u admin_webbca php occ files:scan --all.

This time, scan doesn't fail immediately but I eventually got the following errors:
Scanning files for 4 users
Starting scan for user 1 out of 4 (admin_live)

Exception during scan: Undefined index: size
#0 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Files/Cache/Scanner.php(421): OCA\Files\Command\Scan->exceptionErrorHandler(8, 'Undefined index...', '/var/www/vhosts...', 421, Array)
#1 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Files/Cache/Scanner.php(382): OC\Files\Cache\Scanner->handleChildren('20. Clients et ...', true, 3, '10102', true, 1522221)
#2 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Files/Cache/Scanner.php(385): OC\Files\Cache\Scanner->scanChildren('20. Clients et ...', true, 3, '10102', true)
#3 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Files/Cache/Scanner.php(385): OC\Files\Cache\Scanner->scanChildren('20. Clients et ...', true, 3, '8172', true)
#4 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Files/Cache/Scanner.php(385): OC\Files\Cache\Scanner->scanChildren('20. Clients et ...', true, 3, '8135', true)
#5 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Files/Cache/Scanner.php(385): OC\Files\Cache\Scanner->scanChildren('20. Clients et ...', true, 3, '8126', true)
#6 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Files/Cache/Scanner.php(385): OC\Files\Cache\Scanner->scanChildren('20. Clients et ...', true, 3, '7703', true)
#7 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Files/Cache/Scanner.php(316): OC\Files\Cache\Scanner->scanChildren('', true, 3, '44', true)
#8 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Files/Utils/Scanner.php(235): OC\Files\Cache\Scanner->scan('', true, 3)
#9 /var/www/vhosts/bcasmart.com/httpdocs/oc/apps/files/lib/Command/Scan.php(159): OC\Files\Utils\Scanner->scan('/admin_live')
#10 /var/www/vhosts/bcasmart.com/httpdocs/oc/apps/files/lib/Command/Scan.php(228): OCA\Files\Command\Scan->scanFiles('admin_live', '/admin_live', false, Object(Symfony\Component\Console\Output\ConsoleOutput), false)
#11 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/composer/symfony/console/Command/Command.php(262): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/vhosts/bcasmart.com/httpdocs/oc/core/Command/Base.php(159): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/composer/symfony/console/Application.php(826): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/composer/symfony/console/Application.php(189): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/composer/symfony/console/Application.php(120): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/vhosts/bcasmart.com/httpdocs/oc/lib/private/Console/Application.php(160): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/vhosts/bcasmart.com/httpdocs/oc/console.php(106): OC\Console\Application->run()
#18 /var/www/vhosts/bcasmart.com/httpdocs/oc/occ(11): require_once('/var/www/vhosts...')
#19 {main}

Starting scan for user 2 out of 4 (ccianchi)
Starting scan for user 3 out of 4 (flhermitte)
Starting scan for user 4 out of 4 (jlgarnier)
Home storage for user jlgarnier not writable
Make sure you're running the scan command only as the user the web server runs as

+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 313 | 2093 | 00:00:04 |
+---------+-------+--------------+

The command managed to detect the correct number of folders and files but still fails at scanning the files.. :frowning: Moreover, one home storage out of 4 looks not writable although all users have the same privileges, so I can't explain this error...

Where are those home storage folders exactly located?

What should be:
- the access rights on the ownCloud server folder (which includes ?
- the access rights on the home storage folders?

Thanks in advance for any help!


#6

Hi Jean-Luc,

In my config, the owner of the owncloud folders is the apache user (www-data). I do not have a specific oc user...


#7

I understand this is the standard situation. However, my private server is running Plesk which creates different users (admins) for each (sub-)domain.

Therefore, it seems that my OC instance is run by user=admin_webbca. This is why I need to allocate this user all mandatory rights over the "external storage" and "data" folders... Is anyone here aware of these mandatory rights and the folder locations?

Thanks in advance for any help!


#8

HELP !

I need help to determine what are the correct access rights I should give to my web user (not www-data in my case) on;
- all "external storage" folders
- all "user data" folders

Thanks in advance for any help!


#9

The user running the php script must have permissions to read and write the directory (for local external storage). Don't forget to fix the permissions on parent folders, you should be able to read the folder with your php user:

sudo -u phpuser ls -lisa /path/to/storage-folder


#10

Thanks tflidd!

I'm a newbie in Linux admin: how can I determine who is my "phpuser"? I tried using "root" but got an error saying "ls: invalid option -- '_'" as my current web user nale has an underscore...

Thanks for your help!


#11

If your owncloud is already running and you put a file, it already shows the correct owner. Alternative: put a little test-script in your webroot and open it in your browser

<?php phpinfo(); ?>

It shows you your php configuration and should also show the user that is running it (user/group).


#12

Hi,
The script returns $_SERVER['USER'] = admin_webbca, which is the user I've given rights on the different folders... :frowning:

I have also applied the script described at https://doc.owncloud.com/server/10.0/admin_manual/installation/installation_wizard.html#post-installation-steps-label, with this user and (what I suppose to be) the related group (psacln in my case, probably a Plesk-defined group). Unfortunately, if I point now to mydomain.com/oc, I just get an "access denied" page! It seems then that this user/group, although it is displayed as valid by phpinfo() is NOT the real user...

Don't know where to dig now...

Thanks again for your help!


#13

OK, I finally managed to restore the proper access rights onto the folders. Anyway, scan still fails and I found out that the OC dashboard displays "CRON : last cron performed 3 months ago. Something went wrong"...

Would it be possible that this CRON error would be the reason of the scan failing? How can I troubleshoot CRON to understand what's wrong with it?

Thanks in advance for any help!


#14

So this works?

sudo -u admin_webbca ls -lisa /media/diskext/oc

I don't know how Plesk is configured, if there are perhaps some restrictions to specific folders (e.g. via open_basedir())?

I'd prefer to run services in individual virtual servers. Then you don't need to work around Plesk or other stuff and really optimize the settings for the use with ownCloud. If you want to handle other websites with Plesk or other admin tools, do it.


#15

Hi tiflidd,

The command returns:

8126465 4 drwxr-x---  3 admin_webbca root 4096 juil. 10 14:38 .
      2 4 drwxr-xr-x  5 root         root 4096 juil. 27 11:59 ..
8126466 4 drwxr-x--- 20 admin_webbca root 4096 oct.  15 03:20 data

I've found out that the normal user (which launches OC from Plesk) is admin_webbca/psaserv, so I suppose I should apply the rights for this user on /media/diskext/oc/data as well...

By the way, to answer your advice, I don't really have the choice: we rent a virtual private server which comes preconfigured with Plesk overlay, so I can only guess what is the right configuration with this tool...

What about the CRON error? Could this also break down to the access rights issue?

Thanks again for your help!


#16

You probably have to set the group: http://www.orware.com/blog/tips-and-how-tos/plesk/correct-httpdocs-permissions

If you don't use other functions(other websites etc.) and you only use it for ownCloud, I'd rather choose a plain Debian/Ubuntu image.

Cron is a separate issue. It could be missing permissions as well.


#17

Thanks tflidd, this is probably what should now be fixed on the files into the oc directory... I'll also check all the documentation on CRON as I strongly suspect this is a related issue

Thanks again, have a nice day!


#18

Checked these permissions some minutes ago: if I apply chown -R your_plesk_username:psacln /your/httpdocs/directory, I just can't open ownCloud (access denied) as the group seems incorrect.

I have to set chown -R your_plesk_username:psaserv/your/httpdocs/directory instead, `which complies with the official documentation... Still investigating the CRON issue...


#19

Hi,

I managed to solve the CRON issue by reinstalling the mailutils package which seemed to be corrupted! I then think I can close this case! Just waiting for the scan to be triggered by cron...

Warmly thanking you all, you rock!


#20

Hi all!

Case officially SOLVED! :slight_smile: The access rights and permissions have been updated, and the scan was launched once I also fixed the cron() engine (package mailutils was indeed corrupted)!

All files available now, thanks to all of you for your help!

This forum rocks!