The /app/bootstrap/cache directory must be present and writable.

1,433 views
Skip to first unread message

Bilal Haidar

unread,
Jun 11, 2021, 10:46:23 AM6/11/21
to Google App Engine

Hello,

Suddenly, I started getting the following error while running Google Cloud Build:

---
Step #3: Step #2: Generating optimized autoload files
Step #3: Step #2: > Illuminate\Foundation\ComposerScripts::postAutoloadDump
Step #3: Step #2: > @php artisan package:discover --ansi
Step #3: Step #2:
Step #3: Step #2: In PackageManifest.php line 177:
Step #3: Step #2:
Step #3: Step #2: The /app/bootstrap/cache directory must be present and writable.
Step #3: Step #2:
Step #3: Step #2:
Step #3: Step #2: Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Step #3: Step #2: error building image: error building stage: waiting for process to exit: exit status 1
Step #3: Finished Step #2
Step #3: ERROR
----

This is my composer section:
"scripts": {
    "post-autoload-dump": [
      "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
      "@php artisan package:discover --ansi"
    ],
    "post-root-package-install": [
      "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
      "@php artisan key:generate --ansi"
    ],
    "post-install-cmd": [
      "find .\/bootstrap\/cache -type d -exec chmod g+s {} \\;",
      "find .\/storage -type d -exec chmod g+s {} \\;",
      "chmod -R 755 .\/bootstrap\/cache",
      "chmod -R 755 .\/storage\/logs",
      "php artisan cache:clear",
      "php artisan route:cache",
      "php artisan config:cache",
      "php artisan view:cache"
    ],
    "post-update-cmd": [
      "Illuminate\\Foundation\\ComposerScripts::postUpdate"
    ]
  },

This is my cloudbuild file:
steps:
  - name: 'gcr.io/cloud-builders/gsutil'
    args: [ 'rsync', 'gs://$_BUCKET/', './' ]
  - name: node:14.0.0
    entrypoint: npm
    args: ['install']
  - name: node:14.0.0
    entrypoint: npm
    args: ['run', 'prod-all']
  - name: 'gcr.io/cloud-builders/gcloud'
    args: ['beta', 'app', 'deploy', '--project', '$PROJECT_ID', '-q', '$_GAE_PROMOTE', '-v', '$_GAE_VERSION']
timeout: '3600s'

It was working just this morning, I am not sure what happened.


Thanks
Bill

George (Cloud Platform Support)

unread,
Jun 14, 2021, 11:56:30 AM6/14/21
to Google App Engine
Hello Bill, 

To thoroughly investigate this issue one needs access to private data, such as project numbers. Such information should not be published here, or in any other publicly visible thread.  

As this issue is specific to your app, you should either contact a GCP Support Engineer, or, if you think this is GCP-related, you should open an issue in the Public Issue Tracker, marking it as private. Publicly visible postings as in this Group are not the proper way to report an issue, as often private information items such as project numbers are requested. 

Bilal Haidar

unread,
Jun 14, 2021, 1:34:05 PM6/14/21
to Google App Engine
Hi George,

I wasn't able to understand what happened to be honest! I reverted a few commits, and it works again. I must have messed with the vendor folder somehow!

Thanks again

Abel (Google Cloud Platform Support)

unread,
Jun 16, 2021, 9:54:54 AM6/16/21
to Google App Engine

Hello George,

Can you confirm that this issue is now solved?

Kind regards.
Reply all
Reply to author
Forward
0 new messages