Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tuxayo opened this issue Dec 23, 2015 · 12 comments
Closed

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

tuxayo opened this issue Dec 23, 2015 · 12 comments
Labels
Milestone

Comments

@tuxayo
Copy link

tuxayo commented Dec 23, 2015

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=

@PVince81
Copy link
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" ?

@PVince81 PVince81 added this to the 9.0-current milestone Dec 24, 2015
@tuxayo
Copy link
Author

tuxayo commented Dec 24, 2015

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

@PVince81
Copy link
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 ?

@tuxayo
Copy link
Author

tuxayo commented Dec 25, 2015

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

@tuxayo
Copy link
Author

tuxayo commented Dec 25, 2015

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

@PVince81
Copy link
Contributor

PVince81 commented Jan 7, 2016

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.

@Qixuga
Copy link

Qixuga commented Jan 13, 2016

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?

@ghost ghost mentioned this issue Jan 25, 2016
@tuxayo
Copy link
Author

tuxayo commented Feb 2, 2016

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.

@ghost ghost modified the milestones: 8.2.3-current-maintenance, 9.0-current, 8.2.4-next-maintenance Feb 22, 2016
@ghost ghost modified the milestones: 8.2.5-next-maintenance, 8.2.4-current-maintenance Mar 9, 2016
@simpleuser99
Copy link

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"

@tuxayo
Copy link
Author

tuxayo commented May 5, 2016

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 :-(

@MorrisJobke MorrisJobke modified the milestones: 8.2.5, 8.2.6-current-maintenance May 17, 2016
@PVince81
Copy link
Contributor

PVince81 commented Jun 2, 2016

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

@lock
Copy link

lock bot commented Aug 4, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants