Open tompscanlan opened 4 months ago
Opened ticket upstream, but we could be defensive with a slightly tighter regex.
Hi there @tompscanlan this is not a bug in the plugin, as the returned version from VBoxManage --version
is returning "Environment variable LOGNAME or USER does not correspond to effective user id\n7.0.16r162802" which is indeed not a validated version. The VBoxManage command is returning this warning because the invocation of Packer is executed by a user whose name does not match the logged-in user $LOGNAME. Can you shed some light on where you are invoking Packer and how?
Are you invoking the script via a crontab?
If you are invoking Packer from a crontab, specify a username or set the user to $LOGNAME via env USER=$LOGNAME
in the crontab entry.
I forget details now, but invocation was not via crontab, but was indirect like Makefile -> scriptA.sh -> scriptB.sh which may have switched users.
The real issue is upstream I believe, My ask here is to improve the error message. I dug for a bit and could have saved time with a better error. If it doesn't make sense to change, then no worries, just close.
Overview of the Issue
Running packer on a host indirectly. I'm seeing a warning that looks like it is causing a parsing error. when doing a
VBoxManage --version
.This is the error:
Reproduction Steps
I'm only able reproduce using this indirect call to packer through another tool. Error seems to be here: https://github.com/hashicorp/packer-plugin-virtualbox/blob/54c5a2462f860ba5f18d5817b83f51f8eed2f962/builder/virtualbox/common/driver_4_2.go#L321 when a string is prepended to the version.
Plugin and Packer version
Packer v1.10.2
Simplified Packer Buildfile
If the file is longer than a few dozen lines, please include the URL to the gist of the log or use the Github detailed format instead of posting it directly in the issue.
Operating system and Environment details
Happens on Ubuntu and Rocky Linux.
Log Fragments and crash.log files