Shared folders are not synchronized #26055

Closed
dgeh opened this Issue Sep 7, 2016 · 22 comments

Projects

None yet

6 participants

@dgeh
dgeh commented Sep 7, 2016 edited

Steps to reproduce

  1. Create folder and share with group

Expected behaviour

Files to be synchronized in the group

Actual behaviour

old files are synchronized, new folders or files not

Server configuration

Operating system: Ubuntu 14.04.5

Web server: Apache 2.4.7

Database: mysql 5.5.50-0ubuntu0.14.04.1

PHP version: 5.5.9-1ubuntu4.19

ownCloud version: (see ownCloud admin page) 9.1.1RC1

Updated from an older ownCloud or fresh install: 9.0.4 to 9.1.0 ( in 9.1.0 was a bug, cpu high load)

Where did you install ownCloud from: apt-get

Signing status (ownCloud 9.0 and above):

No errors have been found.

List of activated apps:

Enabled:
  - comments: 0.3.0
  - dav: 0.2.6
  - federatedfilesharing: 0.3.0
  - federation: 0.1.0
  - files: 1.5.1
  - files_pdfviewer: 0.8.1
  - files_sharing: 0.10.0
  - files_trashbin: 0.9.0
  - files_versions: 1.3.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - notifications: 0.3.0
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - templateeditor: 0.1
  - updatenotification: 0.2.1

Disabled:
  - activity
  - documents
  - encryption
  - external
  - files_antivirus
  - files_external
  - files_texteditor
  - gallery
  - user_external
  - user_ldap

