Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Install Errors Out With "Invalid Cache Path" When Running "php artisan install --only-user" Inside Container #107

Open
Majoraslayer opened this issue Jul 12, 2024 · 7 comments

Comments

@Majoraslayer
Copy link

I'm following the guide here for a Docker install --> https://benotes.org/docs/installation/docker

Note, I'm running on Debian Bullseye. When I reach the step to run "php artisan install --only-user" inside of the container, I get the following output:

   InvalidArgumentException

  Please provide a valid cache path.

  at vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php:36
     32▕      */
     33▕     public function __construct(Filesystem $files, $cachePath)
     34▕     {
     35▕         if (! $cachePath) {
  ➜  36▕             throw new InvalidArgumentException('Please provide a valid cache path.');
     37▕         }
     38▕
     39▕         $this->files = $files;
     40▕         $this->cachePath = $cachePath;

      +20 vendor frames
  21  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}(Object(Facade\Ignition\IgnitionServiceProvider))

      +5 vendor frames
  27  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
@adelina2kx
Copy link

i hava this issue too

@fr0tt
Copy link
Owner

fr0tt commented Jul 15, 2024

Are you using a volume or a bind mount for the storage directory (or in other words, did you alter the command) ?

@Majoraslayer
Copy link
Author

Are you using a volume or a bind mount for the storage directory (or in other words, did you alter the command) ?

I'm using volume mounting, but I did alter the command to replace $PWD with the absolute path to the mount point.

@fr0tt
Copy link
Owner

fr0tt commented Jul 18, 2024

That's rather strange.

Can you check if the directory storage/framework/cache/data inside the container exists ?

Could be a permission issue, but they usually don't appear using named volumes.

@Majoraslayer
Copy link
Author

That's rather strange.

Can you check if the directory storage/framework/cache/data inside the container exists ?

Could be a permission issue, but they usually don't appear using named volumes.

That directory indeed does not exist. The storage directory only contains database.sqlite and a logs directory.

@fr0tt
Copy link
Owner

fr0tt commented Jul 21, 2024

Seems the container can't copy the data into the volume, yet somehow manage to copy some data.

You can try to stop the container and delete the volume with docker volume rm benotes_storage and see if it works this time.

@RoySRC
Copy link

RoySRC commented Aug 8, 2024

This fixed the problem for me. There was nothing in the /storage directory other than the logs:

    volumes:
      - .env:/var/www/.env
      - ./data/storage/app/public/thumbnails:/var/www/storage/app/public/thumbnails
      - ./data/storage/backup:/var/www/storage/backup
      - ./data/storage/logs:/var/www/storage/logs
      # or instead one named volume to rule them all:   
      #- ./benotes_storage:/var/www/storage
      # this is optional (either way):
      #- ./data/nginx/logs/:/var/lib/nginx/logs/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants