【问题标题】:getting error for kitchen create in chef在厨师中创建厨房时出错
【发布时间】:2015-10-15 12:48:37
【问题描述】:

由于我对厨师很陌生,我无法弄清楚以下错误:

$ kitchen create
-----> Starting Kitchen (v1.4.2)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::UserError
>>>>>> Message: Error parsing /home/ashishk/motd/.kitchen.yml as YAML.
Please run `kitchen diagnose --no-instances --loader' to help debug your issue.
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

我的 .kitchen.yml 文件如下所示:

$ cat .kitchen.yml
---
driver:
  name: vagrant
    provisioner:
#  name: policyfile_zero
  name: chef_zero
platforms:
  - name: ubuntu-14.04
#  - name: centos-7.1
driver:
      customize:
        memory: 256

suites:
  - name: default
        run_list:
                - recipe[motd::default]
    attributes:

我正在关注文档 [https://learn.chef.io/local-development/ubuntu/get-started-with-test-kitchen/][1]

请帮助我这里有什么问题!

安装的 Vagrant 现在出现以下错误:

 VirtualBox is complaining that the installation is incomplete. Please
       run `VBoxManage --version` to see the error message which should contain
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [Expected process to exit with [0], but received '1'
---- Begin output of vagrant up --no-provision --provider virtualbox ----
STDOUT:
STDERR: The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:

VirtualBox is complaining that the installation is incomplete. Please
run `VBoxManage --version` to see the error message which should contain
instructions on how to fix this error.
---- End output of vagrant up --no-provision --provider virtualbox ----
Ran vagrant up --no-provision --provider virtualbox returned 1]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

命令: ashishk@chef-workstation:~/motd$ VBoxManage --version

WARNING: The character device /dev/vboxdrv does not exist.
         Please install the virtualbox-dkms package and the appropriate
         headers, most likely linux-headers-generic.

         You will not be able to start VMs until this problem is fixed.
4.3.10_Ubuntur93012

附: 我已经在该 VM(ubuntu)中的 Windows 7 上安装了 Virtual box 我有厨师工作站在其上运行“厨房创建”

【问题讨论】:

  • 注意缩进。从driver 下面开始,这被搞砸了。空格很重要。
  • 好的,谢谢,但现在它给出了错误 $ kitchen list >>>>>> ------Exception------- >>>>>> Class: Kitchen: :UserError >>>>>> 消息:未安装 Vagrant 1.1.0 或更高版本。请从vagrantup.com/downloads.html 下载软件包。 >>>>>> ---------------------- >>>>>> 更多详情请查看 .kitchen/logs/kitchen.log >>> >>> 也尝试运行kitchen diagnose --all 进行配置
  • 我使用 Ubuntu VM 作为工作站,所以 vagrant 应该安装在那个 VM 或 Base 机器上?
  • Vagrant 必须安装在那里,VirtualBox 可用。
  • 已安装的 Vagrant 现在出现以下错误:VirtualBox 抱怨安装不完整。请运行VBoxManage --version 查看错误消息,其中应包含 >>>>>> ------Exception------- >>>>>> Class: Kitchen::ActionFailed >>>>> > 消息:未能完成 #create 操作:[预期进程以 [0] 退出,但收到 '1' ---- 开始输出 vagrant up --no-provision --provider virtualbox ---- STDOUT: STDERR : 被请求支持机器的提供者“virtualbox”

标签: ubuntu vagrant chef-infra virtualization test-kitchen


【解决方案1】:

我在“Chefdk 0.9.0”的设置和部署方面确实取得了进展。我回去清理了用户、系统、Powershell 的 $PROFILE 中的所有路径变量。我一直在为 Windows 安装 chefdk 7 & 10 了一会儿,我发现了一些有趣的地方要注意:

  1. 如果您已卸载并重新安装了 chekdk、vagrant 和 virtualbox,则必须清理用户、系统、$Powershell 的 $Profile 路径,否则您将花费​​数小时排除 ghost 故障。

  2. 空格在 .kitchen.yml 中确实很重要。这是我直到今天才遇到的唯一问题。感谢您对上述“驱动程序:”的提示。

  3. 在 Virtualbox 或 chefdk 之后最后安装 Vagrant。

  4. 确保 chefdk 的路径按此顺序

      PATH="C:\opscode\chefdk\bin\;C:\opscode\chefdk\embedded\bin
    
  5. 检查 HOME 和 CHEFDK_HOME 的路径。

在这几件事之后,一切都应该正常了。


 Windows 10 
 Chef Development Kit Version: 0.9.0 
 chef-client version: 12.5.1 
 berks version: 4.0.1 
 kitchen version: 1.4.2

$PROFILE 中的路径

$env:PATH="C:\opscode\chefdk\bin\;C:\opscode\chefdk\embedded\bin;C:\opscode\chefdk\modules\chef;C:\Program Files\Docker Toolbox; C:\HashiCorp\Vagrant\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\MongoDB\Server\3.0\bin;C:\Python27\;C:\Python27\Scripts;C:\ oraclexe\app\oracle\product\10.2.0\server\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\ Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\Intuit\QBPOSSDKRuntime; c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Puppet Labs\Puppet Enterprise\bin;C:\Program Files (x86)\acquia-drupal7\ common\bin\;C:\Program Files (x86)\acquia-drupal7\mysql\bin\;C:\Program Files (x86)\acquia-drupal7\php5_3\;C:\Program Files (x86)\acquia- drupal7\drush\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\Brackets\command;C:\Program Files (x 86)\AMD\ATI.ACE\Core-Static;C:\Program Files (x86)\Skype\Phone\"

>>"chef shell-init powershell | 调用表达式"

PS C:\Users\Preston 3rd (win 7)\chef-repo\kitchen> & "C:\Program Files\Oracle\VirtualBox\VBoxManage" --version 5.0.6r103037

PS C:\Users\Preston 3rd (win 7)\chef-repo\kitchen> vagrant --version 流浪者 1.7.4 PS C:\Users\Preston 3rd (win 7)\chef-repo\kitchen>

 PS C:\Users\Preston 3rd (win 7)\chef-repo\kitchen> bundle install 
 Fetching gem metadata from https://rubygems.org/.......... 
 Fetching version metadata from https://rubygems.org/... 
 Fetching dependency metadata from https://rubygems.org/.. 
 Resolving dependencies... 
 Using ffi 1.9.10 
 Using win32-process 0.8.2 
 Using wmi-lite 1.0.0 
 Using mixlib-shellout 2.2.3 
 Using net-ssh 2.9.2 
 Using net-scp 1.2.1 
 Using safe_yaml 1.0.4 
 Using thor 0.19.1 
 Using test-kitchen 1.4.2 
 Using kitchen-vagrant 0.19.0 
 Using bundler 1.10.6 
 Bundle complete! 2 Gemfile dependencies, 11 gems now installed. 
 Use `bundle show [gemname]` to see where a bundled gem is installed. 

 Preston Thornton
 skype: preston4life
 preston3271@gmail.com

【讨论】:

  • 我有间距问题:-P。谢谢。
【解决方案2】:

我知道这是一个旧线程,但它只是让我明白了,所以我想分享我的问题。

我没有使用空格来缩进,而是使用了一个制表符,这就是导致我解析 YAML 错误的原因。

【讨论】:

    【解决方案3】:

    复制以下内容并将其替换为现有的 kitchen.yml 即可解决问题:

    driver:
      name: vagrant
    
    provisioner:
      name: chef_zero
    
    platforms:
      - name: ubuntu-14.04
        driver:
          customize:
            memory: 256
    
    suites:
      - name: default
        run_list:
          - recipe[motd_ubuntu::default]
        attributes:
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多