Packer: 1.6.0 interprets 'null' user variables as errors with -syntax-only flag

Created on 24 Jun 2020  ยท  2Comments  ยท  Source: hashicorp/packer

Overview of the Issue

We have a bunch of templates where some required user variables are declared as 'null' as described in the docs.

"variables": {
        "vcenter_server": null,
        "vcenter_username": null,
        "vcenter_password": null,
        "vcenter_datacenter": null,

Starting from version 1.6.0 packer validate -syntax-only command fails with

Error initializing core: 4 errors occurred:
        * required variable not set: vcenter_password
        * required variable not set: vcenter_username
        * required variable not set: vcenter_server
        * required variable not set: vcenter_datacenter

Versions 1.5.6 and below work fine.

Reproduction Steps

Run packer validate -syntax-only <template_path> against template with 'null' user variables

Packer version

1.6.0

Simplified Packer Buildfile

Example in the description

Operating system and Environment details

Happens both on macOS and windows

Log Fragments and crash.log files

Validation log provided in the description

bug core regression track-internal

Most helpful comment

Thanks for reaching out! This issue is due to the build command parsing logic that is now used by the validation command. We'll work on getting this fixed for the next release.

All 2 comments

Thanks for reaching out! This issue is due to the build command parsing logic that is now used by the validation command. We'll work on getting this fixed for the next release.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tleyden picture tleyden  ยท  3Comments

brettswift picture brettswift  ยท  3Comments

mvermaes picture mvermaes  ยท  3Comments

wduncanfraser picture wduncanfraser  ยท  3Comments

Tensho picture Tensho  ยท  3Comments