Samba mounts and File Locked error

Hello,

I’m trying to move a file, roughly 350 MBs in size, from the default location in my Nextcloud account to the mounted SMB share. I’m doing this through the Move drop down menu. This function works fine for smaller files <10 MBs, but not for larger ones. We’re running Apache 2.4 with PHP 7.0 and the libphpsmb 8.0 is installed and I verified it’s working.

Here is the error in the log file:

webdav	OCA\DAV\Connector\Sabre\Exception\FileLocked: HTTP/1.1 423 "Christmas 2016.mp4.zip" is locked

/home/nextcloud/public_html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 642: OCA\DAV\Connector\Sabre\ObjectTree->move(‘Christmas 2016…’, ‘SMB/Christmas 2…’)
[internal function] Sabre\DAV\CorePlugin->httpMove(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/home/nextcloud/public_html/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/home/nextcloud/public_html/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit(‘method MOVE’, Array)
/home/nextcloud/public_html/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/home/nextcloud/public_html/apps/dav/appinfo/v1/webdav.php - line 60: Sabre\DAV\Server->exec()
/home/nextcloud/public_html/remote.php - line 165: require_once(’/home/nextcloud…’)
{main}

Has anyone else seen this? If is a PHP config error?

Thanks for any insights!

Ryan

Several people have seen this, therefore we have an FAQ article:

Thanks! I added Redis, which has helped, however, the initial issue is still happening.

ownCloud is only copying/moving half of the 342MB file to the SMB mounted share. Anything else I could check?

And now all of a sudden I’m getting:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

From the logs:

[Wed Jan 04 17:02:38.402251 2017] [authz_core:error] [pid 37696] [client 129.105.244.169:64313] AH01630: client denied by server configuration: /home/nextcloud/public_html/data/.ocdata
[Thu Jan 05 10:20:20.200937 2017] [fcgid:warn] [pid 14818] [client 10.102.3.215:51932] mod_fcgid: read data timeout in 31 seconds
[Thu Jan 05 10:20:20.210664 2017] [core:error] [pid 14818] [client 10.102.3.215:51932] End of script output before headers: remote.php
[Thu Jan 05 10:20:26.758567 2017] [authz_core:error] [pid 1890] [client 10.102.3.215:51950] AH01630: client denied by server configuration: /home/nextcloud/public_html/data/.ocdata
[Thu Jan 05 10:20:29.638443 2017] [authz_core:error] [pid 1893] [client 10.102.3.215:51945] AH01630: client denied by server configuration: /home/nextcloud/public_html/data/.ocdata
[Thu Jan 05 10:21:28.277933 2017] [fcgid:warn] [pid 35762] [client 10.102.3.215:51963] mod_fcgid: read data timeout in 31 seconds
[Thu Jan 05 10:21:28.278041 2017] [core:error] [pid 35762] [client 10.102.3.215:51963] End of script output before headers: cron.php
[Thu Jan 05 10:22:28.320927 2017] [fcgid:warn] [pid 1890] [client 10.102.3.215:52005] mod_fcgid: read data timeout in 31 seconds
[Thu Jan 05 10:22:28.321057 2017] [core:error] [pid 1890] [client 10.102.3.215:52005] End of script output before headers: v2.php

Restarting Apache helped, which is weird.

How fast is the connection between your server and the SMB storage?

Official support (and test) is only for mod_php. There are often some issues with mod_fcgid and I can’t tell you if there are some general restrictions or if it’s just have to figure out a good setup (in contrast to mod_php or nginx, there is no example config to start from).

Thanks for all the help!

The speed between Nextcloud and the Samba server is pretty quick. It’s definitely not a problem on our older CentOS 7.3 server with php 5.4 which isn’t using mod_fcgid. I’ll see what i can do to switch to using mod_php and see if this fixes things.

Thanks again,

Ryan

In most cases the redis-cache fixes the issue. Perhaps consider asking a developer, via IRC you can directly ask or perhaps even use a bug report. They know the code and can probably give better advice what could be wrong here.

Using redis-cache definitely helped me get rid of the truncated file, which was locked before, so thank you for that one. I’m going to contact Virtualmin support to see if I can using mod_php instead of mod_fcgid. Hopefully this fixes things, and then I’m finally ready to switch to Nextcloud from ownCloud. Thanks again!

Thanks again for your help. mod_php did the trick :slight_smile: