1

I am using ubuntu on vmware virtual machine for testing my php projects. I have there installed nginx, php7.0-fpm, mysql.

My shares are located on windows 10 and mounted to virtual machine using cifs and fstab:

//192.168.100.1/projects  /mnt/projects cifs   credentials=/home/magic/.smbcredentials,cache=none,file_mode=0777,dir_mode=0777,noperm,rsize=16384,wsize=16384,noacl,sec=ntlm,nobrl  0 0

It works great most of the time. But on big project, where many file has to be read for compilation, I am getting input/output error during php script life:

Warning: include(/mnt/projects/magento2/magento2/vendor/magento/framework/Component/ComponentRegistrarInterface.php): failed to open stream: Input/output error in /mnt/projects/magento2/magento2/vendor/composer/ClassLoader.php on line 444

The error linking to random file each time. Usually problem happens when there is multiple requests coming to php-fpm. for example

  1. first request is compiling the sources and reading the files
  2. second started in parallel, which means php start second process where can be read same files
  3. compilation process are fails in both above prcocesses at random stage

The problem not happens when there is no concurrent php requests. So when there is just single request - php successfully completes compilation work. (not often, but in single request the error also happens)

It behaves like the error coming from netwrok level. Something killing the file read process when new file read request detected.

I was digging into samba configuration, cifs configuration. Upgraded to latest version cifs-utils and samba. But did not got any success still.

All what I was able to do is just limit php fpm processes to 1. Which is not good decision because even with one child - the error happens some time.

Is there a way to find out what causing this or to solve this?

0

I solved similar issue by specifying protocol version 2.0

mount -t cifs -o username=user,password=passwd,vers=2.0 /host/shared /mnt/project

There are several different versions of SMB used by Windows operating systems:

  • CIFS – The ancient version of SMB that was part of Microsoft Windows NT 4.0 in 1996. SMB1 supersedes this version.
  • SMB 1.0 (or SMB1) – The version used in Windows 2000, Windows XP, Windows Server 2003 and
  • SMB 2.0 – The version used in Windows Vista (SP1 or later) and Windows Server 2008
  • SMB 2.1 (or SMB2.1) – The version used in Windows 7 and Windows Server 2008 R2
  • SMB 3.0 (or SMB3) – The version used in Windows 8 and Windows Server 2012

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.