GoogleCloudPlatform / GoogleCloudPlatform/cloud-builders-community

Remote-Builder - ssh: connect to host port 22: Connection timed out

Open
#403 6 comments 2 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.3k
Forks
848
PR merge metrics
No merged PRs in 30d

Description

## Affected builder image

gcr.io/cloud-builders-community/remote-builder

## Expected Behavior

To be able to run through the examples without error

## Actual Behavior

Returning error when trying to SSH into instance
ssh: connect to host xxxxxxx port 22: Connection timed out

## Steps to Reproduce the Problem

1. Run gcloud builds submit --config=default.yaml .
2. export PROJECT=$(gcloud info --format='value(config.project)')
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT --format 'value(projectNumber)')
export CB_SA_EMAIL=$PROJECT_NUMBER@cloudbuild.gserviceaccount.com
gcloud services enable cloudbuild.googleapis.com
gcloud services enable compute.googleapis.com
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:$CB_SA_EMAIL --role='roles/iam.serviceAccountUser' --role='roles/compute.instanceAdmin.v1' --role='roles/iam.serviceAccountActor'
3. steps:
- name: gcr.io/$PROJECT_ID/remote-builder
env:
- COMMAND=ls -la

## Additional Info

Added firewall rule to allow 0.0.0.0/0 ingress for SSH.

Complete error:

+ gcloud compute scp --compress --recurse ./ admin@builder-41e70933-f387-4243-8726-6b4edc3f2d2c:/home/admin/workspace/ --ssh-key-file=builder-key
ssh: connect to host 35.193.194.220 port 22: Connection timed out
lost connection
ERROR: (gcloud.compute.scp) [/usr/bin/scp] exited with return code [1].
+ cleanup
+ gcloud compute instances delete builder-41e70933-f387-4243-8726-6b4edc3f2d2c
The following instances will be deleted. Any attached disks configured
to be auto-deleted will be deleted unless they are attached to any
other instances or the `--keep-disks` flag is given and specifies them
for keeping. Deleting a disk is irreversible and any data on the disk
will be lost.
- [builder-41e70933-f387-4243-8726-6b4edc3f2d2c] in [us-central1-f]

Do you want to continue (Y/n)?
Deleted [https://www.googleapis.com/compute/v1/projects/dev-monolith-275613/zones/us-central1-f/instances/builder-41e70933-f387-4243-8726-6b4edc3f2d2c].
ERROR
ERROR: build step 0 "gcr.io/cloud-solutions-images/remote-builder:v0.3.1" failed: step exited with non-zero status: 1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.