A DevOps team is troubleshooting a Cloud Build pipeline that fails intermittently when building a container image. The build step uses a custom build step that runs a vulnerability scan. The error log shows: 'Step #1: Error: failed to scan image: context deadline exceeded'. The build configuration includes 'timeout: 600s'. Which is the most likely cause and solution?
Trap 1: The scan tool requires a specific dependency; add an installation…
Missing dependency would cause command not found or similar errors.
Trap 2: There is network latency between Cloud Build and the container…
Network latency would cause connection errors, not a deadline exceeded within the build.
Trap 3: The build step is running out of memory; increase the machine type…
Memory issues would produce out-of-memory errors, not timeout.
- A
The scan tool requires a specific dependency; add an installation step before scanning.
Why wrong: Missing dependency would cause command not found or similar errors.
- B
There is network latency between Cloud Build and the container registry; use VPC Service Controls.
Why wrong: Network latency would cause connection errors, not a deadline exceeded within the build.
- C
The build step is running out of memory; increase the machine type to e2-highcpu-8.
Why wrong: Memory issues would produce out-of-memory errors, not timeout.
- D
The scan step is taking longer than the build timeout; increase the timeout value in the build configuration.
The error 'context deadline exceeded' indicates the step timed out.