{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef/issues/5444","repository_url":"https://api.github.com/repos/chef/chef","labels_url":"https://api.github.com/repos/chef/chef/issues/5444/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef/issues/5444/comments","events_url":"https://api.github.com/repos/chef/chef/issues/5444/events","html_url":"https://github.com/chef/chef/issues/5444","id":182391402,"number":5444,"title":"User resource fails with \"usermod: no flags given\"","user":{"login":"phene","id":166528,"avatar_url":"https://avatars.githubusercontent.com/u/166528?v=3","gravatar_id":"","url":"https://api.github.com/users/phene","html_url":"https://github.com/phene","followers_url":"https://api.github.com/users/phene/followers","following_url":"https://api.github.com/users/phene/following{/other_user}","gists_url":"https://api.github.com/users/phene/gists{/gist_id}","starred_url":"https://api.github.com/users/phene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phene/subscriptions","organizations_url":"https://api.github.com/users/phene/orgs","repos_url":"https://api.github.com/users/phene/repos","events_url":"https://api.github.com/users/phene/events{/privacy}","received_events_url":"https://api.github.com/users/phene/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-10-11T22:32:29Z","updated_at":"2016-10-13T05:57:55Z","closed_at":null,"body":"## Description\r\n\r\nUser resource errors consistently for a couple of specific users in long-standing environment after upgrade of chef client from 12.5.1. \"usermod: no flags given\"\r\n\r\n## Chef Version\r\n\r\n12.15.24\r\n12.14.89\r\n\r\n## Platform Version\r\n\r\nUbuntu 12.04\r\n\r\n## Replication Case\r\n\r\nI have not found a consistent way to replicate this in a fresh environment, but here are the user resources giving me problems:\r\n\r\n```ruby\r\nuser 'pushsvr' do\r\n  uid 616\r\n  gid 616\r\n  comment 'push service account'\r\n  home push_basedir\r\n  shell '/usr/sbin/nologin'\r\n  system true\r\nend\r\n\r\nuser 'esearch' do\r\n  action :create\r\n  uid 621\r\n  gid 621\r\n  comment 'Elasticsearch service account'\r\n  home elasticsearch_base\r\n  shell '/bin/false'\r\nend\r\n```\r\n\r\n## Chef Output\r\n\r\n```\r\n22:57:16  myserver.mydomain:   * linux_user[pushsvr] action create\r\n22:57:16  myserver.mydomain: [2016-10-11T22:57:16+00:00] INFO: Processing linux_user[pushsvr] action create (switchboard::default line 62)\r\n22:57:16  myserver.mydomain: ================================================================================    \r\n22:57:16  myserver.mydomain: Error executing action `create` on resource 'linux_user[pushsvr]'\r\n```\r\n\r\n## Stacktrace\r\n```\r\n>>>> Caused by Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'\r\n---- Begin output of [\"usermod\", \"pushsvr\"] ----\r\nSTDOUT:\r\nSTDERR: usermod: no flags given\r\n---- End output of [\"usermod\", \"pushsvr\"] ----\r\nRan [\"usermod\", \"pushsvr\"] returned 2\r\n/opt/chef/ruby/2.2.0/gems/mixlib-shellout-2.2.7/lib/mixlib/shellout.rb:289:in `invalid!'\r\n/opt/chef/ruby/2.2.0/gems/mixlib-shellout-2.2.7/lib/mixlib/shellout.rb:276:in `error!'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/mixin/shell_out.rb:45:in `shell_out!'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/provider/user/linux.rb:31:in `manage_user'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/provider/user.rb:135:in `block in action_create'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/mixin/why_run.rb:52:in `add_action'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/provider.rb:176:in `converge_by'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/provider/user.rb:134:in `action_create'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/provider.rb:145:in `run_action'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/resource.rb:603:in `run_action'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/runner.rb:69:in `run_action'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/runner.rb:97:in `block (2 levels) in converge'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/runner.rb:97:in `each'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/runner.rb:97:in `block in converge'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/resource_collection/stepable_iterator.rb:114:in `call'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/runner.rb:96:in `converge'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/client.rb:669:in `block in converge'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/client.rb:664:in `catch'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/client.rb:664:in `converge'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/client.rb:703:in `converge_and_save'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/client.rb:283:in `run'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/application.rb:302:in `block in fork_chef_client'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/application.rb:290:in `fork'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/application.rb:290:in `fork_chef_client'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/application.rb:255:in `block in run_chef_client'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/local_mode.rb:44:in `with_server_connectivity'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/application.rb:243:in `run_chef_client'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/application/client.rb:450:in `loop'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/application/client.rb:450:in `interval_run_chef_client'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/application/client.rb:434:in `run_application'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/lib/chef/application.rb:60:in `run'\r\n/opt/chef/ruby/2.2.0/gems/chef-12.15.24/bin/chef-client:26:in `<top (required)>'\r\n/opt/chef/bin/chef-client:12:in `load'\r\n/opt/chef/bin/chef-client:12:in `<main>'\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/chef/chef/issues/comments/253421342","html_url":"https://github.com/chef/chef/issues/5444#issuecomment-253421342","issue_url":"https://api.github.com/repos/chef/chef/issues/5444","id":253421342,"user":{"login":"lamont-granquist","id":454857,"avatar_url":"https://avatars.githubusercontent.com/u/454857?v=3","gravatar_id":"","url":"https://api.github.com/users/lamont-granquist","html_url":"https://github.com/lamont-granquist","followers_url":"https://api.github.com/users/lamont-granquist/followers","following_url":"https://api.github.com/users/lamont-granquist/following{/other_user}","gists_url":"https://api.github.com/users/lamont-granquist/gists{/gist_id}","starred_url":"https://api.github.com/users/lamont-granquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamont-granquist/subscriptions","organizations_url":"https://api.github.com/users/lamont-granquist/orgs","repos_url":"https://api.github.com/users/lamont-granquist/repos","events_url":"https://api.github.com/users/lamont-granquist/events{/privacy}","received_events_url":"https://api.github.com/users/lamont-granquist/received_events","type":"User","site_admin":false},"created_at":"2016-10-13T05:57:55Z","updated_at":"2016-10-13T05:57:55Z","body":"can you combine the two `selects` into one that calls `#to_s` on the :comment, :shell, :password fields as well?\r\n\r\nsince it looks that only returns a boolean you also don't really need to accumulate the array and call `#any?` on it, you can probably short-circuit that and just `return true` the first conditional that matches\r\n\r\nyou should submit a PR..."}}
{"actor":{"display_login":"lamont-granquist"}}