# Samba mounts and File Locked error

**URL:** <https://help.nextcloud.com/t/samba-mounts-and-file-locked-error/7116>\
**Category:** ℹ️ Support\
**Created:** [January 4, 2017, 8:19pm UTC](https://help.nextcloud.com/t/samba-mounts-and-file-locked-error/7116 "2017-01-04T20:19:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Nix](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ryan_nix/32/14529_2.png) [@Ryan\_Nix](https://help.nextcloud.com/u/Ryan_Nix)\
**Post date:** [January 4, 2017, 8:19pm UTC](https://help.nextcloud.com/t/samba-mounts-and-file-locked-error/7116/1 "2017-01-04T20:19:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/6_449c533f586939b6e5f246632a46421f.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [January 4, 2017, 8:39pm UTC](https://help.nextcloud.com/t/samba-mounts-and-file-locked-error/7116/2 "2017-01-04T20:39:23Z")

</div>

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

> [@File is locked - how to unlock](https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883):
>
> You can’t access files because they are locked and you find such errors in your logfile: {"reqId":"0DijSqEkfOg2iyh9VD8J","remoteAddr":"xx.xx.xx.xx","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 423 \\\"path\\\/file.extension\\\" is locked\",\"Exception\":\"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Exception\\\\FileLocked\",\"Code\":0,\"Trace\":\"#0 Manually disable locking state: put Nextcloud in maintenance mode: edit config/config.php and change this line: 'maintenance' =\> tr…

---

<div class="post-metadata">

**Author:** ![Ryan\_Nix](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ryan_nix/32/14529_2.png) [@Ryan\_Nix](https://help.nextcloud.com/u/Ryan_Nix)\
**Post date:** [January 5, 2017, 4:23pm UTC](https://help.nextcloud.com/t/samba-mounts-and-file-locked-error/7116/3 "2017-01-05T16:23:11Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Ryan\_Nix](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ryan_nix/32/14529_2.png) [@Ryan\_Nix](https://help.nextcloud.com/u/Ryan_Nix)\
**Post date:** [January 5, 2017, 4:24pm UTC](https://help.nextcloud.com/t/samba-mounts-and-file-locked-error/7116/4 "2017-01-05T16:24:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/6_449c533f586939b6e5f246632a46421f.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [January 5, 2017, 9:02pm UTC](https://help.nextcloud.com/t/samba-mounts-and-file-locked-error/7116/5 "2017-01-05T21:02:25Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Ryan\_Nix](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ryan_nix/32/14529_2.png) [@Ryan\_Nix](https://help.nextcloud.com/u/Ryan_Nix)\
**Post date:** [January 5, 2017, 9:43pm UTC](https://help.nextcloud.com/t/samba-mounts-and-file-locked-error/7116/6 "2017-01-05T21:43:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/6_449c533f586939b6e5f246632a46421f.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [January 5, 2017, 10:09pm UTC](https://help.nextcloud.com/t/samba-mounts-and-file-locked-error/7116/7 "2017-01-05T22:09:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ryan\_Nix](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ryan_nix/32/14529_2.png) [@Ryan\_Nix](https://help.nextcloud.com/u/Ryan_Nix)\
**Post date:** [January 5, 2017, 10:34pm UTC](https://help.nextcloud.com/t/samba-mounts-and-file-locked-error/7116/8 "2017-01-05T22:34:55Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Ryan\_Nix](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ryan_nix/32/14529_2.png) [@Ryan\_Nix](https://help.nextcloud.com/u/Ryan_Nix)\
**Post date:** [January 16, 2017, 3:40pm UTC](https://help.nextcloud.com/t/samba-mounts-and-file-locked-error/7116/9 "2017-01-16T15:40:00Z")

</div>

Thanks again for your help. mod\_php did the trick 🙂

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 2, 2024, 12:33pm UTC](https://help.nextcloud.com/t/samba-mounts-and-file-locked-error/7116/10 "2024-12-02T12:33:52Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 9, 2024, 1:11pm UTC](https://help.nextcloud.com/t/samba-mounts-and-file-locked-error/7116/11 "2024-12-09T13:11:34Z")

</div>


