laravel / homestead

MIT License
3.85k stars 1.45k forks source link

Issue with NFS on Windows #1966

Closed slobich closed 2 months ago

slobich commented 2 months ago

When I add NFS support to a site I get this error when I try to visit the site in the browser:

Notice: Unknown: Read of 253 bytes failed with errno=5 Input/output error in Unknown on line 0

Fatal error: Failed opening required '/home/vagrant/code/public/index.php' (include_path='.:/usr/share/php') in Unknown on line 0

If I remove type: "nfs" everything works as expected.

I have vagrant-winnfsd plugin installed and if I use an earlier version of homestead NFS works as expected.

Versions

Host operating system

Windows Edition Windows 10 Pro Version 22H2 Installed on ‎25.‎3.‎2024. OS build 19045.4239 Experience Windows Feature Experience Pack 1000.19055.1000.0

Homestead.yaml

---
ip: "192.168.56.56"
memory: 2048
cpus: 2
provider: virtualbox

authorize: C:\Users\Neuralab\.ssh\id_ed25519.pub

keys:
    - C:\Users\Neuralab\.ssh\id_ed25519

folders:
    - map: C:\Users\Neuralab\code
      to: /home/vagrant/code
      type: "nfs"

sites:
    - map: homestead.test
      to: /home/vagrant/code/public

databases:
    - homestead

features:
    - mariadb: false
    - postgresql: false
    - ohmyzsh: false
    - webdriver: false

services:
    - enabled:
          - "mysql"
#    - disabled:
#        - "postgresql@11-main"

#ports:
#    - send: 33060 # MySQL/MariaDB
#      to: 3306
#    - send: 4040
#      to: 4040
#    - send: 54320 # PostgreSQL
#      to: 5432
#    - send: 8025 # Mailpit
#      to: 8025
#    - send: 9600
#      to: 9600
#    - send: 27017
#      to: 27017

Vagrant destroy & up output

https://gist.github.com/slobich/fd4eacc924eba473ef285e4f5b54bdea

Expected behavior

I should be able to access the site via http://homestead.test/

Actual behavior

When I add NFS support to a site I get this error when I try to visit the site in the browser:

Notice: Unknown: Read of 253 bytes failed with errno=5 Input/output error in Unknown on line 0

Fatal error: Failed opening required '/home/vagrant/code/public/index.php' (include_path='.:/usr/share/php') in Unknown on line 0

If I remove type: "nfs" everything works as expected.

Steps to reproduce

  1. Install Homestead on Windows computer as described here.
  2. Enable NFS as described here.
  3. Provision the server.
  4. Create an index,php file in the public directory.
  5. Try to access http://homestead.test/.
svpernova09 commented 2 months ago

https://developer.hashicorp.com/vagrant/docs/synced-folders/nfs

image

slobich commented 2 months ago

@svpernova09 Thank you for the info but as I mentioned I'm using Vagrant WinNFSd and NFS was working with that plugin in older versions of Homestead and didn't throw a 500 error if a site had type: "nfs" in Homestead.yaml. Hope you can help :)...

svpernova09 commented 2 months ago

@svpernova09 Thank you for the info but as I mentioned I'm using Vagrant WinNFSd and NFS was working with that plugin in older versions of Homestead and didn't throw a 500 error if a site had type: "nfs" in Homestead.yaml. Hope you can help :)...

I'm sorry I can't, I actively avoid using NFS with Vagrant and I don't have the bandwidth to triage/troubleshoot WinNFSd. If you discover a fix is required on the Homestead side I'd be happy to hear about it and or review a PR to bring it back to a functional status with Homestead.

slobich commented 2 months ago

@svpernova09 No problem. I'm a little bit out of my depth with NFS but if I find out something that could fix this I'll post it here or make a PR. In any case thank you for replying.

svpernova09 commented 2 months ago

I would try removing the NFS configuration and see if the default folder sharing works.

slobich commented 2 months ago

@svpernova09 Without the type: "nfs" entry in Homestead.yaml everything works as expected. It's just when I add type: "nfs" the issue happens. I'll try to debug in more detail and if I find out something useful I'll post it here.