The content of config/config.php:

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "\/var\/www\/owncloud\/data",
        "dbtype": "mysql",
        "version": "9.1.1.0",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "forcessl": true,
        "singleuser": false,
        "theme": "",
        "maintenance": false,
        "secret": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 1,
        "trashbin_retention_obligation": "auto",
        "updatechecker": false,
        "htaccess.RewriteBase": "\/owncloud"
    },
    "apps": {
        "activity": {
            "enabled": "no",
            "installed_version": "1.1.2",
            "types": "filesystem"
        },
        "admin_dependencies_chk": {
            "enabled": "no",
            "installed_version": "0.01",
            "types": ""
        },
        "backgroundjob": {
            "lastjob": "1551"
        },
        "calendar": {
            "enabled": "no",
            "installed_version": "0.6.3",
            "types": ""
        },
        "comments": {
            "enabled": "yes",
            "installed_version": "0.3.0",
            "types": "logging"
        },
        "contacts": {
            "enabled": "no",
            "installed_version": "0.3",
            "types": ""
        },
        "core": {
            "backgroundjobs_mode": "cron",
            "global_cache_gc_lastrun": "1441025101",
            "incoming_server2server_share_enabled": "no",
            "installedat": "1404907205.8873",
            "lastcron": "1473233405",
            "lastupdateResult": "[]",
            "lastupdatedat": "1473190203",
            "oc.integritycheck.checker": "[]",
            "outgoing_server2server_share_enabled": "no",
            "public_caldav": "calendar\/share.php",
            "public_calendar": "calendar\/share.php",
            "public_documents": "documents\/public.php",
            "public_files": "files_sharing\/public.php",
            "public_gallery": "gallery\/public.php",
            "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php",
            "remote_caldav": "dav\/appinfo\/v1\/caldav.php",
            "remote_calendar": "dav\/appinfo\/v1\/caldav.php",
            "remote_carddav": "dav\/appinfo\/v1\/carddav.php",
            "remote_contacts": "dav\/appinfo\/v1\/carddav.php",
            "remote_core.css": "\/core\/minimizer.php",
            "remote_core.js": "\/core\/minimizer.php",
            "remote_dav": "dav\/appinfo\/v2\/remote.php",
            "remote_files": "dav\/appinfo\/v1\/webdav.php",
            "remote_filesync": "files\/appinfo\/filesync.php",
            "remote_webdav": "dav\/appinfo\/v1\/webdav.php",
            "repairlegacystoragesdone": "yes",
            "shareapi_allow_links": "yes",
            "shareapi_allow_mail_notification": "no",
            "shareapi_allow_public_upload": "no",
            "shareapi_allow_resharing": "yes",
            "shareapi_default_expire_date": "yes",
            "shareapi_enabled": "yes",
            "shareapi_enforce_expire_date": "yes",
            "shareapi_exclude_groups": "yes",
            "shareapi_exclude_groups_list": "***REMOVED SENSITIVE VALUE***",
            "shareapi_only_share_with_group_members": "no",
            "umgmt_send_email": "false",
            "umgmt_show_backend": "true",
            "umgmt_show_email": "true",
            "umgmt_show_last_login": "true",
            "umgmt_show_storage_location": "true"
        },
        "dav": {
            "enabled": "yes",
            "installed_version": "0.2.6",
            "types": "filesystem"
        },
        "documents": {
            "enabled": "no",
            "installed_version": "0.13.1",
            "ocsid": "168711",
            "types": ""
        },
        "federatedfilesharing": {
            "enabled": "yes",
            "installed_version": "0.3.0",
            "types": ""
        },
        "federation": {
            "enabled": "yes",
            "installed_version": "0.1.0",
            "types": "authentication"
        },
        "files": {
            "backgroundwatcher_previous_file": "8386",
            "backgroundwatcher_previous_folder": "17230",
            "cronjob_scan_files": "500",
            "enabled": "yes",
            "installed_version": "1.5.1",
            "types": "filesystem"
        },
        "files_external": {
            "enabled": "no",
            "installed_version": "0.2",
            "types": "filesystem"
        },
        "files_pdfviewer": {
            "enabled": "yes",
            "installed_version": "0.8.1",
            "ocsid": "166049",
            "types": ""
        },
        "files_sharing": {
            "enabled": "yes",
            "incoming_server2server_share_enabled": "no",
            "installed_version": "0.10.0",
            "outgoing_server2server_share_enabled": "no",
            "types": "filesystem"
        },
        "files_texteditor": {
            "enabled": "no",
            "installed_version": "0.3",
            "types": ""
        },
        "files_trashbin": {
            "enabled": "yes",
            "installed_version": "0.9.0",
            "types": "filesystem"
        },
        "files_versions": {
            "enabled": "yes",
            "installed_version": "1.3.0",
            "types": "filesystem"
        },
        "files_videoplayer": {
            "enabled": "yes",
            "installed_version": "0.9.8",
            "types": ""
        },
        "files_videoviewer": {
            "enabled": "no",
            "installed_version": "0.1.2",
            "types": ""
        },
        "firstrunwizard": {
            "enabled": "yes",
            "installed_version": "1.1",
            "ocsid": "166055",
            "types": ""
        },
        "gallery": {
            "enabled": "no",
            "installed_version": "0.5.3",
            "types": "filesystem"
        },
        "notifications": {
            "enabled": "yes",
            "installed_version": "0.3.0",
            "types": "logging"
        },
        "provisioning_api": {
            "enabled": "yes",
            "installed_version": "0.5.0",
            "types": "prevent_group_restriction"
        },
        "search_lucene": {
            "enabled": "no",
            "installed_version": "0.5.2",
            "types": "filesystem"
        },
        "systemtags": {
            "enabled": "yes",
            "installed_version": "0.3.0",
            "types": "logging"
        },
        "templateeditor": {
            "enabled": "yes",
            "installed_version": "0.1",
            "types": ""
        },
        "updatenotification": {
            "enabled": "yes",
            "installed_version": "0.2.1",
            "types": ""
        },
        "updater": {
            "enabled": "no",
            "installed_version": "0.6",
            "types": ""
        }
    }
}

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

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Firefox

