Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Sail failed to run artisan migrate

I have successfully install Laravel with Sail, the app is just fine, I can run it using sail up. however I am unable to migrate the database, everytime I run sail artisan migrate the following error thrown.

There is no existing directory at "/home/dariel/www/2021/nsmart/storage/logs" and it could not be created: Permission denied

  at vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:172
    168▕             set_error_handler([$this, 'customErrorHandler']);
    169▕             $status = mkdir($dir, 0777, true);
    170▕             restore_error_handler();
    171▕             if (false === $status && !is_dir($dir)) {
  ➜ 172▕                 throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and it could not be created: '.$this->errorMessage, $dir));
    173▕             }
    174▕         }
    175▕         $this->dirCreated = true;
    176▕     }

      +10 vendor frames 
  11  [internal]:0
      Illuminate\Foundation\Bootstrap\HandleExceptions::handleException()

I am stuck at this point, any help would be appreciated. thanks in advance.

like image 737
Dariel Pratama Avatar asked Sep 19 '25 06:09

Dariel Pratama


1 Answers

You can try this

php artisan route:clear;
php artisan config:clear;
php artisan cache:clear;
sail artisan migrate;
like image 108
Hosam Elzagh Avatar answered Sep 20 '25 20:09

Hosam Elzagh