YannickRe / azuredevops-buildagents

Generate self-hosted build agents for Azure DevOps, just like Microsoft does.
MIT License
151 stars 90 forks source link

Build VM ubuntu2204 fails Timeout waiting for SSH #64

Closed martijndohmen closed 9 months ago

martijndohmen commented 1 year ago

I am trying to create a new virtual machine scaleset for ubuntu2204 within a provided vnet. Creation of resources is working and I have double checked the service principal. During the build VM process of the pipeline, I get an the following error:

Syntax-only check passed. Everything looks okay. Show Packer Version 1.7.4 Build ubuntu2204 VM ==> azure-arm.build_image: Running builder ... ==> azure-arm.build_image: Getting tokens using client secret ==> azure-arm.build_image: Getting tokens using client secret azure-arm.build_image: Creating Azure Resource Manager (ARM) client ... ==> azure-arm.build_image: Creating resource group ... ==> azure-arm.build_image: Validating deployment template ... ==> azure-arm.build_image: Deploying deployment template ... ==> azure-arm.build_image: ==> azure-arm.build_image: Getting the VM's IP address ... ==> azure-arm.build_image: Waiting for SSH to become available... ==> azure-arm.build_image: Timeout waiting for SSH. ==> azure-arm.build_image: ==> azure-arm.build_image: Deleting individual resources ...

.....

Build 'azure-arm.build_image' errored after 22 minutes 51 seconds: Timeout waiting for SSH.

==> Wait completed after 22 minutes 51 seconds

==> Some builds didn't complete successfully and had errors: --> azure-arm.build_image: Timeout waiting for SSH.

==> Builds finished but no artifacts were created.

[debug]$LASTEXITCODE: 1

[debug]Exit code 1 received from tool '/usr/bin/pwsh'

[debug]STDIO streams have closed for tool '/usr/bin/pwsh'

[debug]task result: Failed

[error]PowerShell exited with code '1'.

[debug]Processed: ##vso[task.issue type=error;]PowerShell exited with code '1'.

[debug]Processed: ##vso[task.complete result=Failed;]PowerShell exited with code '1'.

Finishing: Build VM

lukerogers commented 11 months ago

I ran into this issue today and the only way I was able to get past it was to set the following variables to $null:

That doesn't help you if you need the build VM on a specific network though.

martijndohmen commented 11 months ago

Too bad, it is not working yet. I have tried different settings for the VNET NAME, RESOURCE_GROUP and SUBNET_NAME, also $null. The existing VMSS build agents are operating within a private VNET and have internet access. I am thinking of creating a VMSS in a public VNET just to solve this issue?

YannickRe commented 10 months ago

I'm sorry, but I don't generate my images on a specific VNet so I can't assist in this issue. It seems https://github.com/actions/runner-images/issues/7784 covers the same thing, maybe that helps?

martijndohmen commented 9 months ago

It appeared to be a DNS network issue. Instead of using my own DNS it is working with Azure DNS.