简体   繁体   中英

Angular Universal 13 and Angularfire 7 -> Google App Engine deployment error

After upgrading my app from Angular 12 to Angular 13 I can not deploy my project to Google App Engine.

The error message I got is:

ERROR: (gcloud.app.deploy) Error Response: [9] An internal error occurred while processing task /app-engine-flex/flex_await_healthy/flex_await_healthy>2022-06-13T16:41:52.218Z5714.hx.1: An internal error occurred while creating your deployment. Please try again later or contact Google Support.

I reported this problem to Google Cloud Support but it is still unsolved.

Does anybody have an Angular Universal 13 + Angular Material + Angularfire app and could share with me a package.json file? I'd like to compare which versions of packages should I use, because I suspect that some package mismatches may bring conflicts...

My package.json file is:

{
    "name": "my-project-name",
    "version": "1.0.0",
    "scripts": {
      "ng": "ng",
      "start:dev": "ng serve",
      "build": "ng build",
      "test": "ng test",
      "lint": "ng lint",
      "e2e": "ng e2e",
      "dev:ssr": "ng run myProjectName:serve-ssr",
      "serve:ssr": "node dist/myProjectName/server/main.js",
      "build:ssr": "ng build --configuration production && ng run myProjectName:server",
      "prerender": "ng run myProjectName:prerender",
      "prepare": "npm run build:ssr",
      "start": "npm run serve:ssr"
    },
    "private": true,
    "dependencies": {
      "@angular-material-components/datetime-picker": "^7.0.1",
      "@angular/animations": "~13.3.10",
      "@angular/cdk": "^13.3.7",
      "@angular/common": "~13.3.10",
      "@angular/compiler": "~13.3.10",
      "@angular/core": "~13.3.10",
      "@angular/fire": "^7.3.0",
      "@angular/forms": "~13.3.10",
      "@angular/material": "^13.3.7",
      "@angular/material-moment-adapter": "^13.3.7",
      "@angular/platform-browser": "~13.3.10",
      "@angular/platform-browser-dynamic": "~13.3.10",
      "@angular/platform-server": "~13.3.10",
      "@angular/router": "~13.3.10",
      "@ngneat/dirty-check-forms": "^2.0.0",
      "@nguniversal/express-engine": "^13.1.1",
      "algoliasearch": "^3.35.1",
      "compression": "^1.7.4",
      "domino": "^2.1.6",
      "express": "^4.15.2",
      "firebase": "^9.1.0",
      "html2canvas": "^1.1.3",
      "instantsearch.css": "^7.4.5",
      "instantsearch.js": "^3.7.0",
      "jspdf": "^2.3.1",
      "memory-cache": "^0.2.0",
      "moment": "^2.29.1",
      "ngx-infinite-scroll": "^13.0.2",
      "rxfire": "^6.0.3",
      "rxjs": "^6.6.0",
      "tslib": "^2.0.0",
      "zone.js": "~0.11.4"
    },
    "devDependencies": {
      "@angular-devkit/architect": "^0.1400.0",
      "@angular-devkit/build-angular": "~13.3.7",
      "@angular/cli": "^13.3.7",
      "@angular/compiler-cli": "~13.3.10",
      "@nguniversal/builders": "^13.1.1",
      "@types/algoliasearch": "^3.34.11",
      "@types/express": "^4.17.0",
      "@types/jasmine": "~3.6.0",
      "@types/jasminewd2": "~2.0.3",
      "@types/node": "^17.0.35",
      "codelyzer": "^6.0.0",
      "eslint": "^7.13.0",
      "eslint-plugin-import": "^2.22.1",
      "firebase-admin": "^8.10.0",
      "firebase-functions": "^3.6.0",
      "firebase-functions-test": "^0.2.2",
      "firebase-tools": "^10.0.0",
      "fuzzy": "^0.1.3",
      "inquirer": "^6.2.2",
      "inquirer-autocomplete-prompt": "^1.0.1",
      "jasmine-core": "~4.0.0",
      "jasmine-spec-reporter": "~5.0.0",
      "karma": "~6.3.4",
      "karma-chrome-launcher": "~3.1.0",
      "karma-coverage-istanbul-reporter": "~3.0.2",
      "karma-jasmine": "~4.0.0",
      "karma-jasmine-html-reporter": "^1.5.0",
      "open": "^7.0.3",
      "prettier": "2.1.2",
      "protractor": "~7.0.0",
      "ts-node": "~8.3.0",
      "tslint": "~6.1.0",
      "tslint-config-prettier": "^1.18.0",
      "typescript": "^4.6.3"
    }
  }

app.yaml file is:

runtime: nodejs
env: flex
instance_class: F4
resources:
  memory_gb: 4
  disk_size_gb: 35
automatic_scaling:
  max_concurrent_requests: 55
readiness_check:
  app_start_timeout_sec: 1800

Thanks in advance

The following error might occur when deploying to an existing App Engine flexible version,refer the documentation here [1],

ERROR: (gcloud.app.deploy) Error Response: [9] An internal error occurred while processing task /app-engine-flex/flex_await_healthy/flex_await_healthy>2022-06-13T16:41:52.218Z5714.hx.1: An internal error occurred while creating your deployment. Please try again later or contact Google Support.

This error indicates that updating an unhealthy deployment with a working docker image doesn't always result in a healthy deployment. The outcome depends on the state of instances from the unhealthy deployment. Despite the error, if you provide a good docker image, the deployment might eventually become healthy. Updating an existing version with a new docker image, though allowed,may not be a good idea.

Here are some steps you can follow to fix or narrow down the error:

Try to deploy a test app to see the differences in configuration.
Try deploying your app after updating the gcloud with the gcloud components update command.
Make sure you run the SDK as an Admin. If the error recurs, run the gcloud app deploy app.yaml --verbosity=debug to try getting a more specified error and share to check on this further.

Also, you may refer to the Github link [2],to get an example sample for the package json.

[1]: https://cloud.google.com/appengine/docs/troubleshooting#errors_when_deploying_to_an_existing_flexible_environment_version

[2]: https://github.com/ui-router/sample-app-angular/blob/master/package.json

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM