test-kitchen / kitchen-vagrant

A Test Kitchen Driver for Vagrant
Other
348 stars 189 forks source link

box_auto_update -- produces an error when no box exists already to check for an update against #425

Closed jsloan117 closed 3 years ago

jsloan117 commented 3 years ago

:speaking_head: Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

:ghost: Brief Description

When no boxes exists and you have box_auto_update set it produces box doesn't exist error.

Version

Chef Workstation version: 20.10.168 Chef Infra Client version: 16.6.14 Chef InSpec version: 4.23.11 Chef CLI version: 3.0.33 Chef Habitat version: 1.6.56 Test Kitchen version: 2.7.2 Cookstyle version: 6.21.1

Environment

Windows 10 Version 1909 Build 18363.1139

Scenario

Pull a box while no prior version exists, with box_auto_update set to true.

Steps to Reproduce

  1. Generate fresh cookbook
  2. Ensure kitchen.yml contains box_auto_update: true
  3. Run: kitchen create

Expected Result

To automatically pull the most current box version available.

Actual Result

It produces The box 'bento/centos-7' does not exist error message.

-----> Starting Test Kitchen (v2.7.2)
-----> Creating <default-centos-7>...
       The box 'bento/centos-7' does not exist. Please double check and
       try again. You can see the boxes that are installed with
       `vagrant box list`.
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.  
>>>>>>     Failed to complete #create action: [Expected process to exit with [0], but received '1'
---- Begin output of vagrant box update --box bento/centos-7 ----
STDOUT:
STDERR: The box 'bento/centos-7' does not exist. Please double check and
try again. You can see the boxes that are installed with
`vagrant box list`.
---- End output of vagrant box update --box bento/centos-7 ----
Ran vagrant box update --box bento/centos-7 returned 1] on default-centos-7
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

:heavy_plus_sign: Additional context

This issue may be #422 related.

You can work around this issue by commenting out the box_auto_update setting and undoing that after pulling an initial box.

gaelik commented 3 years ago

opened ticket 26472 with support as this issue is hitting us now and the work around is not very doable in a fully automated pipeline ran environment...

clintoncwolfe commented 3 years ago

Verified with test-kitchen 2.7.2 kitchen-vagrant 1.7.1