Skip to content

fix getUsersSharingFile with locking - #17071

Merged
PVince81 merged 1 commit into
masterfrom
share-get-users-non-existing
Jun 26, 2015
Merged

PVince81 merged 1 commit into
masterfrom
share-get-users-non-existing

Conversation

@icewind1991

Copy link
Copy Markdown
Contributor

Possible fix for #17029

I still can reproduce 17029 myself...

@nickvergessen @PVince81 please test

@PVince81 PVince81 added this to the 8.1-current milestone Jun 22, 2015
@nickvergessen

Copy link
Copy Markdown
Contributor

Let me run the full set against this over lunch

@PVince81

Copy link
Copy Markdown
Contributor

You mean run it over 🍔 ?

@nickvergessen

Copy link
Copy Markdown
Contributor
$ bin/smash lib/oc-tests/test_sharePermissions.py -t=0
SUMMARY:smash.:runid: 150622-145450
SUMMARY:smash.:URL: http://test:***@192.168.177.243/ownCloud/Smashbox/master/remote.php/webdav/
SUMMARY:smash.:Running iteration 1
SUMMARY:smash.:running lib/oc-tests/test_sharePermissions.py in /home/nickv/ownCloud/Smashbox/ramdir/test_sharePermissions-150622-145450 as test testset #0 {'sharePermissions_matrix': {'allowed_operations': ['upload', 'upload_overwrite', 'rename', 'move_in', 'move_in_overwrite', 'move_in_subdir', 'move_in_subdir_overwrite', 'move_out', 'move_out_subdir', 'delete', 'mkdir', 'rmdir'], 'permission': 31}}
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
2015-06-22 14:55:11,731 - ERROR - recipient_worker - Unexpected response: Status code: 500 - SabreDAV Exception: OC\Encryption\Exceptions\DecryptionFailedException - Message: Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.
2015-06-22 14:55:11,746 - ERROR - recipient_worker - Operation "move_in_subdir_overwrite" must be allowed when share permissions are 31 'Operation "%s" must be %s when share permissions are %i' % (operation, success_message, perms) failed in recipient_worker() ["/home/nickv/ownCloud/Smashbox/smashbox/lib/oc-tests/test_sharePermissions.py" at line 251]
INFO:requests.packages.urllib3.connectionpool:Resetting dropped connection: 192.168.177.243
2015-06-22 14:55:15,049 - ERROR - recipient_worker - 1 error(s) reported
CRITICAL:smash.:Aborting run -- non-zero exit code (2)

@nickvergessen

Copy link
Copy Markdown
Contributor

So moving a file into a subfolder "overwriting" an existing file is not working as expected anymore.
Note that overwrite via webdav is delete + create?

@icewind1991

Copy link
Copy Markdown
Contributor Author

PHP Fatal error: Maximum execution time of 3600 seconds exceeded

...

@nickvergessen

Copy link
Copy Markdown
Contributor

@icewind1991 doesn't matter:

So moving a file into a subfolder "overwriting" an existing file is not working as expected anymore.
Note that overwrite via webdav is delete + create?

$ bin/smash lib/oc-tests/test_sharePermissions.py -t=0
SUMMARY:smash.:runid: 150622-145450
SUMMARY:smash.:URL: http://test:***@192.168.177.243/ownCloud/Smashbox/master/remote.php/webdav/
SUMMARY:smash.:Running iteration 1
SUMMARY:smash.:running lib/oc-tests/test_sharePermissions.py in /home/nickv/ownCloud/Smashbox/ramdir/test_sharePermissions-150622-145450 as test testset #0 {'sharePermissions_matrix': {'allowed_operations': ['upload', 'upload_overwrite', 'rename', 'move_in', 'move_in_overwrite', 'move_in_subdir', 'move_in_subdir_overwrite', 'move_out', 'move_out_subdir', 'delete', 'mkdir', 'rmdir'], 'permission': 31}}
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.177.243
2015-06-22 14:55:11,731 - ERROR - recipient_worker - Unexpected response: Status code: 500 - SabreDAV Exception: OC\Encryption\Exceptions\DecryptionFailedException - Message: Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.
2015-06-22 14:55:11,746 - ERROR - recipient_worker - Operation "move_in_subdir_overwrite" must be allowed when share permissions are 31 'Operation "%s" must be %s when share permissions are %i' % (operation, success_message, perms) failed in recipient_worker() ["/home/nickv/ownCloud/Smashbox/smashbox/lib/oc-tests/test_sharePermissions.py" at line 251]
INFO:requests.packages.urllib3.connectionpool:Resetting dropped connection: 192.168.177.243
2015-06-22 14:55:15,049 - ERROR - recipient_worker - 1 error(s) reported
CRITICAL:smash.:Aborting run -- non-zero exit code (2)

@icewind1991

Copy link
Copy Markdown
Contributor Author

