guillaume blaquiere
1 min readNov 12, 2019

Ok. I tested deeper and forget the sleep 15. It’s true for script, but not in this terraform & cloud build context.

The problem is tricky. With the verbosity debug, you can see this trace

DEBUG: Executing command: [u'/usr/bin/ssh', u'-T', u'-i', u'/builder/home/.ssh/google_compute_engine', u'-o', u'CheckHostIP=no', u'-o', u'HostKeyAlias=compute.7953677305751525032', u'-o', u'IdentitiesOnly=yes', u'-o', u'StrictHostKeyChecking=no', u'-o', u'UserKnownHostsFile=/builder/home/.ssh/google_compute_known_hosts', u'root@35.223.85.55', u'--', u'true']
Failed to add the host to the list of known hosts (/builder/home/.ssh/google_compute_known_hosts).
Permission denied (publickey).

Lot of boring things to read, I put in bold the problem: Cloud Build has no specific user and use root to connect to the VM. For security reason, it’s not possible.

For solving this, set a dummy (change this by what you want, except root) user in your scp line

gcloud compute scp a.txt dummy@deleteme-vm6:/tmp ...

Tell me if it’s OK now.

PS: Your tf file and your cloudbuild.yaml file are desynchronized in the vm name.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

guillaume blaquiere
guillaume blaquiere

Written by guillaume blaquiere

GDE cloud platform, Group Data Architect @Carrefour, speaker, writer and polyglot developer, Google Cloud platform 3x certified, serverless addict and Go fan.

Responses (1)

Write a response