[Vagrant] Changing page status causes error

When I try to change the page status from unlisted to listed or vice versa, I get this error in a popup

file_get_contents(/home/vagrant/Code/mywebsite.test/content/home/home.txt): Failed to open stream: No such file or directory

The page does indeed update but I have to refresh the panel to see the status has changed.

Here is the console log

XHR GET
https://mywebsite.test/panel/pages/home
[HTTP/1.1 500 Internal Server Error 23ms]

Error: The request to https://mywebsite.test/panel/pages/home failed
    uu https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    mu https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    hu https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    request https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    get https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    open https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    load https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    open https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    reload https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    success https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    submit https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    VueJS 4
    submit https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    VueJS 4
    submit https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    VueJS 25
    open https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    load https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    open https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    open https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    open https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
    click https://mywebsite.test/media/panel/63715b63ee49d5fe4844c2ecae071373/js/index.min.js:2
Caused by: undefined
{
  "info": {
    "kirby": "4.3.1",
    "php": "8.3.1",
    "server": "Apache/2.4.52 (Ubuntu)",
    "license": "Unregistered",
    "languages": []
  },
  "security": [
    "Debugging must be turned off in production"
  ],
  "plugins": [
    {
      "name": "distantnative/retour",
      "version": "5.2.2"
    },
    {
      "name": "tobimori/dreamform",
      "version": "1.4.1"
    }
  ]
}

Any help would be greatly appreciated. Thank you!

FIXED!

Special thanks to @bvdputte and @piotrek for their messages with @piotrek question Homestead – "Failed to open stream: No such file or directory" after changing page status

Here is what I did to solve my problem:

On my host machine (Ubuntu), I followed these instructions to install NFS

At a terminal prompt enter the following command to install the NFS Server:

sudo apt install nfs-kernel-server

To start the NFS server, you can run the following command at a terminal prompt:

sudo systemctl start nfs-kernel-server.service

I then added type: "nfs" to my folder configuration in the Homestead.yaml file

folders:
  - map: ~/Code
    to: /home/vagrant/Code
    type: "nfs"

I started vagrant with the vagrant reload --provision command

Vagrant prompted me to enter the password for the host machine so it could finish setting up NFS

==> homestead: Configuring and enabling network interfaces...
==> homestead: Installing NFS client...
==> homestead: Exporting NFS shared folders...
==> homestead: Preparing to edit /etc/exports. Administrator privileges will be required...
[sudo] password for neville: 
==> homestead: Mounting NFS shared folders...
==> homestead: Mounting shared folders...
    homestead: /vagrant => /home/neville/Homestead

I didn’t have to change the etc/nfs.conf file myself. I think Vagrant took care of any changes required

All in all, this issue that I thought was Kirby related was just a Vagrant issue and was incredibly easy to fix.

1 Like