Operating system: Windows 7

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Insert your ownCloud log here
Starting scan for user 1 out of 18 (aknopp)
Exception while scanning: Jail rootPath is null
#0 /var/www/owncloud/lib/private/Files/Storage/Wrapper/Jail.php(470): OC\Files\Storage\Wrapper\Jail->getSourcePath('scanner::')
#1 /var/www/owncloud/apps/files_sharing/lib/sharedstorage.php(368): OC\Files\Storage\Wrapper\Jail->resolvePath('scanner::')
#2 /var/www/owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php(584): OC\Files\Storage\Shared->acquireLock('scanner::', 2, Object(OC\Lock\DBLockingProvider))
#3 /var/www/owncloud/lib/private/Files/Cache/Scanner.php(305): OC\Files\Storage\Wrapper\Wrapper->acquireLock('scanner::', 2, Object(OC\Lock\DBLockingProvider))
#4 /var/www/owncloud/lib/private/Files/Utils/Scanner.php(195): OC\Files\Cache\Scanner->scan('', true, 3)
#5 /var/www/owncloud/apps/files/lib/Command/Scan.php(155): OC\Files\Utils\Scanner->scan('/aknopp')
#6 /var/www/owncloud/apps/files/lib/Command/Scan.php(223): OCA\Files\Command\Scan->scanFiles('aknopp', '/aknopp', false, Object(Symfony\Component\Console\Output\ConsoleOutput), false)
#7 /var/www/owncloud/3rdparty/symfony/console/Command/Command.php(259): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/owncloud/core/Command/Base.php(158): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/owncloud/3rdparty/symfony/console/Application.php(844): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/owncloud/3rdparty/symfony/console/Application.php(192): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/owncloud/3rdparty/symfony/console/Application.php(123): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/owncloud/lib/private/Console/Application.php(146): Symfony\Component\Console\Application->run(NULL, NULL)
#13 /var/www/owncloud/console.php(94): OC\Console\Application->run()
#14 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
#15 {main}

