You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by zhang juntao <ju...@gmail.com> on 2016/03/21 07:31:44 UTC
TypeError: getpwnam() argument 1 must be string, not None
hi all,
I have been using ambari to manage our cluster of hadoop, now i met a problem that i can’t push command to agents , there always some exception like:
Traceback (most recent call last):
File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py", line 35, in <module>
BeforeAnyHook().execute()
File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 219, in execute
method(env)
File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py", line 29, in hook
setup_users()
File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py", line 41, in setup_users
groups = params.user_to_groups_dict[user],
File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 154, in __init__
self.env.run()
File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 158, in run
self.run_action(resource, action)
File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 121, in run_action
provider_action()
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/accounts.py", line 44, in action_create
if not self.user:
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/accounts.py", line 94, in user
return pwd.getpwnam(self.resource.username)
TypeError: getpwnam() argument 1 must be string, not None
Error: Error: Unable to run the custom hook script ['/usr/bin/python2', '/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py', 'ANY', '/var/lib/ambari-agent/data/command-3281.json', '/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY', '/var/lib/ambari-agent/data/structured-out-3281.json', 'INFO', '/var/lib/ambari-agent/tmp']
i find there is a jira bug (https://issues.apache.org/jira/browse/AMBARI-13401 <https://issues.apache.org/jira/browse/AMBARI-13401>)
Is this a bug of ambari? how can I fix this issue?
thanks
juntao
Re: TypeError: getpwnam() argument 1 must be string, not None
Posted by Alejandro Fernandez <af...@hortonworks.com>.
Hi Juntao, thank you for finding this. Can you add the Ambari version to the Jira.?
Any steps to reproduce?
Thanks,
Alejandro
From: zhang juntao <ju...@gmail.com>>
Reply-To: "user@ambari.apache.org<ma...@ambari.apache.org>" <us...@ambari.apache.org>>
Date: Sunday, March 20, 2016 at 11:31 PM
To: "user@ambari.apache.org<ma...@ambari.apache.org>" <us...@ambari.apache.org>>, "dev@ambari.apache.org<ma...@ambari.apache.org>" <de...@ambari.apache.org>>
Subject: TypeError: getpwnam() argument 1 must be string, not None
hi all,
I have been using ambari to manage our cluster of hadoop, now i met a problem that i can't push command to agents , there always some exception like:
Traceback (most recent call last):
File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py", line 35, in <module>
BeforeAnyHook().execute()
File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 219, in execute
method(env)
File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py", line 29, in hook
setup_users()
File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py", line 41, in setup_users
groups = params.user_to_groups_dict[user],
File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 154, in __init__
self.env.run()
File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 158, in run
self.run_action(resource, action)
File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 121, in run_action
provider_action()
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/accounts.py", line 44, in action_create
if not self.user:
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/accounts.py", line 94, in user
return pwd.getpwnam(self.resource.username)
TypeError: getpwnam() argument 1 must be string, not None
Error: Error: Unable to run the custom hook script ['/usr/bin/python2', '/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py', 'ANY', '/var/lib/ambari-agent/data/command-3281.json', '/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY', '/var/lib/ambari-agent/data/structured-out-3281.json', 'INFO', '/var/lib/ambari-agent/tmp']
i find there is a jira bug (https://issues.apache.org/jira/browse/AMBARI-13401)
Is this a bug of ambari? how can I fix this issue?
thanks
juntao