angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.73k stars 11.98k forks source link

Breaking change between 17.3.1 and 17.3.2 causing failed Cloud Run deployments #27400

Closed LukeSchlangen closed 5 months ago

LukeSchlangen commented 5 months ago

Which @angular/* package(s) are the source of the bug?

core, platform-server, router

Is this a regression?

Yes

Description

The port seems to have changed from 4000 to 8080 for serve:ssr: between versions 17.3.1 and 17.3.2. This is a breaking change for Cloud Run deployments which expect Angular SSR applications to run on port 8080.

Reproduction steps

The steps fail to deploy to Cloud Run:

  1. npm init @angular@17.3.2 angular-17-3-2 -- --ssr
  2. cd angular-17-3-2
  3. gcloud run deploy --allow-unauthenticated

Failing Logs:

Cloud RunCreateServiceangular-17-3-2luke@cloudadvocacyorg.joonix.net {@type: type.googleapis.com/google.cloud.audit.AuditLog, authenticationInfo: {…}, authorizationInfo: […], methodName: google.cloud.run.v1.Services.CreateService, request: {…}, requestMetadata: {…}, resourceLocation: {…}, resourceName: namespaces/js-frameworks/services/angular-17-3-2, response: {…}, … 
Node Express server listening on http://localhost:4000
Default STARTUP TCP probe failed 1 time consecutively for container "angular-17-3-2-1" on port 8080. The instance was not started.

These same steps work for version 17.3.1

  1. npm init @angular@17.3.1 angular-17-3-1 -- --ssr
  2. cd angular-17-3-1
  3. gcloud run deploy --allow-unauthenticated

Successful Logs:

Cloud RunCreateServiceangular17-3-1luke@cloudadvocacyorg.joonix.net {@type: type.googleapis.com/google.cloud.audit.AuditLog, authenticationInfo: {…}, authorizationInfo: […], methodName: google.cloud.run.v1.Services.CreateService, request: {…}, requestMetadata: {…}, resourceLocation: {…}, resourceName: namespaces/js-frameworks/services/angular17-3-1, response: {…}, s… 
Node Express server listening on http://localhost:8080
Default STARTUP TCP probe succeeded after 1 attempt for container "angular17-3-1-1" on port 8080.

Please provide the exception or error you saw

Failing Logs:

Cloud RunCreateServiceangular-17-3-2luke@cloudadvocacyorg.joonix.net {@type: type.googleapis.com/google.cloud.audit.AuditLog, authenticationInfo: {…}, authorizationInfo: […], methodName: google.cloud.run.v1.Services.CreateService, request: {…}, requestMetadata: {…}, resourceLocation: {…}, resourceName: namespaces/js-frameworks/services/angular-17-3-2, response: {…}, … 
Node Express server listening on http://localhost:4000
Default STARTUP TCP probe failed 1 time consecutively for container "angular-17-3-2-1" on port 8080. The instance was not started.

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 17.3.2
Node: 20.11.1
Package Manager: npm 10.5.0
OS: linux x64

Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1703.2 (cli-only)
@angular-devkit/core         17.3.2 (cli-only)
@angular-devkit/schematics   17.3.2 (cli-only)
@schematics/angular          17.3.2 (cli-only)

Anything else?

Because the change seems to have happened between 17.3.1 and 17.3.2, I think it must be somewhere in these changes, but I can't pinpoint what would have caused it: https://github.com/angular/angular/compare/17.3.1...17.3.2

alan-agius4 commented 5 months ago

Closed via https://github.com/angular/angular-cli/pull/27399

dgp1130 commented 5 months ago

Like @alan-agius4 mentioned, this is likely caused by https://github.com/angular/angular-cli/pull/27333 and already rolled back in https://github.com/angular/angular-cli/pull/27399. I can do a release today to get that fix out.

dgp1130 commented 5 months ago

Release is out, should be fixed in 17.3.3.

LukeSchlangen commented 5 months ago

Tested. It works! Thank you!

angular-automatic-lock-bot[bot] commented 4 months ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.