Repository navigation
Closed
Description
Steps to reproduce
- Install 8.1
- Enable transactional locking
- Navigate to the admin page and enable encryption
- Navigate to the apps page and enable default encryption module
- Go back to the admin page - see message to log out
- Log out and back in
- Upload a file
Expected behaviour
File should upload successfully
Actual behaviour
Browser shows "Internal Server Error" and the file is not listed. If you refresh the browser, the file is there.
{"reqId":"ERbVGHmnOakkKpuygSQS","remoteAddr":"172.18.0.165","app":"PHP","message":"Module 'redis' already loaded at Unknown#0","level":3,"time":"2015-06-24T19:36:45+00:00"}
{"reqId":"2h4Dvn\/8+yvyRv7e\/K8H","remoteAddr":"172.18.0.165","app":"PHP","message":"Module 'redis' already loaded at Unknown#0","level":3,"time":"2015-06-24T19:36:45+00:00"}
{"reqId":"qa1EjSZZWwO5Pif6fe5E","remoteAddr":"172.18.0.165","app":"PHP","message":"Module 'redis' already loaded at Unknown#0","level":3,"time":"2015-06-24T19:36:45+00:00"}
{"reqId":"aQJ7uWNUmDN1NTBlttAg","remoteAddr":"172.18.0.165","app":"PHP","message":"Module 'redis' already loaded at Unknown#0","level":3,"time":"2015-06-24T19:36:46+00:00"}
{"reqId":"5von09\/7j1LVlQLxB82O","remoteAddr":"172.18.0.165","app":"PHP","message":"Module 'redis' already loaded at Unknown#0","level":3,"time":"2015-06-24T19:37:43+00:00"}
{"reqId":"Vt2ZZdzJ1c+ICZMWJ07H","remoteAddr":"172.18.0.165","app":"PHP","message":"Module 'redis' already loaded at Unknown#0","level":3,"time":"2015-06-24T19:37:47+00:00"}
{"reqId":"233NiQmx3iDOlFSmbjAD","remoteAddr":"172.18.0.165","app":"PHP","message":"Module 'redis' already loaded at Unknown#0","level":3,"time":"2015-06-24T19:38:09+00:00"}
{"reqId":"K2tbffTgtiK66T8YblS4","remoteAddr":"172.18.0.165","app":"PHP","message":"Module 'redis' already loaded at Unknown#0","level":3,"time":"2015-06-24T19:38:12+00:00"}
{"reqId":"uxiVthIy2UNVtB2EP7V0","remoteAddr":"172.18.0.165","app":"PHP","message":"Module 'redis' already loaded at Unknown#0","level":3,"time":"2015-06-24T19:38:23+00:00"}
{"reqId":"NPQ1nxd6MmqaUKaCC7Xm","remoteAddr":"172.18.0.165","app":"PHP","message":"Call to a member function getPath() on a non-object at \/var\/www\/html\/owncloud\/lib\/private\/share\/share.php#132","level":3,"time":"2015-06-24T19:38:40+00:00"}
{"reqId":"PtUg9pZTUriKNNJOZkL6","remoteAddr":"172.18.0.165","app":"admin_audit","message":"Create \"\/at_admin\/files\/pre_136.txt\" by user at_admin, owner: at_admin","level":1,"time":"2015-06-24T19:40:36+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"PtUg9pZTUriKNNJOZkL6","remoteAddr":"172.18.0.165","app":"files_locking","message":"INFO: Write lock requested for \/var\/www\/html\/owncloud\/data\/at_admin\/files\/pre_136.txt","level":0,"time":"2015-06-24T19:40:36+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"PtUg9pZTUriKNNJOZkL6","remoteAddr":"172.18.0.165","app":"files_locking","message":"PASS: Write lock succeeded on \/var\/www\/html\/owncloud\/data\/at_admin\/files\/pre_136.txt","level":0,"time":"2015-06-24T19:40:36+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"PtUg9pZTUriKNNJOZkL6","remoteAddr":"172.18.0.165","app":"files_locking","message":"INFO: Incrementing lock type 2 count for \/var\/www\/html\/owncloud\/data\/at_admin\/files\/pre_136.txt","level":0,"time":"2015-06-24T19:40:36+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"PtUg9pZTUriKNNJOZkL6","remoteAddr":"172.18.0.165","app":"PHP","message":"Call to a member function getPath() on a non-object at \/var\/www\/html\/owncloud\/lib\/private\/share\/share.php#132","level":3,"time":"2015-06-24T19:40:36+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
Server Host info:
Ubuntu 14.04
PHP 5.5.9
Server configuration:
ownCloud Enterprise Edition 8.1 RC1 (daily) Build:2015-06-24T03:11:04+00:00 02b2b60
Activity
MorrisJobke commentedon Jun 25, 2015
@DeepDiver1975 ping
PVince81 commentedon Jun 25, 2015
Please try again on master, there have been many fixes already since RC1.
RC1 is already outdated.
PVince81 commentedon Jun 25, 2015
Interestingly this message
looks like the error we see in #17029
DeepDiver1975 commentedon Jun 25, 2015
@jnfrmarks yes - please don't test transactional locking on outdated code base - please always use master - this piece is still under development
jnfrmarks commentedon Jun 25, 2015
Isn't this build from June 24, 2015?
DeepDiver1975 commentedon Jun 25, 2015
@jnfrmarks your are right - I got confused because of that RC1 tag - sorry for the noise
PVince81 commentedon Jun 25, 2015
Same for me.
But also I remember that upload with encryption worked for me before
jnfrmarks commentedon Jun 25, 2015
@PVince81
I also believe this worked earlier.
PVince81 commentedon Jun 25, 2015
Confirmed happening on master (9be1d08).
I followed the exact order of enabling locking, core encryption and the encryption module.
PVince81 commentedon Jun 25, 2015
Strangely uploading from WebDAV works, but not Web UI.
I'll compare the code paths.
jnfrmarks commentedon Jun 25, 2015
@PVince81
I believe that the upload is happening in the Web UI too. If you refresh your browser, you can see the file there.
PVince81 commentedon Jun 25, 2015
Yes, seems web UI upload did go through.
Maybe something at the end of the transfer triggered the error.
PVince81 commentedon Jun 25, 2015
Code path for web UI error:
The uploaded file is empty. This is because
fopensucceeded, it created a file, but the error happens before the content is written.This is the same issue as #17029
Closing as duplicate.
I will still investigate why WebDAV isn't reaching that code path at all, this sounds suspicious.
PVince81 commentedon Jun 25, 2015
WebDAV works because it uses part files, explanation here: #17029 (comment)
Web UI doesn't use part files (#12353 will improve that)
PVince81 commentedon Jun 25, 2015
Note: regarding the "used to work" statement.
Yes, it used to worked before we introduced scanner locking, which now also acquires a shared lock whenever file info is retrieved.
jnfrmarks commentedon Jun 25, 2015
@PVince81
Could this error prevent the file from being scanned by the antivirus scanner?
PVince81 commentedon Jun 26, 2015
It depends at what point of the process the antivirus hooks itself in.
From looking at the code here https://github.com/owncloud/files_antivirus/blob/master/appinfo/application.php#L99 it looks like it's using a storage wrapper. And here https://github.com/owncloud/files_antivirus/blob/master/lib/avirwrapper.php I can see that the wrapper is operating directly on the storage instance, so it should work.
To clarify, the locking is always done on View level. The Storage is one level below the view, the View always calls the Storage matching the mount point to do operations.
Still, this is something that needs to be tested.
Another point: as far as I remember the antivirus also has a background scan that is triggered by cron. It could happen that a file cannot be scanned if that file is currently locked with an exclusive lock because it is currently being written. That should be ok, the antivirus would rescan it later (assuming that it is able to skip such errors).
@VicDeo please confirm