Skip to content

File that were locked cannot still be synced with 8.2.2 #21360

Closed

Description

@tuxayo

I hopped that would fix my locking issue but now the client logs show this:

Conserver sur liste noire(keep in blacklist) : Error downloading https://my_owncloud_instance.porn/cloud/remote.php/webdav/linux/keyboard_layout.ods - server replied: Forbidden

Server configuration

Operating system:
Arch Linux

Web server:
nginx 1.8.0

Database:
PostgreSQL 9.4.5

PHP version:
5.6.16

ownCloud version: 8.2.2

Updated from an older ownCloud or fresh install:
Updated from a 8.0 install

Are you using encryption: yes

Client configuration

Arch Linux
Client: 2.1

ownCloud log

http://sebsauvage.net/paste/?a9e16291ffacb190#fJB39RQn4SDgURfGan0U/0nfKlHCut1m2nlSVpnFIjE=

Activity

  1. PVince81 commented on Dec 24, 2015

    @PVince81
    Contributor

    You might need to manually clear the locks first by emptying the oc_file_locks table.
    @icewind1991 can we add a repair step that clears the locks on upgrade ?

    Also I see this:

    {"reqId":"WAqjBlUUALcM7sQzQ8p1","remoteAddr":"46.193.65.203","app":"webdav","message":"Exception: {\"Message\":\"An exception occurred while executing 'INSERT INTO \\\"oc_file_locks\\\" (\\\"key\\\",\\\"lock\\\",\\\"ttl\\\") SELECT ?,?,? FROM \\\"oc_file_locks\\\" WHERE \\\"key\\\" = ? HAVING COUNT(*) = 0' with params [\\\"files\\\\\\\/32b7e6e57338477d2676740b81b8a47a\\\", 1, 1450895112, \\\"files\\\\\\\/32b7e6e57338477d2676740b81b8a47a\\\"]:\\n\\nSQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint \\\"lock_key_index\\\"\\nDETAIL: Key (key)=(files\\\/32b7e6e57338477d2676740b81b8a47a) already exists.\",\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\UniqueConstraintViolationException\",\"Code\":0,\"Trace\":\"#0 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(116): Doctrine\\\\DBAL\\\\Driver\\\\AbstractPostgreSQLDriver->convertException('An exception oc...', Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException))\\n#1 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(996): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOPgSql\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException), 'INSERT INTO \\\"oc...', Array)\\n#2 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/lib\\\/private\\\/db\\\/connection.php(203): Doctrine\\\\DBAL\\\\Connection->executeUpdate('INSERT INTO \\\"oc...', Array, Array)\\n#3 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/lib\\\/private\\\/db\\\/adapter.php(93): OC\\\\DB\\\\Connection->executeUpdate('INSERT INTO `*P...', Array)\\n#4 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/lib\\\/private\\\/db\\\/connection.php(242): OC\\\\DB\\\\Adapter->insertIfNotExist('*PREFIX*file_lo...', Array, Array)\\n#5 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/lib\\\/private\\\/lock\\\/dblockingprovider.php(111): OC\\\\DB\\\\Connection->insertIfNotExist('*PREFIX*file_lo...', Array, Array)\\n#6 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/lib\\\/private\\\/lock\\\/dblockingprovider.php(156): OC\\\\Lock\\\\DBLockingProvider->initLockField('files\\\/32b7e6e57...', 1)\\n#7 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/common.php(635): OC\\\\Lock\\\\DBLockingProvider->acquireLock('files\\\/32b7e6e57...', 1)\\n#8 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(572): OC\\\\Files\\\\Storage\\\\Common->acquireLock('files\\\/documents', 1, Object(OC\\\\Lock\\\\DBLockingProvider))\\n#9 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/lib\\\/private\\\/files\\\/storage\\\/wrapper\\\/wrapper.php(572): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->acquireLock('files\\\/documents', 1, Object(OC\\\\Lock\\\\DBLockingProvider))\\n#10 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/lib\\\/private\\\/files\\\/view.php(1803): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->acquireLock('files\\\/documents', 1, Object(OC\\\\Lock\\\\DBLockingProvider))\\n#11 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/lib\\\/private\\\/files\\\/view.php(1902): OC\\\\Files\\\\View->lockPath('\\\/documents', 1)\\n#12 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/lib\\\/private\\\/files\\\/view.php(1196): OC\\\\Files\\\\View->lockFile('documents\\\/CROUS...', 1)\\n#13 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/lib\\\/private\\\/connector\\\/sabre\\\/objecttree.php(148): OC\\\\Files\\\\View->getFileInfo('documents\\\/CROUS...')\\n#14 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(751): OC\\\\Connector\\\\Sabre\\\\ObjectTree->getNodeForPath('documents\\\/CROUS...')\\n#15 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(617): Sabre\\\\DAV\\\\Server->getCopyAndMoveInfo(Object(Sabre\\\\HTTP\\\\Request))\\n#16 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpMove(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#17 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#18 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(469): Sabre\\\\Event\\\\EventEmitter->emit('method:MOVE', Array)\\n#19 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#20 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/apps\\\/files\\\/appinfo\\\/remote.php(56): Sabre\\\\DAV\\\\Server->exec()\\n#21 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/remote.php(137): require_once('\\\/usr\\\/share\\\/weba...')\\n#22 {main}\",\"File\":\"\\\/usr\\\/share\\\/webapps\\\/owncloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractPostgreSQLDriver.php\",\"Line\":63}","level":4,"time":"2015-12-23T17:25:12+00:00","method":"MOVE","url":"\/cloud\/remote.php\/webdav\/documents\/CROUS\/cit%C3%A9_U\/speed_test_4.png"}
    

    @icewind1991 is this a problem with "insert or update" ?

  2. added this to the milestone on Dec 24, 2015
  3. tuxayo commented on Dec 24, 2015

    @tuxayo
    Author

    Another client which doesn't have the locked files (so it tries to download them) gets this error:

    24/12/2015 14:30:42documents/CROUS/cité_U/speed_of_me_4.png                        /media/homeShared/owncloud    Error downloading https://tuxayo.net/cloud/remote.php/webdav/documents/CROUS/cité_U/speed_of_me_4.png - server replied: Service Unavailable
    

    corresponding server log

  4. PVince81 commented on Dec 24, 2015

    @PVince81
    Contributor

    Service unavailable is also nothing with locking, the error should be "Locked".
    Looking at the stack trace:

    {"reqId":"XTRyH3FYbLXrECp4u2BF","remoteAddr":"46.193.65.205","app":"PHP","message":"opendir(ocencryption:\/\/): failed to open dir: "OC\\Files\\Stream\\Encryption::dir_opendir" call failed at \/usr\/share\/webapps\/owncloud\/lib\/private\/files\/stream\/encryption.php#190","level":3,"time":"2015-12-24T13:28:47+00:00","method":"GET","url":"\/cloud\/remote.php\/webdav\/documents\/CROUS\/cit%C3%A9_U\/speed_of_me_4.png"} {"reqId":"XTRyH3FYbLXrECp4u2BF","remoteAddr":"46.193.65.205","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 503 Could not open file\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\ServiceUnavailable\",\"Code\":0,\"Trace\":\"
    #0 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(82): OC\\\\Connector\\\\Sabre\\\\File->get()\\n
    #1 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpGet(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n
    #2 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n
    #3 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(469): Sabre\\\\Event\\\\EventEmitter->emit('method:GET', Array)\\n
    #4 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n
    #5 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/apps\\\/files\\\/appinfo\\\/remote.php(56): Sabre\\\\DAV\\\\Server->exec()\\n
    #6 \\\/usr\\\/share\\\/webapps\\\/owncloud\\\/remote.php(137): require_once('\\\/usr\\\/share\\\/weba...')\\n
    #7 {main}\",\"File\":\"\\\/usr\\\/share\\\/webapps\\\/owncloud\\\/lib\\\/private\\\/connector\\\/sabre\\\/file.php\",\"Line\":268}","level":4,"time":"2015-12-24T13:28:47+00:00","method":"GET","url":"\/cloud\/remote.php\/webdav\/documents\/CROUS\/cit%C3%A9_U\/speed_of_me_4.png"}
    

    It looks like an encryption issue.
    Are you able to download this file over the web UI ? Is it a shared file ? Is that client the recipient ?

  5. tuxayo commented on Dec 25, 2015

    @tuxayo
    Author

    Service unavailable is also nothing with locking, the error should be "Locked".

    It was a file that was locked in 8.2.2 and I hopped 8.2.3 would fix it but it seems that there is something else.

    Are you able to download this file over the web UI ?

    Nope, file not found error.
    Server logs of that error:
    http://sebsauvage.net/paste/?c98b6ac807c23f32#6wSoTgIf4IEEtf0AwRqXzwpnUG2rSw75hcS0oZ+DnE4=

    Is it a shared file ?

    No

    Is that client the recipient ?

    Yes

  6. tuxayo commented on Dec 25, 2015

    @tuxayo
    Author

    I just noticed that this error blocks the sync (can upload but can't download) on the client which tries to downloads the "corrupted" file

  7. PVince81 commented on Jan 7, 2016

    @PVince81
    Contributor

    Can you post the "oc_filecache" entry from the database matching that file ?
    Goal is to have a look at its encrypted state.

    It looks like encryption is having trouble with this file, maybe keys are missing or something.
    What key files are present for that file in "data/$user/files_encryption/keys/files/documents/CROUS/cité_U/speed_of_me_4.png/OC_DEFAULT_MODULE/" ?

    You could also try deleting the file and re-uploading it.

  8. Qixuga commented on Jan 13, 2016

    @Qixuga

    I have the same problem with new version und new client. May be it seems to be a character problem in given path.
    tuxayo got a "é" in his path, an i got a "#" in my path. Upload worked fine but download via client don't work. client-errorlog contains the path with "#" transcoded in "%23" in it. I also can't download it via web-interface.
    may be that help to solve?

  9. tuxayo commented on Feb 2, 2016

    @tuxayo
    Author

    I had to delete the file and re upload it. It seems that I can't reproduce this error anymore.

    @PVince81

    Can you post the "oc_filecache" entry from the database matching that file ?

    I have many other errors that might be related to encryption (almost every day I get new a file that throws me "connection refused"). And to investigate I need to know how can I get the "oc_filecache" entry for a file? I've never accessed the DB before.

  10. ghost added this to the milestone on Feb 22, 2016
  11. ghost removed this from the milestone on Feb 22, 2016
  12. ghost added this to the milestone on Feb 23, 2016
  13. ghost removed this from the milestone on Feb 23, 2016
  14. ghost added this to the milestone on Mar 9, 2016
  15. ghost removed this from the milestone on Mar 9, 2016
  16. simpleuser99 commented on May 4, 2016

    @simpleuser99

    Hello. I have the same problem.
    I use last stable version owncloud 8.2.3 and I can't remove or rename folder and file. I view error message "could not delete filename"

  17. tuxayo commented on May 5, 2016

    @tuxayo
    Author

    On my instance we did a clean install of version 9.0 and gave up on encryption (we've always had huge problems since two years despite multiple reinstalls). And zero problems since once month.

    So I can't help anymore on this :-(

  18. modified the milestones: 8.2.5, on May 17, 2016
  19. PVince81 commented on Jun 2, 2016

    @PVince81
    Contributor

    Ok, I think the file wasn't locked but ghosted. The filecache entry existed but the file on disk did not exist any more.

    This is a duplicate of #24625

  20. lock commented on Aug 4, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  21. locked as resolved and limited conversation to collaborators on Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions