{"id":576,"date":"2025-05-11T18:37:28","date_gmt":"2025-05-11T09:37:28","guid":{"rendered":"https:\/\/tako.nakano.net\/blog\/?p=576"},"modified":"2025-05-11T19:05:37","modified_gmt":"2025-05-11T10:05:37","slug":"cloud-run-gen2-port-80-limitations","status":"publish","type":"post","link":"https:\/\/tako.nakano.net\/blog\/2025\/05\/cloud-run-gen2-port-80-limitations\/","title":{"rendered":"Cloud Run Gen 2: Uncovering Port 80 Limitations for Container Startup"},"content":{"rendered":"<h1>Cloud Run Gen 2: Uncovering Port 80 Limitations for Container Startup<\/h1>\n<p>English follows Japanese.<\/p>\n<h2>\u6982\u8981<\/h2>\n<p>Cloud Run \u306e The second generation \uff08Gen 2; \u7b2c2\u4e16\u4ee3\uff09\u306f\u3001Port 80 \u3067\u5f85\u3061\u53d7\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u3002\u30b3\u30f3\u30c6\u30ca\u306e\u8d77\u52d5\u30c1\u30a7\u30c3\u30af\u304c\u5931\u6557\u3059\u308b\u3002<br \/>\nCloud Run \u306e The first generation \uff08Gen 1; \u7b2c1\u4e16\u4ee3\uff09\u3067\u306f\u3001Port 80 \u3067\u5f85\u3061\u53d7\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u305f\u3002\u30b3\u30f3\u30c6\u30ca\u306e\u8d77\u52d5\u30c1\u30a7\u30c3\u30af\u306f\u6210\u529f\u3059\u308b\u3002<br \/>\n\u3053\u306e\u3053\u3068\u306f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u66f8\u304b\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3042\u308b\u3002<\/p>\n<p>Cloud Run \u306e\u4e16\u4ee3\u306f\u3001Cloud Run functions \u306e\u4e16\u4ee3\u3068\u306f\u7570\u306a\u308b\u3002<\/p>\n<h2>\u524d\u7f6e\u304d\uff08\u9577\u3044\uff09<\/h2>\n<p>Cloud Run \u306f\u300c\u30b5\u30fc\u30d3\u30b9\u5b9f\u884c\u74b0\u5883\u300d\u3068\u3057\u3066\u3001\u7b2c1\u4e16\u4ee3 (The first generation) \u3068\u7b2c2\u4e16\u4ee3 (The second generation) \u306e2\u3064\u306e\u4e16\u4ee3\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u3002\u3053\u308c\u306f\u3001Cloud Run functions \u306e Cloud Run functions\uff08\u7b2c1\u4e16\u4ee3\uff09\u3068 Cloud Run functions\uff08\u7b2c2\u4e16\u4ee3\uff09\u306e\u9055\u3044\u3068\u306f <strong>\u6839\u672c\u7684\u306b\u5225\u306e\u3082\u306e<\/strong> \u3067\u3042\u308b\u3002<\/p>\n<p>Cloud Run functions \u306b\u3064\u3044\u3066\u306f\u3001\u7b2c1\u4e16\u4ee3\u306f\u3001App Engine \u3068\u540c\u7b49\u306e\u74b0\u5883\u3067\u52d5\u3044\u3066\u3044\u305f\u3068\u63a8\u5bdf\u3055\u308c\u308b\u3082\u306e\u3067\u3001\u7b2c2\u4e16\u4ee3\u306f\u3001\u660e\u8a00\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u3001Cloud Run \u306e\u4e0a\u3067\u52d5\u3044\u3066\u3044\u308b\u3002\u7b2c1\u4e16\u4ee3\u3068\u7b2c2\u4e16\u4ee3\u306f\uff08\u5b8c\u5168\u306b\u306f\uff09\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u4e92\u63db\u6027\u304c\u306a\u3044\u305f\u3081\u3001\u79fb\u690d\u306b\u306f\u82e5\u5e72\u306e\u624b\u9593\u304c\u304b\u304b\u308b\u3002<\/p>\n<p>Cloud Run \u306b\u3064\u3044\u3066\u306f\u3001\u7b2c2\u4e16\u4ee3\u304c <a href=\"https:\/\/cloud.google.com\/run\/docs\/release-notes#December_06_2022\">2022-12-06<\/a> \u306b GA \u3068\u306a\u3063\u305f\u3053\u3068\u304c\u767a\u8868\u3055\u308c\u305f\u3002NFS, NDB, 9P, CIFS\/Samba, and Ceph \u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3001\u3053\u306e\u3053\u3068\u3067 Cloud Filestore \u3068 Cloud Storage FUSE \u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3068\u767a\u8868\u3055\u308c\u3066\u3044\u308b\u3002\u7b2c1\u4e16\u4ee3\u306f <a href=\"https:\/\/cloud.google.com\/run\/docs\/release-notes#November_14_2019\">2019-11-14<\/a> \u306b GA \u3068\u306a\u3063\u305f\u3053\u3068\u304c\u767a\u8868\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>\u7b2c1\u4e16\u4ee3\u3068\u7b2c2\u4e16\u4ee3\u306e\u9055\u3044\u306f<a href=\"https:\/\/cloud.google.com\/run\/docs\/container-contract?hl=ja\">\u30b3\u30f3\u30c6\u30ca \u30e9\u30f3\u30bf\u30a4\u30e0\u306e\u5951\u7d04<\/a>\u3068\u3044\u3046\u306a\u3093\u3068\u3082\u4e0d\u601d\u8b70\u306a\u30da\u30fc\u30b8\u3067\u3001\u89e3\u8aac\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<blockquote>\n<p>\u7b2c 1 \u4e16\u4ee3\u306e\u5b9f\u884c\u74b0\u5883\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001Cloud Run \u30b3\u30f3\u30c6\u30ca\u306f\u3001gVisor \u30b3\u30f3\u30c6\u30ca \u30e9\u30f3\u30bf\u30a4\u30e0 \u30b5\u30f3\u30c9\u30dc\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3057\u3066\u30b5\u30f3\u30c9\u30dc\u30c3\u30af\u30b9\u5316\u3055\u308c\u307e\u3059\u3002gVisor syscall \u4e92\u63db\u6027\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u3001\u3053\u306e\u30b3\u30f3\u30c6\u30ca \u30b5\u30f3\u30c9\u30dc\u30c3\u30af\u30b9\u3067\u306f\u4e00\u90e8\u306e\u30b7\u30b9\u30c6\u30e0\u30b3\u30fc\u30eb\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u7b2c 2 \u4e16\u4ee3\u306e\u5b9f\u884c\u74b0\u5883\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001Linux \u3068\u306e\u5b8c\u5168\u306a\u4e92\u63db\u6027\u304c\u3042\u308a\u307e\u3059\u3002Cloud Run \u30b8\u30e7\u30d6\u306f\u3001\u5e38\u306b\u7b2c 2 \u4e16\u4ee3\u306e\u5b9f\u884c\u74b0\u5883\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u7b2c 2 \u4e16\u4ee3\u306e\u5b9f\u884c\u74b0\u5883\u3067\u306f\u3001\/sys\/class\/dmi\/id\/product_name \u306f Google Compute Engine \u306b\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u7b2c 2 \u4e16\u4ee3\u306e\u5b9f\u884c\u74b0\u5883\u3067\u306f\u3001\u30b5\u30fc\u30d3\u30b9\u30b3\u30fc\u30c9\u304c\u5225\u306e\u30d7\u30ed\u30bb\u30b9\u540d\u524d\u7a7a\u9593\u3067\u5b9f\u884c\u3055\u308c\u308b\u305f\u3081\u3001\u7279\u5225\u306a\u30d7\u30ed\u30bb\u30b9 \u30bb\u30de\u30f3\u30c6\u30a3\u30af\u30b9\u3092\u6301\u3064\u30b3\u30f3\u30c6\u30ca init \u30d7\u30ed\u30bb\u30b9\u3068\u3057\u3066\u958b\u59cb\u3055\u308c\u307e\u3059\u3002\u7b2c 1 \u4e16\u4ee3\u306e\u5b9f\u884c\u74b0\u5883\u3067\u306f\u3001\u30b5\u30fc\u30d3\u30b9\u30b3\u30fc\u30c9\u306f\u30b3\u30f3\u30c6\u30ca init \u30d7\u30ed\u30bb\u30b9\u3068\u3057\u3066\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>Cloud Run \u306f\u7279\u6a29\u30b3\u30f3\u30c6\u30ca\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001Cloud Run \u306f\u3001gcsfuse \u3084 sudo \u306a\u3069\u3001\u975e root \u30e6\u30fc\u30b6\u30fc\u306b\u5bfe\u3057\u3066 setuid \u30d5\u30e9\u30b0\u3092\u4f7f\u7528\u3059\u308b\u30d0\u30a4\u30ca\u30ea\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u304a\u3089\u305a\u3001\u6a29\u9650\u304c\u4e0d\u5341\u5206\u306a\u305f\u3081\u306b\u5931\u6557\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<\/blockquote>\n<h2>\u554f\u984c\u306e\u767a\u751f<\/h2>\n<p>\u7d50\u8ad6\u304b\u3089\u8a00\u3046\u3068\u3001Port 80 \u3067\u5f85\u3061\u53d7\u3051\u3066\u3044\u308b\u3068\u5916\u304b\u3089\u63a5\u7d9a\u304c\u3067\u304d\u306a\u3044\u69d8\u5b50\u3060\u3063\u305f\u306e\u3060\u3002\u300c\u7279\u6a29\u300d\u306e\u554f\u984c\u3067\u3001Well-Known Port \u3067\u5f85\u3061\u53d7\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u306e\u304b\u3082\u3057\u308c\u306a\u3044\u3002\u305f\u3060\u3057\u3001Cloud Run \u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u306f\u3001Port 80 \u3067\u5f85\u3061\u53d7\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u3068\u306f\u66f8\u3044\u3066\u3044\u306a\u3044\u3002<\/p>\n<p>\u4eca\u56de\u3001\u3042\u308b\u30b3\u30f3\u30c6\u30ca\u3092\u3001\u7b2c1\u4e16\u4ee3\u304b\u3089\u7b2c2\u4e16\u4ee3\u306b\u5909\u66f4\u3057\u305f\u3068\u3053\u308d\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u3063\u305f<\/p>\n<ul>\n<li>\u4e00\u898b\u3059\u308b\u3068\u3001\u30b3\u30f3\u30c6\u30ca\u306f\u6b63\u5e38\u8d77\u52d5\u3057\u3066\u3044\u308b\u3088\u3046\u306b\u898b\u3048\u308b<\/li>\n<li>Startup Probe \u306e\u30a2\u30af\u30bb\u30b9\u30ed\u30b0\u304c\u51fa\u3066\u3044\u306a\u3044<\/li>\n<li>\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u304b\u3063\u305f\u3068\u3057\u3066\u3001Cloud Run \u306e\u30ed\u30b0\u306b\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3044\u308b<\/li>\n<\/ul>\n<p>Rails 8 \u304b\u3089\u306f\u3001Thruster \u304c\u5c0e\u5165\u3055\u308c\u3001Port 80 \u3067\u5f85\u3061\u53d7\u3051\u308b\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u3068\u3001\u80cc\u5f8c\u3067 Port 3000 \u3067\u5f85\u3061\u53d7\u3051\u308b Puma \u304c\u6a19\u6e96\u306e\u69cb\u6210\u3067\u3042\u308b\u3002Thruster \u306f\u3001Port 80 \u3067\u5f85\u3061\u53d7\u3051\u3066\u3044\u308b\u305f\u3081\u3001Container Port \u306b 80 \u3092\u6307\u5b9a\u3057\u3066\u3044\u305f\u304c\u3001Generation \u3092 Second \u306b\u5909\u66f4\u3057\u305f\u3060\u3051\u3067\u52d5\u4f5c\u3057\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u3002<\/p>\n<h2>\u691c\u8a3c<\/h2>\n<p>\u3042\u308b\u30b5\u30fc\u30d3\u30b9\u3001<code>structured-logging<\/code> \u306b\u3064\u3044\u3066\u3001Execution environment Default \u304b\u3089\u3001Execution environment Second generation \u306b\u5909\u66f4\u3057\u305f\u3002\u305d\u306e\u5f8c\u3001Cloud Logging \u306e\u30ed\u30b0\u3092\u78ba\u8a8d\u3057\u305f\u3068\u3053\u308d\u3001\u6b21\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3044\u305f\u3002<\/p>\n<p>\u8a2d\u5b9a: Execution environment Second<\/p>\n<p>\u691c\u8a3c1:<\/p>\n<ul>\n<li>Execution environment: Second<\/li>\n<li>Container Port: 80<\/li>\n<li>Container:\n<ul>\n<li>Thruster: Port 80<\/li>\n<li>Puma: Port 3000<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u7d50\u679c1:<\/p>\n<ul>\n<li>\u8d77\u52d5\u30d7\u30ed\u30fc\u30d6\u5931\u6557<\/li>\n<\/ul>\n<pre><code>2025-05-11 13:50:05.473 audit_log, method: &quot;google.cloud.run.v1.Services.ReplaceService&quot;, principal_email: &quot;test@example.com&quot;\n2025-05-11 13:50:20.308 {&quot;http&quot;:&quot;:80&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Server started&quot;}\n2025-05-11 13:50:21.695 =&gt; Booting Puma\n2025-05-11 13:50:21.695 =&gt; Rails 8.0.2 application starting in production \n2025-05-11 13:50:21.695 =&gt; Run `bin\/rails server --help` for more startup options\n2025-05-11 13:50:25.122 Puma starting in single mode...\n2025-05-11 13:50:25.122 * Puma version: 6.6.0 (&quot;Return to Forever&quot;)\n2025-05-11 13:50:25.122 * Ruby version: ruby 3.4.3 (2025-04-14 revision d0b7e5b6a0) +YJIT +PRISM [x86_64-linux]\n2025-05-11 13:50:25.123 *  Min threads: 3\n2025-05-11 13:50:25.123 *  Max threads: 3\n2025-05-11 13:50:25.123 *  Environment: production\n2025-05-11 13:50:25.123 *          PID: 22\n2025-05-11 13:50:25.123 * Listening on http:\/\/0.0.0.0:3000\n2025-05-11 13:50:25.127 Use Ctrl-C to stop\n2025-05-11 13:50:43.749 STARTUP HTTP probe failed 5 times consecutively for container &quot;structured-logging-1&quot; on port 80 path &quot;\/up&quot;. The instance was not started. Connection failed with status ERROR_CONNECTION_FAILED.\n2025-05-11 13:50:45.162 Ready condition status changed to False for Revision structured-logging-00023-z99 with message: The user-provided container failed the configured startup probe checks. Logs for this revision might contain more information.  Logs URL: https:\/\/console.cloud.google.com\/logs\/viewer?project=rails8-gcexample&amp;resource=cloud_run_revision\/service_name\/structured-logging\/revision_name\/structured-logging-00023-z99&amp;advancedFilter=resource.type%3D%22cloud_run_revision%22%0Aresource.labels.service_name%3D%22structured-logging%22%0Aresource.labels.revision_name%3D%22structured-logging-00023-z99%22  For more troubleshooting guidance, see https:\/\/cloud.google.com\/run\/docs\/troubleshooting#container-failed-to-start\n2025-05-11 13:50:45.228 Ready condition status changed to False for Service structured-logging with message: Revision &#039;structured-logging-00023-z99&#039; is not ready and cannot serve traffic. The user-provided container failed the configured startup probe checks. Logs for this revision might contain more information.  Logs URL: https:\/\/console.cloud.google.com\/logs\/viewer?project=rails8-gcexample&amp;resource=cloud_run_revision\/service_name\/structured-logging\/revision_name\/structured-logging-00023-z99&amp;advancedFilter=resource.type%3D%22cloud_run_revision%22%0Aresource.labels.service_name%3D%22structured-logging%22%0Aresource.labels.revision_name%3D%22structured-logging-00023-z99%22  For more troubleshooting guidance, see https:\/\/cloud.google.com\/run\/docs\/troubleshooting#container-failed-to-start<\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30f3\u30c6\u30ca\uff08Rails 8.0.2 \u6a19\u6e96\u306e\u69cb\u6210\uff09\u306f\u3001\u5b9f\u306f\u3001\u76f4\u63a5 Port 3000 \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001Thruster \u3092\u30d0\u30a4\u30d1\u30b9\u3057\u3066\u3001\u76f4\u63a5 Puma \u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u3088\u3063\u3066\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u8a66\u3057\u3066\u307f\u305f\u3002\u8af8\u4e8b\u60c5\u3067\u3001\u5225\u306e\u30b5\u30fc\u30d3\u30b9 myapp \u3067\u884c\u3063\u305f\u3002<\/p>\n<p>\u8a2d\u5b9a: \u69cb\u6210\u306f\u5909\u66f4\u305b\u305a\u3001Container Port \u3092 3000 \u306b\u5909\u66f4<\/p>\n<p>\u691c\u8a3c2:<\/p>\n<ul>\n<li>Execution environment: Second<\/li>\n<li>Container Port: 3000<\/li>\n<li>Container:\n<ul>\n<li>Thruster: Port 80<\/li>\n<li>Puma: Port 3000<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u7d50\u679c2:<\/p>\n<ul>\n<li>\u8d77\u52d5\u30d7\u30ed\u30fc\u30d6\u6210\u529f<\/li>\n<\/ul>\n<pre><code>2025-05-11T05:16:43.102033Z audit_log, method: &quot;google.cloud.run.v1.Services.ReplaceService&quot;, principal_email: &quot;test@example.com&quot;\n2025-05-11T05:16:50.568687Z GCSFuse is mounted with bucket myapp-database-2. Enable GCSFuse logging with mount options for more logs\n2025-05-11T05:17:01.485709218Z {&quot;http&quot;:&quot;:80&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Server started&quot;}\n2025-05-11T05:17:02.678599Z =&gt; Booting Puma\n2025-05-11T05:17:02.678612Z =&gt; Rails 8.0.2 application starting in production\n2025-05-11T05:17:02.678617Z =&gt; Run `bin\/rails server --help` for more startup options\n2025-05-11T05:17:05.612966Z Puma starting in single mode...\n2025-05-11T05:17:05.612978Z * Puma version: 6.6.0 (&quot;Return to Forever&quot;)\n2025-05-11T05:17:05.612982Z * Ruby version: ruby 3.4.3 (2025-04-14 revision d0b7e5b6a0) +YJIT +PRISM [x86_64-linux]\n2025-05-11T05:17:05.612985Z * Min threads: 3\n2025-05-11T05:17:05.612988Z * Max threads: 3\n2025-05-11T05:17:05.612991Z * Environment: production\n2025-05-11T05:17:05.612994Z * PID: 21\n2025-05-11T05:17:05.613469Z * Listening on http:\/\/0.0.0.0:3000\n2025-05-11T05:17:05.619894Z Use Ctrl-C to stop\n2025-05-11T05:17:06.376474Z STARTUP HTTP probe succeeded after 17 attempts for container &quot;myapp-1&quot; on port 3000 path &quot;\/up&quot;.\n2025-05-11T05:17:06.471410Z Ready condition status changed to True for Revision myapp-00008-jp7 with message: Deploying revision succeeded in 22.32s.\n2025-05-11T05:17:07.757828Z Ready condition status changed to True for Service myapp.<\/code><\/pre>\n<p>Thruster \u306f Port 80 \u3067\u5f85\u3061\u3064\u3064\u3001Startup probe \u306f <code>http:\/\/0.0.0.0:3000\/up<\/code> \u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u6210\u529f\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>Thruster \u306f\u3001\u74b0\u5883\u5909\u6570 <code>HTTP_PORT<\/code> \u306b 8080 \u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u30dd\u30fc\u30c8\u3092\u5909\u66f4\u3067\u304d\u308b <a href=\"https:\/\/github.com\/basecamp\/thruster#custom-configuration\">Custom configuration<\/a>\u3002\u3053\u3061\u3089\u3092\u8a2d\u5b9a\u3057\u3066\u3082\u3001\u554f\u984c\u306f\u306a\u304b\u3063\u305f\uff08\u30ed\u30b0\u306f\u5272\u611b\uff09\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u3001Cloud Run \u304c\u30b3\u30f3\u30c6\u30ca\u306b\u671f\u5f85\u3059\u308b Port \u3092 8080 \u306b\u5909\u66f4\u3057\u3066\u307f\u305f\u3002<\/p>\n<p>\u8a2d\u5b9a:<\/p>\n<ul>\n<li><code>HTTP_PORT<\/code> \u306b 8080 \u3092\u6307\u5b9a<\/li>\n<li>Container Port \u3092 8080 \u306b\u5909\u66f4<\/li>\n<\/ul>\n<p>\u691c\u8a3c3:<\/p>\n<ul>\n<li>Execution environment: Second<\/li>\n<li>Container Port: 8080<\/li>\n<li><code>HTTP_PORT<\/code>(Environment variable): 8080<\/li>\n<li>Container:\n<ul>\n<li>Thruster: Port <strong>8080<\/strong><\/li>\n<li>Puma: Port 3000<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u7d50\u679c3:<\/p>\n<ul>\n<li>\u8d77\u52d5\u30d7\u30ed\u30fc\u30d6 <strong>\u6210\u529f<\/strong><\/li>\n<\/ul>\n<pre><code>2025-05-11T05:33:25.954208Z audit_log, method: &quot;google.cloud.run.v1.Services.ReplaceService&quot;, principal_email: &quot;test@example.com&quot;\n2025-05-11T05:33:33.333447Z GCSFuse is mounted with bucket myapp-database-2. Enable GCSFuse logging with mount options for more logs\n2025-05-11T05:33:44.494420644Z {&quot;http&quot;:&quot;:8080&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Server started&quot;}\n2025-05-11T05:33:45.254073429Z {&quot;error&quot;:&quot;dial tcp 127.0.0.1:3000: connect: connection refused&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Unable to proxy request&quot;, &quot;path&quot;:&quot;\/up&quot;}\n2025-05-11T05:33:45.254191640Z {&quot;cache&quot;:&quot;miss&quot;, &quot;dur&quot;:5, &quot;level&quot;:&quot;INFO&quot;, &quot;method&quot;:&quot;GET&quot;, &quot;msg&quot;:&quot;Request&quot;, &quot;path&quot;:&quot;\/up&quot;, &quot;query&quot;:&quot;&quot;, &quot;remote_addr&quot;:&quot;169.254.169.126:24517&quot;, &quot;req_content_length&quot;:0, &quot;req_content_type&quot;:&quot;&quot;, &quot;resp_content_length&quot;:0, &quot;resp_content_type&quot;:&quot;&quot;, &quot;status&quot;:502, &quot;user_agent&quot;:&quot;&quot;}\n2025-05-11T05:33:46.080122Z =&gt; Booting Puma\n2025-05-11T05:33:46.080135Z =&gt; Rails 8.0.2 application starting in production\n2025-05-11T05:33:46.080141Z =&gt; Run `bin\/rails server --help` for more startup options\n2025-05-11T05:33:46.255715515Z {&quot;error&quot;:&quot;dial tcp 127.0.0.1:3000: connect: connection refused&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Unable to proxy request&quot;, &quot;path&quot;:&quot;\/up&quot;}\n2025-05-11T05:33:46.255862285Z {&quot;cache&quot;:&quot;miss&quot;, &quot;dur&quot;:0, &quot;level&quot;:&quot;INFO&quot;, &quot;method&quot;:&quot;GET&quot;, &quot;msg&quot;:&quot;Request&quot;, &quot;path&quot;:&quot;\/up&quot;, &quot;query&quot;:&quot;&quot;, &quot;remote_addr&quot;:&quot;169.254.169.126:15905&quot;, &quot;req_content_length&quot;:0, &quot;req_content_type&quot;:&quot;&quot;, &quot;resp_content_length&quot;:0, &quot;resp_content_type&quot;:&quot;&quot;, &quot;status&quot;:502, &quot;user_agent&quot;:&quot;&quot;}\n2025-05-11T05:33:47.257123378Z {&quot;error&quot;:&quot;dial tcp 127.0.0.1:3000: connect: connection refused&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Unable to proxy request&quot;, &quot;path&quot;:&quot;\/up&quot;}\n2025-05-11T05:33:47.257210998Z {&quot;cache&quot;:&quot;miss&quot;, &quot;dur&quot;:0, &quot;level&quot;:&quot;INFO&quot;, &quot;method&quot;:&quot;GET&quot;, &quot;msg&quot;:&quot;Request&quot;, &quot;path&quot;:&quot;\/up&quot;, &quot;query&quot;:&quot;&quot;, &quot;remote_addr&quot;:&quot;169.254.169.126:9785&quot;, &quot;req_content_length&quot;:0, &quot;req_content_type&quot;:&quot;&quot;, &quot;resp_content_length&quot;:0, &quot;resp_content_type&quot;:&quot;&quot;, &quot;status&quot;:502, &quot;user_agent&quot;:&quot;&quot;}\n2025-05-11T05:33:48.258735601Z {&quot;error&quot;:&quot;dial tcp 127.0.0.1:3000: connect: connection refused&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Unable to proxy request&quot;, &quot;path&quot;:&quot;\/up&quot;}\n2025-05-11T05:33:48.258832260Z {&quot;cache&quot;:&quot;miss&quot;, &quot;dur&quot;:0, &quot;level&quot;:&quot;INFO&quot;, &quot;method&quot;:&quot;GET&quot;, &quot;msg&quot;:&quot;Request&quot;, &quot;path&quot;:&quot;\/up&quot;, &quot;query&quot;:&quot;&quot;, &quot;remote_addr&quot;:&quot;169.254.169.126:28337&quot;, &quot;req_content_length&quot;:0, &quot;req_content_type&quot;:&quot;&quot;, &quot;resp_content_length&quot;:0, &quot;resp_content_type&quot;:&quot;&quot;, &quot;status&quot;:502, &quot;user_agent&quot;:&quot;&quot;}\n2025-05-11T05:33:49.260334673Z {&quot;error&quot;:&quot;dial tcp 127.0.0.1:3000: connect: connection refused&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Unable to proxy request&quot;, &quot;path&quot;:&quot;\/up&quot;}\n2025-05-11T05:33:49.260409103Z {&quot;cache&quot;:&quot;miss&quot;, &quot;dur&quot;:0, &quot;level&quot;:&quot;INFO&quot;, &quot;method&quot;:&quot;GET&quot;, &quot;msg&quot;:&quot;Request&quot;, &quot;path&quot;:&quot;\/up&quot;, &quot;query&quot;:&quot;&quot;, &quot;remote_addr&quot;:&quot;169.254.169.126:58605&quot;, &quot;req_content_length&quot;:0, &quot;req_content_type&quot;:&quot;&quot;, &quot;resp_content_length&quot;:0, &quot;resp_content_type&quot;:&quot;&quot;, &quot;status&quot;:502, &quot;user_agent&quot;:&quot;&quot;}\n2025-05-11T05:33:49.770577Z Puma starting in single mode...\n2025-05-11T05:33:49.770585Z * Puma version: 6.6.0 (&quot;Return to Forever&quot;)\n2025-05-11T05:33:49.770589Z * Ruby version: ruby 3.4.3 (2025-04-14 revision d0b7e5b6a0) +YJIT +PRISM [x86_64-linux]\n2025-05-11T05:33:49.770592Z * Min threads: 3\n2025-05-11T05:33:49.770595Z * Max threads: 3\n2025-05-11T05:33:49.770598Z * Environment: production\n2025-05-11T05:33:49.770601Z * PID: 21\n2025-05-11T05:33:49.771009Z * Listening on http:\/\/0.0.0.0:3000\n2025-05-11T05:33:49.777059Z Use Ctrl-C to stop\n2025-05-11T05:33:50.268927329Z {&quot;cache&quot;:&quot;miss&quot;, &quot;dur&quot;:7, &quot;level&quot;:&quot;INFO&quot;, &quot;method&quot;:&quot;GET&quot;, &quot;msg&quot;:&quot;Request&quot;, &quot;path&quot;:&quot;\/up&quot;, &quot;query&quot;:&quot;&quot;, &quot;remote_addr&quot;:&quot;169.254.169.126:61639&quot;, &quot;req_content_length&quot;:0, &quot;req_content_type&quot;:&quot;&quot;, &quot;resp_content_length&quot;:73, &quot;resp_content_type&quot;:&quot;text\/html; charset=utf-8&quot;, &quot;status&quot;:200, &quot;user_agent&quot;:&quot;&quot;}\n2025-05-11T05:33:50.269187Z STARTUP HTTP probe succeeded after 18 attempts for container &quot;myapp-1&quot; on port 8080 path &quot;\/up&quot;.\n2025-05-11T05:33:50.344405Z Ready condition status changed to True for Revision myapp-00011-vj4 with message: Deploying revision succeeded in 23.43s.\n2025-05-11T05:33:51.639467Z Ready condition status changed to True for Service myapp.<\/code><\/pre>\n<p>\u4ee5\u4e0a\u3088\u308a\u3001Container Port \u304c 80 \u3067\u306f\u5931\u6557\u3057\u30013000 \u3067\u306f\u6210\u529f\u3057\u3066\u3044\u308b\u3002\u307e\u305f\u3001Thruster \u306e Port \u3092 8080 \u306b\u5909\u66f4\u3057\u3066\u3001Container Port \u3082 8080 \u306b\u5909\u66f4\u3057\u305f\u3068\u3053\u308d\u3001\u6210\u529f\u3057\u3066\u3044\u308b\u3002\u3088\u3063\u3066\u3001Cloud Run Gen 2 \u3067\u306f\u3001Port 80 \u3067\u5f85\u3061\u53d7\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u3088\u3046\u3060\u3002<\/p>\n<h2>\u53c2\u8003\u6587\u732e<\/h2>\n<ul>\n<li><a href=\"https:\/\/cloud.google.com\/run\/docs\/release-notes#December_06_2022\">Cloud Run Release notes: 2022-12-06<\/a><\/li>\n<li><a href=\"https:\/\/cloud.google.com\/run\/docs\/release-notes#November_14_2019\">Cloud Run Release notes: 2019-11-14<\/a><\/li>\n<li><a href=\"https:\/\/cloud.google.com\/run\/docs\/container-contract?hl=ja\">Cloud Run \u30b3\u30f3\u30c6\u30ca \u30e9\u30f3\u30bf\u30a4\u30e0\u306e\u5951\u7d04<\/a><\/li>\n<li>Thruster <a href=\"https:\/\/github.com\/basecamp\/thruster#custom-configuration\">Custom configuration<\/a><\/li>\n<\/ul>\n<hr \/>\n<h2>Overview<\/h2>\n<p>Cloud Run&#8217;s The second generation (Gen 2) cannot listen on Port 80. The container startup check fails.<br \/>\nCloud Run&#8217;s The first generation (Gen 1) could listen on Port 80. The container startup check succeeds.<br \/>\nThis is not written in the documentation, so caution is necessary.<\/p>\n<p>The generation of Cloud Run is different from the generation of Cloud Run functions.<\/p>\n<h2>Preamble (long)<\/h2>\n<p>Cloud Run offers two generations as a &quot;service execution environment&quot;: The first generation and The second generation. This is <strong>fundamentally different<\/strong> from the difference between Cloud Run functions (1st gen) and Cloud Run functions (2nd gen) of Cloud Run functions.<\/p>\n<p>Regarding Cloud Run functions, it is presumed that the 1st generation ran in an environment equivalent to App Engine, and the 2nd generation, as explicitly stated, runs on Cloud Run. The 1st and 2nd generations are not (completely) source code compatible, so porting requires some effort.<\/p>\n<p>Regarding Cloud Run, it was announced that the 2nd generation became GA on <a href=\"https:\/\/cloud.google.com\/run\/docs\/release-notes#December_06_2022\">2022-12-06<\/a>. It was announced that it supports NFS, NDB, 9P, CIFS\/Samba, and Ceph, and that this has led to support for Cloud Filestore and Cloud Storage FUSE. It was announced that the 1st generation became GA on <a href=\"https:\/\/cloud.google.com\/run\/docs\/release-notes#November_14_2019\">2019-11-14<\/a>.<\/p>\n<p>The difference between the 1st and 2nd generations is explained on a rather mysterious page called <a href=\"https:\/\/cloud.google.com\/run\/docs\/container-contract?hl=en\">Container runtime contract<\/a>.<\/p>\n<blockquote>\n<p>When using the 1st generation execution environment, Cloud Run containers are sandboxed using the gVisor container runtime sandbox. As noted in the gVisor syscall compatibility reference, this container sandbox may not support some system calls.<\/p>\n<p>If you are using the 2nd generation execution environment, you have full Linux compatibility. Cloud Run jobs always use the 2nd generation execution environment. In the 2nd generation execution environment, \/sys\/class\/dmi\/id\/product_name is set to Google Compute Engine.<\/p>\n<p>In the 2nd generation execution environment, your service code runs in a separate process namespace, so it starts as a container init process with special process semantics. In the 1st generation execution environment, your service code does not run as a container init process.<\/p>\n<p>Cloud Run does not support privileged containers. Therefore, Cloud Run does not support binaries that use the setuid flag for non-root users, such as gcsfuse or sudo, and may fail due to insufficient permissions.<\/p>\n<\/blockquote>\n<h2>Occurrence of the problem<\/h2>\n<p>To put it bluntly, it seemed that connections from the outside could not be made when listening on Port 80. It might be a &quot;privilege&quot; issue, making it impossible to listen on a Well-Known Port. However, the Cloud Run documentation does not state that it is impossible to listen on Port 80.<\/p>\n<p>This time, when I changed a certain container from the 1st generation to the 2nd generation, the following happened:<\/p>\n<ul>\n<li>At first glance, the container appears to be starting normally.<\/li>\n<li>There are no access logs for the Startup Probe.<\/li>\n<li>An error appears in the Cloud Run logs, indicating that access was not possible.<\/li>\n<\/ul>\n<p>Since Rails 8, Thruster has been introduced, and the standard configuration is a reverse proxy listening on Port 80 and Puma listening on Port 3000 behind it. Thruster was listening on Port 80, so I had specified 80 for the Container Port, but it stopped working just by changing the Generation to Second.<\/p>\n<h2>Verification<\/h2>\n<p>For a service, <code>structured-logging<\/code>, I changed the Execution environment from Default to Execution environment Second generation. After that, when I checked the Cloud Logging logs, the following error had occurred.<\/p>\n<p>Setting: Execution environment Second<\/p>\n<p>Verification 1:<\/p>\n<ul>\n<li>Execution environment: Second<\/li>\n<li>Container Port: 80<\/li>\n<li>Container:\n<ul>\n<li>Thruster: Port 80<\/li>\n<li>Puma: Port 3000<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Result 1:<\/p>\n<ul>\n<li>Startup probe failed<\/li>\n<\/ul>\n<pre><code>2025-05-11 13:50:05.473 audit_log, method: &quot;google.cloud.run.v1.Services.ReplaceService&quot;, principal_email: &quot;test@example.com&quot;\n2025-05-11 13:50:20.308 {&quot;http&quot;:&quot;:80&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Server started&quot;}\n2025-05-11 13:50:21.695 =&gt; Booting Puma\n2025-05-11 13:50:21.695 =&gt; Rails 8.0.2 application starting in production \n2025-05-11 13:50:21.695 =&gt; Run `bin\/rails server --help` for more startup options\n2025-05-11 13:50:25.122 Puma starting in single mode...\n2025-05-11 13:50:25.122 * Puma version: 6.6.0 (&quot;Return to Forever&quot;)\n2025-05-11 13:50:25.122 * Ruby version: ruby 3.4.3 (2025-04-14 revision d0b7e5b6a0) +YJIT +PRISM [x86_64-linux]\n2025-05-11 13:50:25.123 *  Min threads: 3\n2025-05-11 13:50:25.123 *  Max threads: 3\n2025-05-11 13:50:25.123 *  Environment: production\n2025-05-11 13:50:25.123 *          PID: 22\n2025-05-11 13:50:25.123 * Listening on http:\/\/0.0.0.0:3000\n2025-05-11 13:50:25.127 Use Ctrl-C to stop\n2025-05-11 13:50:43.749 STARTUP HTTP probe failed 5 times consecutively for container &quot;structured-logging-1&quot; on port 80 path &quot;\/up&quot;. The instance was not started. Connection failed with status ERROR_CONNECTION_FAILED.\n2025-05-11 13:50:45.162 Ready condition status changed to False for Revision structured-logging-00023-z99 with message: The user-provided container failed the configured startup probe checks. Logs for this revision might contain more information.  Logs URL: https:\/\/console.cloud.google.com\/logs\/viewer?project=rails8-gcexample&amp;resource=cloud_run_revision\/service_name\/structured-logging\/revision_name\/structured-logging-00023-z99&amp;advancedFilter=resource.type%3D%22cloud_run_revision%22%0Aresource.labels.service_name%3D%22structured-logging%22%0Aresource.labels.revision_name%3D%22structured-logging-00023-z99%22  For more troubleshooting guidance, see https:\/\/cloud.google.com\/run\/docs\/troubleshooting#container-failed-to-start\n2025-05-11 13:50:45.228 Ready condition status changed to False for Service structured-logging with message: Revision &#039;structured-logging-00023-z99&#039; is not ready and cannot serve traffic. The user-provided container failed the configured startup probe checks. Logs for this revision might contain more information.  Logs URL: https:\/\/console.cloud.google.com\/logs\/viewer?project=rails8-gcexample&amp;resource=cloud_run_revision\/service_name\/structured-logging\/revision_name\/structured-logging-00023-z99&amp;advancedFilter=resource.type%3D%22cloud_run_revision%22%0Aresource.labels.service_name%3D%22structured-logging%22%0Aresource.labels.revision_name%3D%22structured-logging-00023-z99%22  For more troubleshooting guidance, see https:\/\/cloud.google.com\/run\/docs\/troubleshooting#container-failed-to-start<\/code><\/pre>\n<p>This container (standard Rails 8.0.2 configuration) can actually be accessed directly on Port 3000, bypassing Thruster and accessing Puma directly. Therefore, I tried the following settings. For various reasons, I did this with a different service, <code>myapp<\/code>.<\/p>\n<p>Setting: Configuration unchanged, Container Port changed to 3000<\/p>\n<p>Verification 2:<\/p>\n<ul>\n<li>Execution environment: Second<\/li>\n<li>Container Port: 3000<\/li>\n<li>Container:\n<ul>\n<li>Thruster: Port 80<\/li>\n<li>Puma: Port 3000<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Result 2:<\/p>\n<ul>\n<li>Startup probe succeeded<\/li>\n<\/ul>\n<pre><code>2025-05-11T05:16:43.102033Z audit_log, method: &quot;google.cloud.run.v1.Services.ReplaceService&quot;, principal_email: &quot;test@example.com&quot;\n2025-05-11T05:16:50.568687Z GCSFuse is mounted with bucket myapp-database-2. Enable GCSFuse logging with mount options for more logs\n2025-05-11T05:17:01.485709218Z {&quot;http&quot;:&quot;:80&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Server started&quot;}\n2025-05-11T05:17:02.678599Z =&gt; Booting Puma\n2025-05-11T05:17:02.678612Z =&gt; Rails 8.0.2 application starting in production\n2025-05-11T05:17:02.678617Z =&gt; Run `bin\/rails server --help` for more startup options\n2025-05-11T05:17:05.612966Z Puma starting in single mode...\n2025-05-11T05:17:05.612978Z * Puma version: 6.6.0 (&quot;Return to Forever&quot;)\n2025-05-11T05:17:05.612982Z * Ruby version: ruby 3.4.3 (2025-04-14 revision d0b7e5b6a0) +YJIT +PRISM [x86_64-linux]\n2025-05-11T05:17:05.612985Z * Min threads: 3\n2025-05-11T05:17:05.612988Z * Max threads: 3\n2025-05-11T05:17:05.612991Z * Environment: production\n2025-05-11T05:17:05.612994Z * PID: 21\n2025-05-11T05:17:05.613469Z * Listening on http:\/\/0.0.0.0:3000\n2025-05-11T05:17:05.619894Z Use Ctrl-C to stop\n2025-05-11T05:17:06.376474Z STARTUP HTTP probe succeeded after 17 attempts for container &quot;myapp-1&quot; on port 3000 path &quot;\/up&quot;.\n2025-05-11T05:17:06.471410Z Ready condition status changed to True for Revision myapp-00008-jp7 with message: Deploying revision succeeded in 22.32s.\n2025-05-11T05:17:07.757828Z Ready condition status changed to True for Service myapp.<\/code><\/pre>\n<p>Thruster is listening on Port 80, while the Startup probe accesses <code>http:\/\/0.0.0.0:3000\/up<\/code> and succeeds.<\/p>\n<p>Thruster can change its port by specifying 8080 for the environment variable <code>HTTP_PORT<\/code> <a href=\"https:\/\/github.com\/basecamp\/thruster#custom-configuration\">Custom configuration<\/a>. There was no problem even when this was set (logs omitted).<\/p>\n<p>Finally, I tried changing the Port that Cloud Run expects from the container to 8080.<\/p>\n<p>Setting:<\/p>\n<ul>\n<li>Specify 8080 for <code>HTTP_PORT<\/code><\/li>\n<li>Change Container Port to 8080<\/li>\n<\/ul>\n<p>Verification 3:<\/p>\n<ul>\n<li>Execution environment: Second<\/li>\n<li>Container Port: 8080<\/li>\n<li><code>HTTP_PORT<\/code>(Environment variable): 8080<\/li>\n<li>Container:\n<ul>\n<li>Thruster: Port <strong>8080<\/strong><\/li>\n<li>Puma: Port 3000<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Result 3:<\/p>\n<ul>\n<li>Startup probe <strong>succeeded<\/strong><\/li>\n<\/ul>\n<pre><code>2025-05-11T05:33:25.954208Z audit_log, method: &quot;google.cloud.run.v1.Services.ReplaceService&quot;, principal_email: &quot;test@example.com&quot;\n2025-05-11T05:33:33.333447Z GCSFuse is mounted with bucket myapp-database-2. Enable GCSFuse logging with mount options for more logs\n2025-05-11T05:33:44.494420644Z {&quot;http&quot;:&quot;:8080&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Server started&quot;}\n2025-05-11T05:33:45.254073429Z {&quot;error&quot;:&quot;dial tcp 127.0.0.1:3000: connect: connection refused&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Unable to proxy request&quot;, &quot;path&quot;:&quot;\/up&quot;}\n2025-05-11T05:33:45.254191640Z {&quot;cache&quot;:&quot;miss&quot;, &quot;dur&quot;:5, &quot;level&quot;:&quot;INFO&quot;, &quot;method&quot;:&quot;GET&quot;, &quot;msg&quot;:&quot;Request&quot;, &quot;path&quot;:&quot;\/up&quot;, &quot;query&quot;:&quot;&quot;, &quot;remote_addr&quot;:&quot;169.254.169.126:24517&quot;, &quot;req_content_length&quot;:0, &quot;req_content_type&quot;:&quot;&quot;, &quot;resp_content_length&quot;:0, &quot;resp_content_type&quot;:&quot;&quot;, &quot;status&quot;:502, &quot;user_agent&quot;:&quot;&quot;}\n2025-05-11T05:33:46.080122Z =&gt; Booting Puma\n2025-05-11T05:33:46.080135Z =&gt; Rails 8.0.2 application starting in production\n2025-05-11T05:33:46.080141Z =&gt; Run `bin\/rails server --help` for more startup options\n2025-05-11T05:33:46.255715515Z {&quot;error&quot;:&quot;dial tcp 127.0.0.1:3000: connect: connection refused&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Unable to proxy request&quot;, &quot;path&quot;:&quot;\/up&quot;}\n2025-05-11T05:33:46.255862285Z {&quot;cache&quot;:&quot;miss&quot;, &quot;dur&quot;:0, &quot;level&quot;:&quot;INFO&quot;, &quot;method&quot;:&quot;GET&quot;, &quot;msg&quot;:&quot;Request&quot;, &quot;path&quot;:&quot;\/up&quot;, &quot;query&quot;:&quot;&quot;, &quot;remote_addr&quot;:&quot;169.254.169.126:15905&quot;, &quot;req_content_length&quot;:0, &quot;req_content_type&quot;:&quot;&quot;, &quot;resp_content_length&quot;:0, &quot;resp_content_type&quot;:&quot;&quot;, &quot;status&quot;:502, &quot;user_agent&quot;:&quot;&quot;}\n2025-05-11T05:33:47.257123378Z {&quot;error&quot;:&quot;dial tcp 127.0.0.1:3000: connect: connection refused&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Unable to proxy request&quot;, &quot;path&quot;:&quot;\/up&quot;}\n2025-05-11T05:33:47.257210998Z {&quot;cache&quot;:&quot;miss&quot;, &quot;dur&quot;:0, &quot;level&quot;:&quot;INFO&quot;, &quot;method&quot;:&quot;GET&quot;, &quot;msg&quot;:&quot;Request&quot;, &quot;path&quot;:&quot;\/up&quot;, &quot;query&quot;:&quot;&quot;, &quot;remote_addr&quot;:&quot;169.254.169.126:9785&quot;, &quot;req_content_length&quot;:0, &quot;req_content_type&quot;:&quot;&quot;, &quot;resp_content_length&quot;:0, &quot;resp_content_type&quot;:&quot;&quot;, &quot;status&quot;:502, &quot;user_agent&quot;:&quot;&quot;}\n2025-05-11T05:33:48.258735601Z {&quot;error&quot;:&quot;dial tcp 127.0.0.1:3000: connect: connection refused&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Unable to proxy request&quot;, &quot;path&quot;:&quot;\/up&quot;}\n2025-05-11T05:33:48.258832260Z {&quot;cache&quot;:&quot;miss&quot;, &quot;dur&quot;:0, &quot;level&quot;:&quot;INFO&quot;, &quot;method&quot;:&quot;GET&quot;, &quot;msg&quot;:&quot;Request&quot;, &quot;path&quot;:&quot;\/up&quot;, &quot;query&quot;:&quot;&quot;, &quot;remote_addr&quot;:&quot;169.254.169.126:28337&quot;, &quot;req_content_length&quot;:0, &quot;req_content_type&quot;:&quot;&quot;, &quot;resp_content_length&quot;:0, &quot;resp_content_type&quot;:&quot;&quot;, &quot;status&quot;:502, &quot;user_agent&quot;:&quot;&quot;}\n2025-05-11T05:33:49.260334673Z {&quot;error&quot;:&quot;dial tcp 127.0.0.1:3000: connect: connection refused&quot;, &quot;level&quot;:&quot;INFO&quot;, &quot;msg&quot;:&quot;Unable to proxy request&quot;, &quot;path&quot;:&quot;\/up&quot;}\n2025-05-11T05:33:49.260409103Z {&quot;cache&quot;:&quot;miss&quot;, &quot;dur&quot;:0, &quot;level&quot;:&quot;INFO&quot;, &quot;method&quot;:&quot;GET&quot;, &quot;msg&quot;:&quot;Request&quot;, &quot;path&quot;:&quot;\/up&quot;, &quot;query&quot;:&quot;&quot;, &quot;remote_addr&quot;:&quot;169.254.169.126:58605&quot;, &quot;req_content_length&quot;:0, &quot;req_content_type&quot;:&quot;&quot;, &quot;resp_content_length&quot;:0, &quot;resp_content_type&quot;:&quot;&quot;, &quot;status&quot;:502, &quot;user_agent&quot;:&quot;&quot;}\n2025-05-11T05:33:49.770577Z Puma starting in single mode...\n2025-05-11T05:33:49.770585Z * Puma version: 6.6.0 (&quot;Return to Forever&quot;)\n2025-05-11T05:33:49.770589Z * Ruby version: ruby 3.4.3 (2025-04-14 revision d0b7e5b6a0) +YJIT +PRISM [x86_64-linux]\n2025-05-11T05:33:49.770592Z * Min threads: 3\n2025-05-11T05:33:49.770595Z * Max threads: 3\n2025-05-11T05:33:49.770598Z * Environment: production\n2025-05-11T05:33:49.770601Z * PID: 21\n2025-05-11T05:33:49.771009Z * Listening on http:\/\/0.0.0.0:3000\n2025-05-11T05:33:49.777059Z Use Ctrl-C to stop\n2025-05-11T05:33:50.268927329Z {&quot;cache&quot;:&quot;miss&quot;, &quot;dur&quot;:7, &quot;level&quot;:&quot;INFO&quot;, &quot;method&quot;:&quot;GET&quot;, &quot;msg&quot;:&quot;Request&quot;, &quot;path&quot;:&quot;\/up&quot;, &quot;query&quot;:&quot;&quot;, &quot;remote_addr&quot;:&quot;169.254.169.126:61639&quot;, &quot;req_content_length&quot;:0, &quot;req_content_type&quot;:&quot;&quot;, &quot;resp_content_length&quot;:73, &quot;resp_content_type&quot;:&quot;text\/html; charset=utf-8&quot;, &quot;status&quot;:200, &quot;user_agent&quot;:&quot;&quot;}\n2025-05-11T05:33:50.269187Z STARTUP HTTP probe succeeded after 18 attempts for container &quot;myapp-1&quot; on port 8080 path &quot;\/up&quot;.\n2025-05-11T05:33:50.344405Z Ready condition status changed to True for Revision myapp-00011-vj4 with message: Deploying revision succeeded in 23.43s.\n2025-05-11T05:33:51.639467Z Ready condition status changed to True for Service myapp.<\/code><\/pre>\n<p>From the above, Container Port 80 fails, while 3000 succeeds. Also, changing Thruster&#8217;s Port to 8080 and also changing the Container Port to 8080 resulted in success. Therefore, it seems that Cloud Run Gen 2 cannot listen on Port 80.<\/p>\n<h2>References<\/h2>\n<ul>\n<li><a href=\"https:\/\/cloud.google.com\/run\/docs\/release-notes#December_06_2022\">Cloud Run Release notes: 2022-12-06<\/a><\/li>\n<li><a href=\"https:\/\/cloud.google.com\/run\/docs\/release-notes#November_14_2019\">Cloud Run Release notes: 2019-11-14<\/a><\/li>\n<li><a href=\"https:\/\/cloud.google.com\/run\/docs\/container-contract?hl=en\">Cloud Run Container runtime contract<\/a><\/li>\n<li>Thruster <a href=\"https:\/\/github.com\/basecamp\/thruster#custom-configuration\">Custom configuration<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Cloud Run Gen 2: Uncovering Port 80 Limitations for Container Startup English follows Japanese. \u6982\u8981 Cloud Run \u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[26,13],"tags":[],"class_list":["post-576","post","type-post","status-publish","format-standard","hentry","category-cloud-run","category-google-cloud"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4dIdP-9i","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts\/576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/comments?post=576"}],"version-history":[{"count":2,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts\/576\/revisions"}],"predecessor-version":[{"id":578,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts\/576\/revisions\/578"}],"wp:attachment":[{"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/media?parent=576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/categories?post=576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/tags?post=576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}