microsoft/macos-cookbook

[BUG] machine_name 'host' returns error

ricardoalcazar opened this issue · 3 comments

Describe the Bug

When using the 'machine_name' resource to set the hostname, an error message is received. This exceptions is also thrown if I explicitly specify the hostname attribute.

Error Message

Chef::Exceptions::ValidationFailed: Property hostname must be one of: String! You passed nil.

Chef Exception

Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/gma-macos-mojave/recipes/default.rb:15:in `from_file'

machine_name("gma-mojave") do
  action [:set]
  default_guard_interpreter :default
  declared_type :machine_name
  cookbook_name "gma-macos-mojave"
  recipe_name "default"
  hostname "gma-mojave"
end

System Info:
------------
chef_version=14.9.13
platform=mac_os_x
platform_version=10.14
ruby=ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin16]
program_name=/usr/local/bin/chef-client
executable=/opt/chef/bin/chef-client
Running handlers:
[2019-01-27T19:08:28-06:00] ERROR: Running exception handlers
Running handlers complete
[2019-01-27T19:08:28-06:00] ERROR: Exception handlers complete
Chef Client failed. 1 resources updated in 10 seconds
[2019-01-27T19:08:28-06:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2019-01-27T19:08:28-06:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-01-27T19:08:28-06:00] FATAL: Chef::Exceptions::ValidationFailed: machine_name[gma-mojave] (gma-macos-mojave::default line 15) had an error: Chef::Exceptions::ValidationFailed: Property hostname must be one of: String!  You passed nil.

Hi @ricardoalcazar, thank you for submitting this issue. We have started investigating.

Resolved by #182

I appreciate the quick response!