Closed waldolin closed 3 weeks ago
This is a duplicate of https://github.com/GoogleCloudPlatform/functions-framework-dart/issues/464 – I need to dig in here.
This is a duplicate of https://github.com/GoogleCloudPlatform/functions-framework-dart/issues/464 – I need to dig in here.
what can I do to pass the step 1 to keep it on?
An option would be to pin pkg:analyzer to an older version before the fix causing problems
I'll need to dig to see what that version is
Dart Functions Framework GSP889 https://www.cloudskillsboost.google/course_templates/720/labs/408181
STEP 1 Build the image: gcloud builds submit --config cloudbuild.yaml
it failed without question.
`student_01_03ab295715fb@cloudshell:~/functions-framework-dart/examples/fullstack/backend (qwiklabs-gcp-00-289149674474)$ gcloud builds submit --config cloudbuild.yaml Creating temporary archive of 12 file(s) totalling 12.1 KiB before compression. Some files were not included in the source upload.
Check the gcloud log [/tmp/tmp.UftkWJUNg3/logs/2024.08.19/07.05.59.746145.log] to see which files and the contents of the default gcloudignore file used (see $ gcloud topic gcloudignore to learn more).
Uploading tarball of [.] to [gs://qwiklabs-gcp-00-289149674474_cloudbuild/source/1724051160.073893-2fec292e61b24ffcba01592c85a58382.tgz] Created [https://cloudbuild.googleapis.com/v1/projects/qwiklabs-gcp-00-289149674474/locations/global/builds/316de1bf-cd5f-42be-8a66-3534f0dcecc2]. Logs are available at [ https://console.cloud.google.com/cloud-build/builds/316de1bf-cd5f-42be-8a66-3534f0dcecc2?project=718005180631 ]. Waiting for build to complete. Polling interval: 1 second(s). -------------------------------------------------------- REMOTE BUILD OUTPUT -------------------------------------------------------- starting build "316de1bf-cd5f-42be-8a66-3534f0dcecc2"
FETCHSOURCE Fetching storage object: gs://qwiklabs-gcp-00-289149674474_cloudbuild/source/1724051160.073893-2fec292e61b24ffcba01592c85a58382.tgz#1724051161842344 Copying gs://qwiklabs-gcp-00-289149674474_cloudbuild/source/1724051160.073893-2fec292e61b24ffcba01592c85a58382.tgz#1724051161842344... / [1 files][ 5.0 KiB/ 5.0 KiB] Function(Request, RequestLogger)] from package:functions_framework/functions_framework.dart
Step #0: Handler [FutureOr Function(Request)] from package:shelf/shelf.dart
Step #0: CloudEventWithContextHandler [FutureOr Function(CloudEvent, RequestContext)] from package:functions_framework/functions_framework.dart
Step #0: CloudEventHandler [FutureOr Function(CloudEvent)] from package:functions_framework/functions_framework.dart
Step #0: JsonHandler [FutureOr Function(RequestType request, RequestContext context)] from package:functions_framework/functions_framework.dart
Step #0: JsonHandler [FutureOr Function(RequestType request)] from package:functions_framework/functions_framework.dart
Step #0:
Step #0: package:backend/functions.dart:25:18
Step #0: ╷
Step #0: 25 │ GreetingResponse function(GreetingRequest request, RequestContext context) {
Step #0: │ ^^^^^^^^
Step #0: ╵
Step #0: [INFO] Running build completed, took 16.4s
Step #0:
Step #0: [INFO] Caching finalized dependency graph...
Step #0: [INFO] Caching finalized dependency graph completed, took 144ms
Step #0:
Step #0: [SEVERE] Failed after 16.6s
Step #0: The command '/bin/sh -c dart pub run build_runner build --delete-conflicting-outputs' returned a non-zero code: 1
Finished Step #0
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1
Operation completed over 1 objects/5.0 KiB.
BUILD Starting Step #0 Step #0: Already have image (with digest): gcr.io/cloud-builders/docker Step #0: Sending build context to Docker daemon 24.58kB Step #0: Step 1/13 : FROM dart:stable AS build Step #0: stable: Pulling from library/dart Step #0: e4fff0779e6d: Pulling fs layer Step #0: e27827d55be4: Pulling fs layer Step #0: 5e9f01d3ad07: Pulling fs layer Step #0: d412697a639f: Pulling fs layer Step #0: d412697a639f: Waiting Step #0: 5e9f01d3ad07: Verifying Checksum Step #0: 5e9f01d3ad07: Download complete Step #0: e4fff0779e6d: Verifying Checksum Step #0: e4fff0779e6d: Download complete Step #0: e27827d55be4: Verifying Checksum Step #0: e27827d55be4: Download complete Step #0: e4fff0779e6d: Pull complete Step #0: e27827d55be4: Pull complete Step #0: 5e9f01d3ad07: Pull complete Step #0: d412697a639f: Verifying Checksum Step #0: d412697a639f: Download complete Step #0: d412697a639f: Pull complete Step #0: Digest: sha256:17d83a179e10ec76698b9580f6d367e13957fcd32135e9b265039b553e8547e6 Step #0: Status: Downloaded newer image for dart:stable Step #0: 8d1bee8e23fe Step #0: Step 2/13 : WORKDIR /app Step #0: Running in c6dac42f10ee Step #0: Removing intermediate container c6dac42f10ee Step #0: 334bb9d71f3a Step #0: Step 3/13 : COPY pubspec.* ./ Step #0: 3030fbdad0ad Step #0: Step 4/13 : RUN dart pub get Step #0: Running in b9400cd0fc67 Step #0: Resolving dependencies... Step #0: Downloading packages... Step #0: + _fe_analyzer_shared 73.0.0 Step #0: + _macros 0.3.2 from sdk dart Step #0: + analyzer 6.8.0 Step #0: + args 2.5.0 Step #0: + async 2.11.0 Step #0: + boolean_selector 2.1.1 Step #0: + build 2.4.1 Step #0: + build_config 1.1.1 Step #0: + build_daemon 4.0.2 Step #0: + build_resolvers 2.4.2 Step #0: + build_runner 2.4.12 Step #0: + build_runner_core 7.3.2 Step #0: + built_collection 5.1.1 Step #0: + built_value 8.9.2 Step #0: + checked_yaml 2.0.3 Step #0: + code_builder 4.10.0 Step #0: + collection 1.19.0 Step #0: + convert 3.1.1 Step #0: + coverage 1.9.0 Step #0: + crypto 3.0.5 Step #0: + dart_flutter_team_lints 3.2.0 Step #0: + dart_style 2.3.6 Step #0: + file 7.0.0 Step #0: + fixnum 1.1.0 Step #0: + frontend_server_client 4.0.0 Step #0: + functions_framework 0.4.3+1 Step #0: + functions_framework_builder 0.4.10 Step #0: + glob 2.1.2 Step #0: + google_cloud 0.2.0 Step #0: + graphs 2.3.2 Step #0: + http 1.2.2 Step #0: + http_multi_server 3.2.1 Step #0: + http_parser 4.1.0 Step #0: + io 1.0.4 Step #0: + js 0.7.1 Step #0: + json_annotation 4.9.0 Step #0: + json_serializable 6.8.0 Step #0: + lints 4.0.0 Step #0: + logging 1.2.0 Step #0: + macros 0.1.2-main.4 Step #0: + matcher 0.12.16+1 Step #0: + meta 1.15.0 Step #0: + mime 1.0.5 Step #0: + node_preamble 2.0.2 Step #0: + package_config 2.1.0 Step #0: + path 1.9.0 Step #0: + pool 1.5.1 Step #0: + pub_semver 2.1.4 Step #0: + pubspec_parse 1.3.0 Step #0: + shelf 1.4.2 Step #0: + shelf_packages_handler 3.0.2 Step #0: + shelf_static 1.1.2 Step #0: + shelf_web_socket 2.0.0 Step #0: + source_gen 1.5.0 Step #0: + source_helper 1.3.4 Step #0: + source_map_stack_trace 2.1.1 Step #0: + source_maps 0.10.12 Step #0: + source_span 1.10.0 Step #0: + stack_trace 1.11.1 Step #0: + stream_channel 2.1.2 Step #0: + stream_transform 2.1.0 Step #0: + string_scanner 1.3.0 Step #0: + term_glyph 1.2.1 Step #0: + test 1.25.8 Step #0: + test_api 0.7.3 Step #0: + test_core 0.6.5 Step #0: + test_process 2.1.0 Step #0: + timing 1.0.1 Step #0: + typed_data 1.3.2 Step #0: + vm_service 14.2.5 Step #0: + watcher 1.1.0 Step #0: + web 1.0.0 Step #0: + web_socket 0.1.6 Step #0: + web_socket_channel 3.0.1 Step #0: + webkit_inspection_protocol 1.2.1 Step #0: + yaml 3.1.2 Step #0: Changed 76 dependencies! Step #0: Removing intermediate container b9400cd0fc67 Step #0: 63bbf778794d Step #0: Step 5/13 : COPY . . Step #0: bde5a33dadda Step #0: Step 6/13 : RUN dart pub get --offline Step #0: Running in b66e2dbbb617 Step #0: Resolving dependencies... Step #0: Downloading packages... Step #0: Got dependencies! Step #0: Removing intermediate container b66e2dbbb617 Step #0: 3a92eeb378c8 Step #0: Step 7/13 : RUN dart pub run build_runner build --delete-conflicting-outputs Step #0: Running in 9920f7c77727 Step #0: [INFO] Generating build script... Step #0: [INFO] Generating build script completed, took 614ms Step #0: Step #0: [INFO] Precompiling build script...... Step #0: [INFO] Precompiling build script... completed, took 8.4s Step #0: Step #0: [INFO] Initializing inputs Step #0: [INFO] Building new asset graph... Step #0: [INFO] Building new asset graph completed, took 1.6s Step #0: Step #0: [INFO] Checking for unexpected pre-existing outputs.... Step #0: [INFO] Deleting 2 declared outputs which already existed on disk. Step #0: [INFO] Checking for unexpected pre-existing outputs. completed, took 5ms Step #0: Step #0: [INFO] Running build... Step #0: [INFO] Generating SDK summary... Step #0: [INFO] 5.1s elapsed, 0/3 actions completed. Step #0: [INFO] 6.4s elapsed, 0/3 actions completed. Step #0: [INFO] 9.6s elapsed, 0/3 actions completed. Step #0: [INFO] 10.7s elapsed, 0/3 actions completed. Step #0: [INFO] Generating SDK summary completed, took 10.7s Step #0: Step #0: [INFO] 11.8s elapsed, 7/18 actions completed. Step #0: [INFO] 15.1s elapsed, 28/33 actions completed. Step #0: [INFO] 16.1s elapsed, 48/49 actions completed. Step #0: [SEVERE] functions_framework_builder:function_framework_builder on lib/functions.dart: Step #0: Step #0: Not compatible with a supported function shape: Step #0: HandlerWithLogger [FutureOr
BUILD FAILURE: Build step failure: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1 ERROR: (gcloud.builds.submit) build 316de1bf-cd5f-42be-8a66-3534f0dcecc2 completed with status "FAILURE" student_01_03ab295715fb@cloudshell:~/functions-framework-dart/examples/fullstack/backend (qwiklabs-gcp-00-289149674474)$ ^C student_01_03ab295715fb@cloudshell:~/functions-framework-dart/examples/fullstack/backend (qwiklabs-gcp-00-289149674474)$ gcloud run deploy backend-service \ --image gcr.io/$GOOGLE_CLOUD_PROJECT/backend-service \ --platform managed \ --region us-central1 \ --allow-unauthenticated \ --max-instances=2 Deploying container to Cloud Run service [backend-service] in project [qwiklabs-gcp-00-289149674474] region [us-central1] X Deploying new service...
. Routing traffic...
OK Setting IAM Policy...
Deployment failed
ERROR: (gcloud.run.deploy) Revision 'backend-service-00001-kx5' is not ready and cannot serve traffic. Image 'gcr.io/qwiklabs-gcp-00-289149674474/backend-service' not found. student_01_03ab295715fb@cloudshell:~/functions-framework-dart/examples/fullstack/backend (qwiklabs-gcp-00-289149674474)$ ^C student_01_03ab295715fb@cloudshell:~/functions-framework-dart/examples/fullstack/backend (qwiklabs-gcp-00-289149674474)$ pwd /home/student_01_03ab295715fb/functions-framework-dart/examples/fullstack/backend student_01_03ab295715fb@cloudshell:~/functions-framework-dart/examples/fullstack/backend (qwiklabs-gcp-00-289149674474)$ ls lib/ api_types.dart api_types.g.dart functions.dart student_01_03ab295715fb@cloudshell:~/functions-framework-dart/examples/fullstack/backend (qwiklabs-gcp-00-289149674474)$ gcloud builds submit --config cloudbuild.yaml Creating temporary archive of 12 file(s) totalling 12.2 KiB before compression. Some files were not included in the source upload.
Check the gcloud log [/tmp/tmp.UftkWJUNg3/logs/2024.08.19/07.21.54.764208.log] to see which files and the contents of the default gcloudignore file used (see $ gcloud topic gcloudignore to learn more).
Uploading tarball of [.] to [gs://qwiklabs-gcp-00-289149674474_cloudbuild/source/1724052115.017867-93b57d241bd943ab815b666d2d27c939.tgz] Created [https://cloudbuild.googleapis.com/v1/projects/qwiklabs-gcp-00-289149674474/locations/global/builds/22f9aa51-cf2e-41e3-bab6-27b290a9c963]. Logs are available at [ https://console.cloud.google.com/cloud-build/builds/22f9aa51-cf2e-41e3-bab6-27b290a9c963?project=718005180631 ]. Waiting for build to complete. Polling interval: 1 second(s). --------------------------------------------------------------------------- REMOTE BUILD OUTPUT --------------------------------------------------------------------------- starting build "22f9aa51-cf2e-41e3-bab6-27b290a9c963"
FETCHSOURCE Fetching storage object: gs://qwiklabs-gcp-00-289149674474_cloudbuild/source/1724052115.017867-93b57d241bd943ab815b666d2d27c939.tgz#1724052117196936 Copying gs://qwiklabs-gcp-00-289149674474_cloudbuild/source/1724052115.017867-93b57d241bd943ab815b666d2d27c939.tgz#1724052117196936... / [1 files][ 5.0 KiB/ 5.0 KiB] Function(Request, RequestLogger)] from package:functions_framework/functions_framework.dart
Step #0: Handler [FutureOr Function(Request)] from package:shelf/shelf.dart
Step #0: CloudEventWithContextHandler [FutureOr Function(CloudEvent, RequestContext)] from package:functions_framework/functions_framework.dart
Step #0: CloudEventHandler [FutureOr Function(CloudEvent)] from package:functions_framework/functions_framework.dart
Step #0: JsonHandler [FutureOr Function(RequestType request, RequestContext context)] from package:functions_framework/functions_framework.dart
Step #0: JsonHandler [FutureOr Function(RequestType request)] from package:functions_framework/functions_framework.dart
Step #0:
Step #0: package:backend/functions.dart:25:28
Step #0: ╷
Step #0: 25 │ FutureOr function(GreetingRequest request, RequestContext context) {
Step #0: │ ^^^^^^^^
Step #0: ╵
Step #0: [INFO] Running build completed, took 18.0s
Step #0:
Step #0: [INFO] Caching finalized dependency graph...
Step #0: [INFO] Caching finalized dependency graph completed, took 129ms
Step #0:
Step #0: [SEVERE] Failed after 18.1s
Step #0: The command '/bin/sh -c dart pub run build_runner build --delete-conflicting-outputs' returned a non-zero code: 1
Finished Step #0
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1
Operation completed over 1 objects/5.0 KiB. BUILD Starting Step #0 Step #0: Already have image (with digest): gcr.io/cloud-builders/docker Step #0: Sending build context to Docker daemon 24.58kB Step #0: Step 1/13 : FROM dart:stable AS build Step #0: stable: Pulling from library/dart Step #0: e4fff0779e6d: Pulling fs layer Step #0: e27827d55be4: Pulling fs layer Step #0: 5e9f01d3ad07: Pulling fs layer Step #0: d412697a639f: Pulling fs layer Step #0: d412697a639f: Waiting Step #0: 5e9f01d3ad07: Verifying Checksum Step #0: 5e9f01d3ad07: Download complete Step #0: e4fff0779e6d: Verifying Checksum Step #0: e4fff0779e6d: Download complete Step #0: e27827d55be4: Verifying Checksum Step #0: e27827d55be4: Download complete Step #0: e4fff0779e6d: Pull complete Step #0: e27827d55be4: Pull complete Step #0: 5e9f01d3ad07: Pull complete Step #0: d412697a639f: Download complete Step #0: d412697a639f: Pull complete Step #0: Digest: sha256:17d83a179e10ec76698b9580f6d367e13957fcd32135e9b265039b553e8547e6 Step #0: Status: Downloaded newer image for dart:stable Step #0: 8d1bee8e23fe Step #0: Step 2/13 : WORKDIR /app Step #0: Running in 4830b6871de6 Step #0: Removing intermediate container 4830b6871de6 Step #0: 0da2ede4e5a4 Step #0: Step 3/13 : COPY pubspec.* ./ Step #0: 861ad7cbfa9b Step #0: Step 4/13 : RUN dart pub get Step #0: Running in b952541aa4b6 Step #0: Resolving dependencies... Step #0: Downloading packages... Step #0: + _fe_analyzer_shared 73.0.0 Step #0: + _macros 0.3.2 from sdk dart Step #0: + analyzer 6.8.0 Step #0: + args 2.5.0 Step #0: + async 2.11.0 Step #0: + boolean_selector 2.1.1 Step #0: + build 2.4.1 Step #0: + build_config 1.1.1 Step #0: + build_daemon 4.0.2 Step #0: + build_resolvers 2.4.2 Step #0: + build_runner 2.4.12 Step #0: + build_runner_core 7.3.2 Step #0: + built_collection 5.1.1 Step #0: + built_value 8.9.2 Step #0: + checked_yaml 2.0.3 Step #0: + code_builder 4.10.0 Step #0: + collection 1.19.0 Step #0: + convert 3.1.1 Step #0: + coverage 1.9.0 Step #0: + crypto 3.0.5 Step #0: + dart_flutter_team_lints 3.2.0 Step #0: + dart_style 2.3.6 Step #0: + file 7.0.0 Step #0: + fixnum 1.1.0 Step #0: + frontend_server_client 4.0.0 Step #0: + functions_framework 0.4.3+1 Step #0: + functions_framework_builder 0.4.10 Step #0: + glob 2.1.2 Step #0: + google_cloud 0.2.0 Step #0: + graphs 2.3.2 Step #0: + http 1.2.2 Step #0: + http_multi_server 3.2.1 Step #0: + http_parser 4.1.0 Step #0: + io 1.0.4 Step #0: + js 0.7.1 Step #0: + json_annotation 4.9.0 Step #0: + json_serializable 6.8.0 Step #0: + lints 4.0.0 Step #0: + logging 1.2.0 Step #0: + macros 0.1.2-main.4 Step #0: + matcher 0.12.16+1 Step #0: + meta 1.15.0 Step #0: + mime 1.0.5 Step #0: + node_preamble 2.0.2 Step #0: + package_config 2.1.0 Step #0: + path 1.9.0 Step #0: + pool 1.5.1 Step #0: + pub_semver 2.1.4 Step #0: + pubspec_parse 1.3.0 Step #0: + shelf 1.4.2 Step #0: + shelf_packages_handler 3.0.2 Step #0: + shelf_static 1.1.2 Step #0: + shelf_web_socket 2.0.0 Step #0: + source_gen 1.5.0 Step #0: + source_helper 1.3.4 Step #0: + source_map_stack_trace 2.1.1 Step #0: + source_maps 0.10.12 Step #0: + source_span 1.10.0 Step #0: + stack_trace 1.11.1 Step #0: + stream_channel 2.1.2 Step #0: + stream_transform 2.1.0 Step #0: + string_scanner 1.3.0 Step #0: + term_glyph 1.2.1 Step #0: + test 1.25.8 Step #0: + test_api 0.7.3 Step #0: + test_core 0.6.5 Step #0: + test_process 2.1.0 Step #0: + timing 1.0.1 Step #0: + typed_data 1.3.2 Step #0: + vm_service 14.2.5 Step #0: + watcher 1.1.0 Step #0: + web 1.0.0 Step #0: + web_socket 0.1.6 Step #0: + web_socket_channel 3.0.1 Step #0: + webkit_inspection_protocol 1.2.1 Step #0: + yaml 3.1.2 Step #0: Changed 76 dependencies! Step #0: Removing intermediate container b952541aa4b6 Step #0: 294c55dd399a Step #0: Step 5/13 : COPY . . Step #0: af6584d0674a Step #0: Step 6/13 : RUN dart pub get --offline Step #0: Running in 0ec331f40507 Step #0: Resolving dependencies... Step #0: Downloading packages... Step #0: Got dependencies! Step #0: Removing intermediate container 0ec331f40507 Step #0: 93d7b7e22f80 Step #0: Step 7/13 : RUN dart pub run build_runner build --delete-conflicting-outputs Step #0: Running in 942219c673e9 Step #0: [INFO] Generating build script... Step #0: [INFO] Generating build script completed, took 600ms Step #0: Step #0: [INFO] Precompiling build script...... Step #0: [INFO] Precompiling build script... completed, took 8.4s Step #0: Step #0: [INFO] Initializing inputs Step #0: [INFO] Building new asset graph... Step #0: [INFO] Building new asset graph completed, took 1.5s Step #0: Step #0: [INFO] Checking for unexpected pre-existing outputs.... Step #0: [INFO] Deleting 2 declared outputs which already existed on disk. Step #0: [INFO] Checking for unexpected pre-existing outputs. completed, took 6ms Step #0: Step #0: [INFO] Running build... Step #0: [INFO] Generating SDK summary... Step #0: [INFO] 5.4s elapsed, 0/3 actions completed. Step #0: [INFO] 6.6s elapsed, 0/3 actions completed. Step #0: [INFO] 10.3s elapsed, 0/3 actions completed. Step #0: [INFO] 11.4s elapsed, 0/3 actions completed. Step #0: [INFO] Generating SDK summary completed, took 11.7s Step #0: Step #0: [INFO] 12.8s elapsed, 3/18 actions completed. Step #0: [INFO] 16.4s elapsed, 28/33 actions completed. Step #0: [INFO] 17.7s elapsed, 48/49 actions completed. Step #0: [SEVERE] functions_framework_builder:function_framework_builder on lib/functions.dart: Step #0: Step #0: Not compatible with a supported function shape: Step #0: HandlerWithLogger [FutureOr
BUILD FAILURE: Build step failure: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1 ERROR: (gcloud.builds.submit) build 22f9aa51-cf2e-41e3-bab6-27b290a9c963 completed with status "FAILURE"`
student_01_03ab295715fb@cloudshell:~/functions-framework-dart/examples/fullstack/backend (qwiklabs-gcp-00-289149674474)$ d d art --version Dart SDK version: 3.4.4 (stable) (Wed Jun 12 15:54:31 2024 +0000) on "linux_x64"