laravel / homestead

MIT License
3.86k stars 1.45k forks source link

File permission issue after updating box #1883

Closed ligne13 closed 1 year ago

ligne13 commented 1 year ago

Versions

Host operating system

Mac OS 13.4

Homestead.yaml

---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: parallels
box: laravel/homestead-arm

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders::
    - map: ~/Documents/Work/_Sites/Test/back
      to: /home/vagrant/code/Test/back

sites:
    - map: test.test
      to: /home/vagrant/code/Test/back/public
      schedule: true
      php: "8.2"

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

services:
    - enabled:
          - "mysql"

Expected behavior

Should be able to write to storage directory (and bootstrap directory).

Actual behavior

Writing into storage directory is denied. I've checked permissions, they seem OK. I also tried to change permissions to www-data:www-data but without success. I have reloaded homestead, without success. This was working fine before updating the box.

$ ls -la
total 3436
drwxr-xr-x 1 vagrant vagrant    1312 Jun 20 10:06 .
drwxr-xr-x 8 root    root       4096 Jun 20 05:25 ..
drwxr-xr-x 1 vagrant vagrant    1184 Jun 20 03:32 app
-rw-r--r-- 1 vagrant vagrant    1686 Nov  9  2018 artisan
drwxr-xr-x 1 vagrant vagrant     128 Nov  9  2018 bootstrap
-rw-r--r-- 1 vagrant vagrant    2943 Dec  7  2020 CHANGELOG.md
-rw-r--r-- 1 vagrant vagrant    3139 Jun 20 06:52 composer.json
-rw-r--r-- 1 vagrant vagrant  499952 Jun 20 09:08 composer.lock
drwxr-xr-x 1 vagrant vagrant     864 Jun 12 09:32 config
drwxr-xr-x 1 vagrant vagrant     224 Dec  7  2020 database
-rw-r--r-- 1 vagrant vagrant    3492 Jun 12 08:30 .env
-rw-r--r-- 1 vagrant vagrant    1959 Feb  8 07:31 .env.example
-rw-r--r-- 1 vagrant vagrant     211 Dec  7  2020 .gitignore
drwxr-xr-x 1 vagrant vagrant      96 Sep 18  2022 lang
drwxr-xr-x 1 vagrant vagrant   24672 Jun 20 10:06 node_modules
-rw-r--r-- 1 vagrant vagrant    1240 Jun 20 10:05 package.json
-rw-rw-r-- 1 vagrant vagrant  639336 Jun 20 10:06 package-lock.json
-rw-r--r-- 1 vagrant vagrant     756 Dec  7  2020 phpcs.xml
-rw-r--r-- 1 vagrant vagrant    1084 Jun 20 06:33 phpunit.xml
drwxr-xr-x 1 vagrant vagrant     384 Jun 21 02:34 public
-rw-r--r-- 1 vagrant vagrant    3729 Jun 20 09:11 README.md
drwxr-xr-x 1 vagrant vagrant     160 Sep 18  2022 resources
drwxr-xr-x 1 vagrant vagrant     192 May 17 11:45 routes
-rw-r--r-- 1 vagrant vagrant     563 Nov  9  2018 server.php
drwxr-xr-x 1 vagrant vagrant     256 Jun 21 02:20 storage
-rw-r--r-- 1 vagrant vagrant     181 Dec  7  2020 .styleci.yml
drwxr-xr-x 1 vagrant vagrant     160 Sep 28  2022 tests
drwxr-xr-x 1 vagrant vagrant    2304 Jun 20 09:08 vendor
-rw-r--r-- 1 vagrant vagrant     537 Nov  9  2018 webpack.mix.js

The error displayed in the browser :

The stream or file "/home/vagrant/code/Test/back/storage/logs/laravel-2023-06-21.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The /home/vagrant/code/Test/back/bootstrap/cache directory must be present and writable.

I don't understand... thanks !

ligne13 commented 1 year ago

OK, no idea what happened, but I destroyed the box and recreated it and now it works.