@owncloud-bot retest this please

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@icewind1991 rebase to get oracle fix in - THX

@nickvergessen

Copy link
Copy Markdown
Contributor

@DeepDiver1975

@icewind1991 rebase to get oracle fix in - THX

The patch does not solve the problem, no need to rebase anything 🙊

@icewind1991

Copy link
Copy Markdown
Contributor Author

This fixes the web ui upload found by @PVince81

@icewind1991
icewind1991 force-pushed the share-get-users-non-existing branch from a632b3c to c338999 Compare June 26, 2015 14:32
@scrutinizer-notifier

Copy link
Copy Markdown

A new inspection was created.

@icewind1991

Copy link
Copy Markdown
Contributor Author

Also this fixes the "overwrite a file in a share by moving a file in" which fails on master.

  • create a folder 'foo' as user1 and share it with user2

With cadaver as user2:

  • put bar.txt bar.txt (asuming you have a local file 'bar.txt')
  • mv bar.txt foo/
  • put bar.txt bar.txt
  • mv bar.txt foo/

@PVince81

Copy link
Copy Markdown
Contributor
  • TEST: web upload works
  • TEST: move cross-storage works
  • TEST: smashbox re-run

@PVince81

Copy link
Copy Markdown
Contributor

I ran smashbox on this branch: success.
Then I ran it on master: fail.
Then ran again on this branch: fail.

Maybe stray users or stray locks.

@PVince81

Copy link
Copy Markdown
Contributor

Let's check the keys in redis before and after these runs. (redis-cli then KEYS *)

@nickvergessen

Copy link
Copy Markdown
Contributor

Well it fixes most of the sharePermission for me.
Only ./bin/smash lib/oc-tests/test_sharePermissions.py -t=7 fails with:

2015-06-26 16:56:50,225 - ERROR - recipient_worker - Unexpected response: Status code: 500 - SabreDAV Exception: OC\Encryption\Exceptions\DecryptionFailedException - Message: Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.
2015-06-26 16:56:50,240 - ERROR - recipient_worker - Operation "move_in_subdir_overwrite" must be forbidden when share permissions are 11 'Operation "%s" must be %s when share permissions are %i' % (operation, success_message, perms) failed in recipient_worker() ["/home/nickv/ownCloud/Smashbox/smashbox/lib/oc-tests/test_sharePermissions.py" at line 251]

which is what I pointed out all the way up there already.

@PVince81

Copy link
Copy Markdown
Contributor

I deleted all tests users manually and cleared the stray keys.
Smashbox test run (bin/smash lib/oc-tests/test_sharePermissions.py -a):

  • Run 1: on this branch, no stray keys: success, no errors

@nickvergessen

Copy link
Copy Markdown
Contributor

I started it with loop=10 and run 5 and 6 failed with above exception. So it seems to be a timing issue 🙈

@PVince81

Copy link
Copy Markdown
Contributor

No stray keys after run 1.

  • Run 2: on master: fail

But no stray keys now. (note: in my previous test runs I got the "Connection Closed" error, maybe that left stray keys)

  • Run 3: on this PR: fails now ('Connection aborted.', BadStatusLine("''",))

There are 4 stray keys in redis, I leave them there.
Restart apache2.

  • Run 4: on this PR: fail

Now I remove the stray keys with flushall

  • Run 5: on this PR: success

@nickvergessen can you make sure that there are no stray keys in your redis before you run the test ?
I remember you mentionned having the "BadStatusLine" error a few times. That one would leak keys that then influence the outcome of subsequent tests.

And I think this is the explanation for the randomness.

@nickvergessen did you see any "BadStatusLine" failures in your most recent loop test ? If possible, would be good to see if keys were leaked between runs.

@nickvergessen

Copy link
Copy Markdown
Contributor

No, I didn't have any "BadStatusLine" anymore since I use a VM for testing.

Well since the patch fixes the upload via webui, I think we can use it for now, and when we find a reliable circumstance that still needs fixing, we can have a look for that later?

@PVince81

Copy link
Copy Markdown
Contributor

Yes, let's do that. And raise a separate ticket to keep the other random case in mind.

👍 for this PR

@nickvergessen

Copy link
Copy Markdown
Contributor

👍

@PVince81

Copy link
Copy Markdown
Contributor

Jenkins, don't be a buzzkill please

@icewind1991

Copy link
Copy Markdown
Contributor Author

@nickvergessen are you able to manually trigger the error that smashbox gives you?

@ghost

ghost commented Jun 26, 2015

Copy link
Copy Markdown

🚀 Test PASSed.🚀
chuck

PVince81 pushed a commit that referenced this pull request Jun 26, 2015
@PVince81
PVince81 merged commit 0684cc1 into master Jun 26, 2015
@PVince81
PVince81 deleted the share-get-users-non-existing branch June 26, 2015 16:27
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants