Skip to content

Instantly share code, notes, and snippets.

@ocxo
Created May 14, 2013 13:40
Show Gist options
  • Save ocxo/5575948 to your computer and use it in GitHub Desktop.
Save ocxo/5575948 to your computer and use it in GitHub Desktop.
Starting Chef Client, version 11.4.4
[2013-05-14T09:26:27-04:00] WARN: Run List override has been provided.
[2013-05-14T09:26:27-04:00] WARN: Original Run List: []
[2013-05-14T09:26:27-04:00] WARN: Overridden Run List: [recipe[teamcity::agent_osx]]
[2013-05-14T09:26:27-04:00] WARN: found a directory cookbook-teamcity in the cookbook path, but it contains no cookbook files. skipping.
Compiling Cookbooks...
[2013-05-14T09:26:27-04:00] WARN: This recipe uses encrypted data bags, which are not supported on Chef Solo - fallback to node attribute.
Converging 14 resources
Recipe: teamcity::agent_osx
* remote_file[/tmp/teamcity-7.1.5.tar.gz] action create_if_missing (up to date)
* execute[unpack teamcity] action run (up to date)
* user_account[teamcity] action createRecipe: <Dynamically Defined Resource>
* user[teamcity] action create
- create user user[teamcity]
[2013-05-14T09:26:28-04:00] WARN: Cloning resource attributes for directory[/Users/teamcity/.ssh] from prior resource (CHEF-3694)
[2013-05-14T09:26:28-04:00] WARN: Previous directory[/Users/teamcity/.ssh]: /etc/chef/cookbooks/teamcity/recipes/agent_osx.rb:35:in `from_file'
[2013-05-14T09:26:28-04:00] WARN: Current directory[/Users/teamcity/.ssh]: /etc/chef/cookbooks/user/providers/account.rb:114:in `block in dir_resource'
================================================================================
Error executing action `create` on resource 'user_account[teamcity]'
================================================================================
ArgumentError
-------------
can't find user for teamcity
Cookbook Trace:
---------------
/etc/chef/cookbooks/user/providers/account.rb:116:in `getpwnam'
/etc/chef/cookbooks/user/providers/account.rb:116:in `block (2 levels) in dir_resource'
/etc/chef/cookbooks/user/providers/account.rb:114:in `block in dir_resource'
/etc/chef/cookbooks/user/providers/account.rb:113:in `each'
/etc/chef/cookbooks/user/providers/account.rb:113:in `dir_resource'
/etc/chef/cookbooks/user/providers/account.rb:33:in `block in class_from_file'
Resource Declaration:
---------------------
# In /etc/chef/cookbooks/teamcity/recipes/agent_osx.rb
27: user_account user do
28: comment "TeamCity agent user"
29: system_user false
30: create_group true
31: ssh_keygen false
32: action :create
33: end
34:
Compiled Resource:
------------------
# Declared in /etc/chef/cookbooks/teamcity/recipes/agent_osx.rb:27:in `from_file'
user_account("teamcity") do
action [:create]
updated true
updated_by_last_action true
retries 0
retry_delay 2
cookbook_name :teamcity
recipe_name "agent_osx"
comment "TeamCity agent user"
create_group true
username "teamcity"
end
[2013-05-14T09:26:28-04:00] ERROR: Running exception handlers
[2013-05-14T09:26:28-04:00] ERROR: Exception handlers complete
Chef Client failed. 1 resources updated
[2013-05-14T09:26:28-04:00] FATAL: Stacktrace dumped to /etc/chef/chef-stacktrace.out
[2013-05-14T09:26:28-04:00] FATAL: ArgumentError: user_account[teamcity] (teamcity::agent_osx line 27) had an error: ArgumentError: can't find user for teamcity
@fnichol
Copy link

fnichol commented May 14, 2013

It's looking like Ruby's Etc.getpwnam method (from stdlib) is responsible for the ArgumentError being thrown. Since this syscall queries /etc/password I thought I'd take a look on my 10.8.3 system and don't see my own user in there. Now that I think about it, I'm not overly surprised since the Mac is using that dscl stuff. I think we'll have to add this to the issues list which needs a good clearing… this week?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment