3

I tried to deploy a Laravel app on gcloud using the following steps tutorial but it gives these error There is no existing directory at "/user/home/appname/storage/logs" and its not buildable: Permission denied and this directory is on my machine

I edited my composer.json as follows

"scripts": {
    "post-autoload-dump": [
        "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
        "@php artisan optimize:clear",            
        "@php artisan package:discover --ansi"
    ],
    "post-root-package-install": [
        "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-install-cmd": [
    "Illuminate\\Foundation\\ComposerScripts::postInstall",
    "php artisan optimize"
    ],
    "gcp-build": [
                    "composer install --no-dev"
                ],
    "post-deploy-cmd": [
    "chmod -R 755 bootstrap\/cache",
    "php artisan cache:clear",
    "php artisan config:clear",
    "chmod -R 755 storage\/logs"  ],
    "post-create-project-cmd": [
        "@php artisan key:generate --ansi"
    ]
}

it gives the following error in the middle of build gcloud app deploy

Step #1: Generating optimized autoload files
Step #1: > Illuminate\Foundation\ComposerScripts::postAutoloadDump
Step #1: > @php artisan optimize:clear
Step #1: 
Step #1: In StreamHandler.php line 172:
Step #1:                                                                                
Step #1:   There is no existing directory at "/home/brehan/work/gothired/got_hired/sto  
Step #1:   rage/logs" and its not buildable: Permission denied                          
Step #1:                                                                                
Step #1: 
Step #1: > @php artisan package:discover --ansi
Step #1: 
Step #1: In StreamHandler.php line 172:
Step #1:                                                                                
Step #1:   There is no existing directory at "/home/user/appname/sto  
Step #1:   rage/logs" and its not buildable: Permission denied                          
Step #1:                                                                                
Step #1: 
Step #1: > Illuminate\Foundation\ComposerScripts::postInstall
Step #1: > php artisan optimize
Step #1: 
Step #1: In StreamHandler.php line 172:
Step #1:                                                                                
Step #1:   There is no existing directory at "/home/brehan/work/gothired/got_hired/sto  
Step #1:   rage/logs" and its not buildable: Permission denied 
HK boy
  • 1,398
  • 11
  • 17
  • 25
  • 3
    `chmod -R 775 storage` and possibly `chown` https://stackoverflow.com/a/23412543/4705339 – senty Dec 28 '19 at 15:24
  • Confirm that the user you are using in order to perform the build does have the necessary permissions on the folder. This is a permissions issue on your local machine that can be solved with the comment above. – rsalinas Dec 30 '19 at 08:57

0 Answers0