Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spinnaker failed to bake image while running pipeline (Packer v1.4.2, Spinnaker v1.16.x) #44

Closed
ghost opened this issue Apr 30, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 30, 2021

This issue was originally opened by @neil-yechenwei as hashicorp/packer#8334. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


I tried to deploy spinnaker v1.16.5 to AKS with distributed mode. However, after deployed spinnaker successfully, it failed to bake image and threw below error message "ui error: Build 'azure-arm' errored: unexpected EOF" while running pipeline. After investigated, it can bake image successfully after reverted the packer version from 1.4.2 to 1.3.1. So I think the current packer version 1.4.2 is incompatible with spinnaker 1.16.x. After further investigation, I found the issue occurred since version 1.4.2 and it got fixed since version 1.4.3. However, by default, spinnaker would use packer v1.4.2 when you choose the spinnaker v1.16.5 to deploy. So maybe the bits of spinnaker v1.16.5 need to be updated against the reference of packer. This is a blocking issue.. Please have a look and fix it. Thanks.

Reproduction Steps

  1. hal version list
  2. export version=1.16.5
  3. hal config version edit --version $version
  4. sudo hal deploy apply
  5. Configure new pipeline
  6. Add bake stage
  7. Add deploy stage
  8. Click "start manual execution"

Packer version

1.4.2

Operating system and Environment details

OS env: ubuntu 1604

Pipeline configuration for bake stage:
image

Entire error message:

==> azure-arm: Deleting resource group ...
==> azure-arm: -> ResourceGroupName : 'packer-Resource-Group-xxxx'
==> azure-arm:
==> azure-arm: The resource group was created by Packer, deleting ...
==> azure-arm: Deleting the temporary OS disk ...
==> azure-arm: -> OS Disk : skipping, managed disk was used...
==> azure-arm: Deleting the temporary Additional disk ...
==> azure-arm: -> Additional Disk : skipping, managed disk was used...
Build 'azure-arm' errored: unexpected EOF

==> Some builds didn't complete successfully and had errors:
--> azure-arm: unexpected EOF

==> Builds finished but no artifacts were created.
panic: interface conversion: interface {} is nil, not string
2019/11/06 01:35:53 packer:
2019/11/06 01:35:53 packer: goroutine 156 [running]:
2019/11/06 01:35:53 packer: github.com/hashicorp/packer/builder/azure/arm.(*Builder).Run(0xc000312db0, 0x3c5b160, 0xc000a90140, 0x3c732a0, 0xc00052e860, 0x3bfaf00, 0xc0005fca00, 0x0, 0x0, 0x0, ...)
2019/11/06 01:35:53 packer: /Users/mmarsh/Projects/packer/builder/azure/arm/builder.go:305 +0x4384
2019/11/06 01:35:53 packer: github.com/hashicorp/packer/packer/rpc.(*BuilderServer).Run(0xc00042a7e0, 0x1, 0xc00052a020, 0x0, 0x0)
2019/11/06 01:35:53 packer: /Users/mmarsh/Projects/packer/packer/rpc/builder.go:109 +0x231
2019/11/06 01:35:53 packer: reflect.Value.call(0xc00045b1a0, 0xc00000e1a8, 0x13, 0x36aa961, 0x4, 0xc0000b4f18, 0x3, 0x3, 0xc000090400, 0x662cd00, ...)
2019/11/06 01:35:53 packer: /usr/local/go/src/reflect/value.go:447 +0x461
2019/11/06 01:35:53 packer: reflect.Value.Call(0xc00045b1a0, 0xc00000e1a8, 0x13, 0xc00006f718, 0x3, 0x3, 0x710cf6, 0xc0000a80a8, 0xc00006f701)
2019/11/06 01:35:53 packer: /usr/local/go/src/reflect/value.go:308 +0xa4
2019/11/06 01:35:53 packer: net/rpc.(*service).call(0xc000331a00, 0xc0000a83c0, 0xc0000585b0, 0xc0000585c0, 0xc0000fe980, 0xc0002440c0, 0x2c84720, 0xc00052a01c, 0x18a, 0x2be05c0, ...)
2019/11/06 01:35:53 packer: /usr/local/go/src/net/rpc/server.go:384 +0x14e
2019/11/06 01:35:53 packer: created by net/rpc.(*Server).ServeCodec
2019/11/06 01:35:53 packer: /usr/local/go/src/net/rpc/server.go:481 +0x42b
2019/11/06 01:35:53 /packer/packer: plugin process exited
2019/11/06 01:35:53 [INFO] (telemetry) ending azure-arm
2019/11/06 01:35:53 ui error: Build 'azure-arm' errored: unexpected EOF
2019/11/06 01:35:53 machine readable: error-count []string{"1"}
2019/11/06 01:35:53 ui error:
==> Some builds didn't complete successfully and had errors:
2019/11/06 01:35:53 machine readable: azure-arm,error []string{"unexpected EOF"}
2019/11/06 01:35:53 ui error: --> azure-arm: unexpected EOF
2019/11/06 01:35:53 ui:
==> Builds finished but no artifacts were created.
2019/11/06 01:35:53 [INFO] (telemetry) Finalizing.
2019/11/06 01:35:53 waiting for all plugin processes to complete...
2019/11/06 01:35:53 /packer/packer: plugin process exited
2019/11/06 01:35:53 /packer/packer: plugin process exited

Failed to create crash log file: open crash.log: permission denied

Packer template:

v-cheye@devopsVM:~$ cat ./.hal/default/staging/rosco/packer/azure-linux.json
{
"variables": {
"azure_client_id": "",
"azure_client_secret": "",
"azure_resource_group": "",
"azure_storage_account": "",
"azure_subscription_id": "",
"azure_tenant_id": "",
"azure_image_publisher": "",
"azure_image_offer": "",
"azure_image_sku": "",
"azure_location": "",
"azure_image_name": "",

"appversion": "",
"build_host": "",
"repository": "",
"package_type": "",
"packages": "",
"upgrade": "",
"configDir": null

},
"builders": [{
"type": "azure-arm",

"client_id": "{{user `azure_client_id`}}",
"client_secret": "{{user `azure_client_secret`}}",
"managed_image_resource_group_name": "{{user `azure_resource_group`}}",
"managed_image_name": "{{user `azure_managed_image_name`}}",
"subscription_id": "{{user `azure_subscription_id`}}",
"tenant_id": "{{user `azure_tenant_id`}}",

"os_type": "Linux",
"image_publisher": "{{user `azure_image_publisher`}}",
"image_offer": "{{user `azure_image_offer`}}",
"image_sku": "{{user `azure_image_sku`}}",

"location": "{{user `azure_location`}}",
"vm_size": "Standard_DS2_v2"

}],
"provisioners": [{
"type": "shell",
"script": "{{user configDir}}/install_packages.sh",
"environment_vars": [
"repository={{user repository}}",
"package_type={{user package_type}}",
"packages={{user packages}}",
"upgrade={{user upgrade}}"
],
"pause_before": "30s"
},
{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"apt-get update",
"apt-get upgrade -y",

  "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"

}
]
}

@JenGoldstrich
Copy link
Contributor

I think this issue is stale, closing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant