Chef-zero 12.17 running under Windows System account fails


#1

Hi,

Running Chef-zero 12.17 on a Windows host using a scheduled task to run a one-time run of Chef with cookbooks on the local disk. Scheduled task is running under the System account. This works well with Chef 12.14.

I realise this is older but this is the log output I am getting:

[2016-12-13T13:32:38+00:00] WARN: No config file found or specified on command line, using command line options.
[2016-12-13T13:32:38+00:00] INFO: Auto-discovered chef repository at C:/Windows/Temp
[2016-12-13T13:32:39+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at C:/Windows/Temp
One version per cookbook

[2016-12-13T13:32:39+00:00] INFO: *** Chef 12.17.44 ***
[2016-12-13T13:32:39+00:00] INFO: Platform: x64-mingw32
[2016-12-13T13:32:39+00:00] INFO: Chef-client pid: 2828
[2016-12-13T13:33:11+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/[hostname]
[2016-12-13T13:33:11+00:00] ERROR: #<Chef::Exceptions::Win32APIError: No mapping between account names and security IDs was done.
---- Begin Win32 API output ----
System Error Code: 1332
System Error Message: No mapping between account names and security IDs was done.
---- End Win32 API output ----

C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/win32/error.rb:81:in raise!' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/win32/security.rb:383:inlookup_account_name’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/win32/security/sid.rb:44:in from_account' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/win32/security/sid.rb:241:incurrent_user’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb:116:in block in create_child' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb:111:ineach’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb:111:in create_child' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/chef_fs/chef_fs_data_store.rb:822:inget_dir’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/chef_fs/chef_fs_data_store.rb:796:in with_parent_dir' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/chef_fs/chef_fs_data_store.rb:253:increate’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/data_store/v1_to_v2_adapter.rb:34:in block in create' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/data_store/v1_to_v2_adapter.rb:113:infix_exceptions’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/data_store/v1_to_v2_adapter.rb:33:in create' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/rest_base.rb:183:increate_data’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/endpoints/rest_list_endpoint.rb:31:in post' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/endpoints/nodes_endpoint.rb:24:inpost’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/rest_base.rb:62:in call' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/rest_router.rb:24:incall’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/server.rb:665:in block in app' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/server.rb:337:inhandle_socketless_request’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/socketless_server_map.rb:87:in request' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/socketless_server_map.rb:33:inrequest’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http/socketless_chef_zero_client.rb:154:in request' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http.rb:340:inblock in send_http_request’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http.rb:372:in block in retrying_http_errors' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http.rb:370:inloop’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http.rb:370:in retrying_http_errors' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http.rb:333:insend_http_request’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http.rb:148:in request' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http.rb:131:inpost’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/node.rb:616:in create' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/node.rb:569:inrescue in find_or_create’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/node.rb:565:in find_or_create' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/policy_builder/dynamic.rb:72:inload_node’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/client.rb:468:in load_node' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/client.rb:270:inrun’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application.rb:276:in run_with_graceful_exit_option' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application.rb:252:inblock in run_chef_client’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/local_mode.rb:44:in with_server_connectivity' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application.rb:235:inrun_chef_client’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application/client.rb:464:in sleep_then_run_chef_client' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application/client.rb:451:inblock in interval_run_chef_client’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application/client.rb:450:in loop' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application/client.rb:450:ininterval_run_chef_client’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application/client.rb:434:in run_application' C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application.rb:59:inrun’
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/bin/chef-client:26:in <top (required)>' C:/opscode/chef/bin/chef-client:68:inload’
C:/opscode/chef/bin/chef-client:68:in `’
[2016-12-13T13:33:11+00:00] INFO: HTTP Request Returned 500 Internal Server Error: error
[0m
================================================================================[0m
[31mChef encountered an error attempting to load the node data for “DB-i-0874e1d2f”[0m
================================================================================[0m

[0mUnknown Server Error:[0m
---------------------[0m
The server had a fatal error attempting to load the node data.
[0m
[0mServer Response:[0m
----------------[0m
Exception raised! #<Chef::Exceptions::Win32APIError: No mapping between account names and security IDs was done.
[0m---- Begin Win32 API output ----
[0mSystem Error Code: 1332
[0mSystem Error Message: No mapping between account names and security IDs was done.
[0m---- End Win32 API output ----
[0m>
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/win32/error.rb:81:in raise!' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/win32/security.rb:383:inlookup_account_name’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/win32/security/sid.rb:44:in from_account' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/win32/security/sid.rb:241:incurrent_user’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb:116:in block in create_child' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb:111:ineach’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb:111:in create_child' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/chef_fs/chef_fs_data_store.rb:822:inget_dir’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/chef_fs/chef_fs_data_store.rb:796:in with_parent_dir' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/chef_fs/chef_fs_data_store.rb:253:increate’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/data_store/v1_to_v2_adapter.rb:34:in block in create' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/data_store/v1_to_v2_adapter.rb:113:infix_exceptions’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/data_store/v1_to_v2_adapter.rb:33:in create' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/rest_base.rb:183:increate_data’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/endpoints/rest_list_endpoint.rb:31:in post' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/endpoints/nodes_endpoint.rb:24:inpost’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/rest_base.rb:62:in call' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/rest_router.rb:24:incall’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/server.rb:665:in block in app' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/server.rb:337:inhandle_socketless_request’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/socketless_server_map.rb:87:in request' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-zero-5.1.0/lib/chef_zero/socketless_server_map.rb:33:inrequest’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http/socketless_chef_zero_client.rb:154:in request' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http.rb:340:inblock in send_http_request’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http.rb:372:in block in retrying_http_errors' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http.rb:370:inloop’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http.rb:370:in retrying_http_errors' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http.rb:333:insend_http_request’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http.rb:148:in request' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/http.rb:131:inpost’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/node.rb:616:in create' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/node.rb:569:inrescue in find_or_create’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/node.rb:565:in find_or_create' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/policy_builder/dynamic.rb:72:inload_node’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/client.rb:468:in load_node' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/client.rb:270:inrun’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application.rb:276:in run_with_graceful_exit_option' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application.rb:252:inblock in run_chef_client’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/local_mode.rb:44:in with_server_connectivity' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application.rb:235:inrun_chef_client’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application/client.rb:464:in sleep_then_run_chef_client' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application/client.rb:451:inblock in interval_run_chef_client’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application/client.rb:450:in loop' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application/client.rb:450:ininterval_run_chef_client’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application/client.rb:434:in run_application' [0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/lib/chef/application.rb:59:inrun’
[0mC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44-universal-mingw32/bin/chef-client:26:in <top (required)>' [0mC:/opscode/chef/bin/chef-client:68:inload’
[0mC:/opscode/chef/bin/chef-client:68:in `’[0m

[0mPlatform:[0m
---------[0m
x64-mingw32[0m

[0m[2016-12-13T13:33:11+00:00] ERROR: Running exception handlers
[2016-12-13T13:33:11+00:00] ERROR: Exception handlers complete
[2016-12-13T13:33:11+00:00] FATAL: Stacktrace dumped to C:/Windows/system32/config/systemprofile/.chef/local-mode-cache/cache/chef-stacktrace.out
[2016-12-13T13:33:11+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-12-13T13:33:11+00:00] FATAL: Net::HTTPFatalError: 500 “Internal Server Error”

Scheduled task is running with the following user principal:

New-ScheduledTaskPrincipal -UserID “NT AUTHORITY\SYSTEM” -LogonType ServiceAccount -RunLevel Highest

Any suggestions?
Thanks.
Andrew.


#2

Yes this is a regression error that appears in 12.17. The forthcoming 12.18 fixes this error (see https://github.com/chef/chef/pull/5693). 12.18 should be released soon (next week I believe) but you could download it now from our current channel.