hashicorp / hashicorp/packer

Packer builds using Jenkins fail on 1.7.10 or 1.8.0

Open
#11,728 0 comments 1 reaction 0 assignees View on GitHub
bug regression
Dominant language
Go
Stars
15.8k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

#### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

#### Overview of the Issue

Just rebuilt a jenkins node with a fresh install of all components. Noticed my builds were failing with

```
Error: Duplicate local definition

on vsphere.pkr.hcl line 2:
(source code not available)

Duplicate linux_notes definition found.
```

This is a build that has been working correctly for months with no changes.

#### Reproduction Steps

### Packer version

Happening both on 1.7.10 and 1.8.0. Successfully works on the old node at 1.7.9 and began working on new node after downgrading to 1.7.9

### Simplified Packer Template

The section that triggers the error:

```
locals {
linux_notes = "Template based on ${ var.os_family }-${ var.os_version } with CIS hardening, built using packer on {{ isotime \"2006-01-02\" }} at {{isotime \"3:04PM\"}}"
win_notes = "Template based on ${ var.os_family } ${ var.os_version }, built using packer on {{ isotime \"2006-01-02\" }} at {{isotime \"3:04PM\"}}"
speedtest_notes = "Speedtest template based on ${ var.os_family }-${ var.os_version } LTS with CIS hardening, built using packer on {{ isotime \"2006-01-02\" }} at {{isotime \"3:04PM\"}}"
vm_name = "${ var.os_family }${ var.os_version }"
}
```

### Operating system and Environment details

Failing environment: Ubuntu 20.04.4, packer 1.8.0 (or 1.7.10)
Successful environments:
1. Rocky8, Packer 1.7.9
2. Ubuntu 20.04.4, Packer 1.7.9

### Log Fragments and crash.log files

```
jenkins@jenkins-node01:~/workspace/win2022-template-pipeline$ packer validate -var-file=rocky8.pkrvars.hcl --only vsphere-iso.rocky .
Error: Duplicate local definition

on vsphere.pkr.hcl line 2:
(source code not available)

Duplicate linux_notes definition found.

Error: Duplicate local definition

on vsphere.pkr.hcl line 3:
(source code not available)

Duplicate win_notes definition found.

Error: Duplicate local definition

on vsphere.pkr.hcl line 4:
(source code not available)

Duplicate speedtest_notes definition found.

Error: Duplicate local definition

on vsphere.pkr.hcl line 5:
(source code not available)

Duplicate vm_name definition found.
```

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.