Exception: {"Exception":"OCP\Files\NotFoundException","Message":"File with id "158381" has not been found.","Code":0,"Trace":"
#0 /var/www/owncloud/apps/files_sharing/lib/sharedstorage.php(99): OC\Files\View->getPath(158381, false)
#1 /var/www/owncloud/apps/files_sharing/lib/sharedstorage.php(445): OC\Files\Storage\Shared->init()
#2 /var/www/owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php(485): OC\Files\Storage\Shared->getWrapperStorage()
#3 /var/www/owncloud/apps/files_sharing/lib/sharedstorage.php(119): OC\Files\Storage\Wrapper\Wrapper->instanceOfStorage('\OC\Files\Stora...')
#4 /var/www/owncloud/lib/private/legacy/util.php(148): OC\Files\Storage\Shared->instanceOfStorage('\OC\Files\Stora...')
#5 /var/www/owncloud/lib/private/Files/Storage/StorageFactory.php(100): OC_Util::{closure}('/lrees/files/NA...', Object(OC\Files\Storage\Shared), Object(OCA\Files_Sharing\SharedMount))
#6 /var/www/owncloud/lib/private/Files/Storage/StorageFactory.php(82): OC\Files\Storage\StorageFactory->wrap(Object(OCA\Files_Sharing\SharedMount), Object(OC\Files\Storage\Shared))
#7 /var/www/owncloud/lib/private/Files/Mount/MountPoint.php(137): OC\Files\Storage\StorageFactory->getInstance(Object(OCA\Files_Sharing\SharedMount), '\OC\Files\Stora...', Array)
#8 /var/www/owncloud/lib/private/Files/Mount/MountPoint.php(160): OC\Files\Mount\MountPoint->createStorage()
#9 /var/www/owncloud/lib/private/Files/View.php(1356): OC\Files\Mount\MountPoint->getStorage()
#10 /var/www/owncloud/lib/private/Files/Node/Root.php(180): OC\Files\View->getFileInfo('/lrees')
#11 /var/www/owncloud/lib/private/Files/Node/Root.php(342): OC\Files\Node\Root->get('/lrees')
#12 /var/www/owncloud/lib/private/Server.php(809): OC\Files\Node\Root->getUserFolder('lrees')
#13 /var/www/owncloud/apps/dav/lib/Connector/Sabre/ServerFactory.php(127): OC\Server->getUserFolder()
#14 [internal function]: OCA\DAV\Connector\Sabre\ServerFactory->OCA\DAV\Connector\Sabre\{closure}(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
#15 /var/www/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php(105): call_user_func_array(Object(Closure), Array)
#16 /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php(446): Sabre\Event\EventEmitter->emit('beforeMethod', Array)
#17 /var/www/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php(248): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
#18 /var/www/owncloud/apps/dav/appinfo/v1/webdav.php(56): Sabre\DAV\Server->exec()
#19 /var/www/owncloud/remote.php(164): require_once('/var/www/ownclo...')
#20 {main}","File":"/var/www/owncloud/lib/private/Files/View.php","Line":1705}

@PVince81
Collaborator
PVince81 commented Sep 7, 2016

Jail rootPath is null

Fixed with #26050 and the message about "fileid" not found should be fixed too with this PR.

Now I think this has nothing to do with sync problems, let's see

@PVince81
Collaborator
PVince81 commented Sep 7, 2016
  1. Setup OC v9.1.1RC1
  2. Login as "admin"
  3. Setup sync client for "admin"
  4. Add "admin" to a new group "group1"
  5. Create a user "user1"
  6. Login as "user1"
  7. Create a folder "test/sub"
  8. Create a text file "test/test.txt"
  9. Share "test" with "group1"
  10. Wait for sync: "test" appears locally in admin's sync
  11. Still as "user1", create a new folder "test/sub2"
  12. Still as "user1", create a new file "test/test2.txt"
  13. Wait for sync: both "sub2" and "test2.txt" got downloaded

Works for me.

Maybe the share in question is an old share or is broken in some specific way.
I suspect that in your use case maybe the receiving user is also receiving a ghost share (deleted/orphaned share) which would explain the log entries, and maybe the sync client is stumbling upon errors related to that one and stops syncing.
This should be fixed with the PR I mentioned. Are you able to try with the patch from https://github.com/owncloud/core/pull/26050.patch ?

Else you can wait a bit, there will be a 9.1.1RC2 soon that you could use.

@dgeh
dgeh commented Sep 7, 2016

I'll wait for RC2.

Thanks

@gitmanus
gitmanus commented Sep 20, 2016 edited

After upgrade to 9.1.1 still sharing problems ->

{"reqId":"J3IIZIbYUewSucQ+FNYR","remoteAddr":"","app":"files","message":"Exception: {"Exception":"InvalidArgumentException","Message":"Jail rootPath is null","Code":0,"Trace":"
#0 /var/www/html/owncloud/lib/private/Files/Storage/Wrapper/Jail.php(470): OC\Files\Storage\Wrapper\Jail->getSourcePath('scanner::')
#1 /var/www/html/owncloud/apps/files_sharing/lib/sharedstorage.php(371): OC\Files\Storage\Wrapper\Jail->resolvePath('scanner::')
#2 /var/www/html/owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php(584): OC\Files\Storage\Shared->acquireLock('scanner::', 2, Object(OC\Lock\MemcacheLockingProvider))
#3 /var/www/html/owncloud/lib/private/Files/Cache/Scanner.php(305): OC\Files\Storage\Wrapper\Wrapper->acquireLock('scanner::', 2, Object(OC\Lock\MemcacheLockingProvider))
#4 /var/www/html/owncloud/lib/private/Files/Cache/Scanner.php(478): OC\Files\Cache\Scanner->scan('', true, 1)
#5 /var/www/html/owncloud/lib/private/Files/Cache/Scanner.php(495): OC\Files\Cache\Scanner->OC\Files\Cache\{closure}()
#6 /var/www/html/owncloud/lib/private/Files/Cache/Scanner.php(479): OC\Files\Cache\Scanner->runBackgroundScanJob(Object(Closure), '')
#7 /var/www/html/owncloud/lib/private/Files/Utils/Scanner.php(143): OC\Files\Cache\Scanner->backgroundScan()
#8 /var/www/html/owncloud/apps/files/lib/BackgroundJob/ScanFiles.php(87): OC\Files\Utils\Scanner->backgroundScan('')
#9 /var/www/html/owncloud/apps/files/lib/BackgroundJob/ScanFiles.php(111): OCA\Files\BackgroundJob\ScanFiles->runScanner(Object(OC\User\User))
#10 /var/www/html/owncloud/lib/private/BackgroundJob/Job.php(52): OCA\Files\BackgroundJob\ScanFiles->run(NULL)
#11 /var/www/html/owncloud/lib/private/BackgroundJob/TimedJob.php(53): OC\BackgroundJob\Job->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))
#12 /var/www/html/owncloud/cron.php(122): OC\BackgroundJob\TimedJob->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))
#13 {main}","File":"/var/www/html/owncloud/lib/private/Files/Storage/Wrapper/Jail.php","Line":55}","level":3,"time":"September 20 18:15:06 2016","method":"--","url":"--","user":"--"}
@gitmanus

clean code install, and did ./occ upgrade to an existing and properly updated dbase since 7.0.x

@PVince81
Collaborator

@gitmanus can you describe your sharing scenario, ideally with steps to recreate it (ex: create user1, user1 shares with group2, etc).

@PVince81 PVince81 added this to the 9.1.2 milestone Sep 20, 2016
@PVince81
Collaborator

@gitmanus also run select * from oc_share where share_with='$userid' and replace $userid with the id of the user having trouble and then again with the user's group(s).
Then pick the values from "file_source" in the result and do select * from oc_filecache where fileid in (1, 2, 3) where "1, 2, 3" is the list of values from file_source.

@gitmanus

I'm sorry not to be able to respond now: I will update from 1st oct again. Kind regards ...

@PVince81 PVince81 modified the milestone: 9.1.3, 9.1.2 Oct 20, 2016
@PVince81
Collaborator

Any update ?

@danielgehlen

We updatet to 9.1.1
Now its running fine.

@PVince81
Collaborator

Thanks, closing then

@PVince81 PVince81 closed this Oct 20, 2016
@Flachzange
Flachzange commented Oct 30, 2016 edited

I have exactly the same error message as posted by @gitmanus but AFTER upgrading from 9.1 to 9.1.1. It is basically flooding my log. From the log I cannot take any useful information what share or what user is the cause. As our owncloud installation has many shares, finding the cause by trial and error wouldn't be an option.

The error appears every 15 minutes with the exact same message. I first thought it is caused by the 15min cron job for cron.php but when manually calling cron.php, the error is not thrown.

Any idea how to narrow down the root cause?

The message is as follows:

{"reqId":"cUPoyTLIZcER1Ogk9m9r","remoteAddr":"","app":"files","message":"Exception: {\"Exception\":\"InvalidArgumentException\",\"Message\":\"Jail rootPath is null\",\"Code\":0,\"Trace\":\"
#0 \\\/var\\\/www\\\/vhosts\\\/owncloud.local\\\/httpdocs\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Jail.php(470): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Jail->getSourcePath('scanner::')\\n
#1 \\\/var\\\/www\\\/vhosts\\\/owncloud.local\\\/httpdocs\\\/apps\\\/files_sharing\\\/lib\\\/sharedstorage.php(371): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Jail->resolvePath('scanner::')\\n
#2 \\\/var\\\/www\\\/vhosts\\\/owncloud.local\\\/httpdocs\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(584): OC\\\\Files\\\\Storage\\\\Shared->acquireLock('scanner::', 2, Object(OC\\\\Lock\\\\DBLockingProvider))\\n
#3 \\\/var\\\/www\\\/vhosts\\\/owncloud.local\\\/httpdocs\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(305): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->acquireLock('scanner::', 2, Object(OC\\\\Lock\\\\DBLockingProvider))\\n
#4 \\\/var\\\/www\\\/vhosts\\\/owncloud.local\\\/httpdocs\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(478): OC\\\\Files\\\\Cache\\\\Scanner->scan('', true, 1)\\n
#5 \\\/var\\\/www\\\/vhosts\\\/owncloud.local\\\/httpdocs\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(495): OC\\\\Files\\\\Cache\\\\Scanner->OC\\\\Files\\\\Cache\\\\{closure}()\\n
#6 \\\/var\\\/www\\\/vhosts\\\/owncloud.local\\\/httpdocs\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(479): OC\\\\Files\\\\Cache\\\\Scanner->runBackgroundScanJob(Object(Closure), '')\\n
#7 \\\/var\\\/www\\\/vhosts\\\/owncloud.local\\\/httpdocs\\\/lib\\\/private\\\/Files\\\/Utils\\\/Scanner.php(143): OC\\\\Files\\\\Cache\\\\Scanner->backgroundScan()\\n
#8 \\\/var\\\/www\\\/vhosts\\\/owncloud.local\\\/httpdocs\\\/apps\\\/files\\\/lib\\\/BackgroundJob\\\/ScanFiles.php(87): OC\\\\Files\\\\Utils\\\\Scanner->backgroundScan('')\\n
#9 \\\/var\\\/www\\\/vhosts\\\/owncloud.local\\\/httpdocs\\\/apps\\\/files\\\/lib\\\/BackgroundJob\\\/ScanFiles.php(111): OCA\\\\Files\\\\BackgroundJob\\\\ScanFiles->runScanner(Object(OC\\\\User\\\\User))\\n
#10 \\\/var\\\/www\\\/vhosts\\\/owncloud.local\\\/httpdocs\\\/lib\\\/private\\\/BackgroundJob\\\/Job.php(52): OCA\\\\Files\\\\BackgroundJob\\\\ScanFiles->run(NULL)\\n
#11 \\\/var\\\/www\\\/vhosts\\\/owncloud.local\\\/httpdocs\\\/lib\\\/private\\\/BackgroundJob\\\/TimedJob.php(53): OC\\\\BackgroundJob\\\\Job->execute(Object(OC\\\\BackgroundJob\\\\JobList), Object(OC\\\\Log))\\n
#12 \\\/var\\\/www\\\/vhosts\\\/owncloud.local\\\/httpdocs\\\/cron.php(122): OC\\\\BackgroundJob\\\\TimedJob->execute(Object(OC\\\\BackgroundJob\\\\JobList), Object(OC\\\\Log))\\n
#13 {main}\",\"File\":\"\\\/var\\\/www\\\/vhosts\\\/owncloud.local\\\/httpdocs\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Jail.php\",\"Line\":55}","level":3,"time":"2016-10-30T09:00:02+01:00","method":"--","url":"--","user":"--"}
@PVince81
Collaborator
PVince81 commented Nov 2, 2016

Okay, reopening.

@PVince81 PVince81 reopened this Nov 2, 2016
@PVince81
Collaborator
PVince81 commented Nov 2, 2016

From what I see, the error from @gitmanus and @Flachzange happens in the background scan job, not when manually running occ files:scan. The reason it happens every 15 minutes is because it's triggered by running cron.php.

So this means there might be yet another condition triggering this error.

I'd however expect the background scanner to ignore "shared::" storages of local shares because there are already scanned for the owner, so not sure why it's still trying to go scanning there.

@PVince81
Collaborator
PVince81 commented Nov 2, 2016

Hmm, I tried reproducing this without success.
In my test cases with resharing external storage or fed shares or even local shares, it always goes in the else block here: https://github.com/owncloud/core/blob/master/lib/private/Files/Cache/Scanner.php#L481

But in your stack traces I see it goes in the first condition: https://github.com/owncloud/core/blob/master/lib/private/Files/Cache/Scanner.php#L477. However from what I see from debugging it is impossible to reach that block for shared storages in regular scenarios because inCache() will go look at the owner's oc_filecache entries and will see that the fileid for that entry exist.

Now I tried to create a situation where the fileid for the owner doesn't exist, but in this case the mount doesn't even appear in the list to scan.

@PVince81
Collaborator
PVince81 commented Nov 2, 2016

So, I managed to reproduce something by having a share be from a deleted user. In this case inCache will return false because it's actually a 'FailedCachefrom aFailedStorage`.

0  OC\Files\Storage\Wrapper\Jail->getSourcePath() /srv/www/htdocs/owncloud/lib/private/Files/Storage/Wrapper/Jail.php:55
1  OC\Files\Storage\Wrapper\Jail->resolvePath() /srv/www/htdocs/owncloud/lib/private/Files/Storage/Wrapper/Jail.php:470
2  OC\Files\Storage\Shared->acquireLock() /srv/www/htdocs/owncloud/apps/files_sharing/lib/sharedstorage.php:371
3  OC\Files\Storage\Wrapper\Wrapper->acquireLock() /srv/www/htdocs/owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php:584
4  OC\Files\Cache\Scanner->scan() /srv/www/htdocs/owncloud/lib/private/Files/Cache/Scanner.php:305
5  OC\Files\Cache\Scanner->OC\Files\Cache\{closure}() /srv/www/htdocs/owncloud/lib/private/Files/Cache/Scanner.php:478
6  OC\Files\Cache\Scanner->runBackgroundScanJob() /srv/www/htdocs/owncloud/lib/private/Files/Cache/Scanner.php:495
7  OC\Files\Cache\Scanner->backgroundScan() /srv/www/htdocs/owncloud/lib/private/Files/Cache/Scanner.php:479
8  OC\Files\Utils\Scanner->backgroundScan() /srv/www/htdocs/owncloud/lib/private/Files/Utils/Scanner.php:143
9  OCA\Files\BackgroundJob\ScanFiles->runScanner() /srv/www/htdocs/owncloud/apps/files/lib/BackgroundJob/ScanFiles.php:87
10 OCA\Files\BackgroundJob\ScanFiles->run() /srv/www/htdocs/owncloud/apps/files/lib/BackgroundJob/ScanFiles.php:111
11 OC\BackgroundJob\Job->execute() /srv/www/htdocs/owncloud/lib/private/BackgroundJob/Job.php:52
12 OC\BackgroundJob\TimedJob->execute() /srv/www/htdocs/owncloud/lib/private/BackgroundJob/TimedJob.php:53
13 {main}          /srv/www/htdocs/owncloud/cron.php:122

I'll see if I can simply exclude these from the background scan.

@PVince81
Collaborator
PVince81 commented Nov 2, 2016

Steps to reproduce:

  1. Create two users "user1" and "user2"
  2. Login as "user1"
  3. Create a folder "test"
  4. Share "test" with "user2"
  5. In the database find the share id in oc_share then: update oc_share set uid_owner='unexist',uid_initiator='unexist' where id=$found_share_id; => this makes the share originate from a non-existing user
  6. Run cron.php
@PVince81 PVince81 referenced this issue Nov 2, 2016
Merged

Skip FailedStorage in background scan #26529

5 of 10 tasks complete
@PVince81
Collaborator
PVince81 commented Nov 2, 2016

@gitmanus @Flachzange fix is here: #26529

Note: you only actually need the change in "Utils/Scanner.php" to make it work. The rest is only hardening.

@Flachzange

Thanks for the fix. I applied the entire change and it actually seems to do the trick. Much appreciated! I'll let you know if the next few days will draw a different picture.

Did I understand it correctly that the problem originates from shares by users that doesn't exist anymore? That shouldn't be the case in my installation but maybe something was screwed before.

@PVince81
Collaborator
PVince81 commented Nov 2, 2016

Did I understand it correctly that the problem originates from shares by users that doesn't exist anymore?

This is one possibility. But there might be other cases where the shares could not be setup due to other things that were deleted. Possibly something screwed like you said.

@PVince81 PVince81 closed this Nov 2, 2016
@PVince81 PVince81 reopened this Nov 2, 2016
@PVince81 PVince81 modified the milestone: 9.1.4, 9.1.3 Nov 30, 2016
@cdamken
Contributor
cdamken commented Dec 18, 2016

in oC 9.1.2

Exception while scanning: Jail rootPath is null
#0 /var/www/owncloud/lib/private/Files/Storage/Wrapper/Jail.php(470): OC\Files\Storage\Wrapper\Jail->getSourcePath('scanner::')
#1 /var/www/owncloud/apps/files_sharing/lib/sharedstorage.php(371): OC\Files\Storage\Wrapper\Jail->resolvePath('scanner::')
#2 /var/www/owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php(584): OC\Files\Storage\Shared->acquireLock('scanner::', 2, Object(OC\Lock\MemcacheLockingProvider))
#3 /var/www/owncloud/lib/private/Files/Cache/Scanner.php(305): OC\Files\Storage\Wrapper\Wrapper->acquireLock('scanner::', 2, Object(OC\Lock\MemcacheLockingProvider))
#4 /var/www/owncloud/lib/private/Files/Utils/Scanner.php(195): OC\Files\Cache\Scanner->scan('', true, 3)
#5 /var/www/owncloud/apps/files/lib/Command/Scan.php(158): OC\Files\Utils\Scanner->scan('/USERXXX')
#6 /var/www/owncloud/apps/files/lib/Command/Scan.php(226): OCA\Files\Command\Scan->scanFiles('USERXXX', '/USERXXX', true, Object(Symfony\Component\Console\Output\ConsoleOutput), false)
#7 /var/www/owncloud/3rdparty/symfony/console/Command/Command.php(259): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/owncloud/core/Command/Base.php(158): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/owncloud/3rdparty/symfony/console/Application.php(844): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/owncloud/3rdparty/symfony/console/Application.php(192): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/owncloud/3rdparty/symfony/console/Application.php(123): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/owncloud/lib/private/Console/Application.php(146): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/owncloud/console.php(102): OC\Console\Application->run()
#14 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
#15 {main}

The user has only 2 shares:

INSERT INTO `oc_share_external` (`id`, `remote`, `remote_id`, `share_token`, `password`, `name`, `owner`, `user`, `mountpoint`, `mountpoint_hash`, `accepted`) VALUES (NULL, 'https://servername ', '-1', 'mlM6HgHWTV1tkCi', '', '/CommunityXXXt', 'XXXXX', 'XXXX', '/CommunityXXXt', '7ab5d220401e5e6d96cXXXb3f405fcb7', '1')
INSERT INTO `oc_share` (`id`, `share_type`, `share_with`, `uid_owner`, `parent`, `item_type`, `item_source`, `item_target`, `file_source`, `file_target`, `permissions`, `stime`, `accepted`, `expiration`, `token`, `mail_send`, `uid_initiator`) VALUES (NULL, '3', '1|$2y$10$LUmnTSfj7CkkHPgJvwo9jOXXXXVP0XB50dtVqLQs8e/pSfB2XEG', 'XXXX', NULL, 'file', '923696', '/923696', '923696', '/Filename.zip', '1', '1465915327', '0', NULL, 'CQbgomZObCwywx5', '0', 'USERXXX')
@PVince81
Collaborator

I need to finish this PR... #26529

@PVince81 PVince81 self-assigned this Dec 19, 2016
@PVince81 PVince81 closed this in #26529 Jan 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment