Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateUsers plugin bug? #513

Open
egvalentejr opened this issue Mar 20, 2015 · 0 comments
Open

CreateUsers plugin bug? #513

egvalentejr opened this issue Mar 20, 2015 · 0 comments

Comments

@egvalentejr
Copy link

GIVEN:

  1. Starcluster allows us to establish the plugins that must be executed at cluster creation time
  2. Starcluster allows us to execute plugins during the cluster existence.
  3. Starcluster's CreateUsers plugin can be executed as part of the creation or during cluster execution
  4. User creation can include one set of user names at cluster creation time and another set at runplugin time

QUESTION:

  1. What causes the CreateUsers plugin to behave one way at cluster creation time and another as a call to runplugin during cluster execution time?
  2. If we had userA and userB created at cluster start and ran the CreateUsers plugin during cluster execution with a different set of users say userC, userD should I not be in essence adding 2 new users?

EVIDENCE of inability to create new users (only gfekete exists at first) using this plugin after cluster creation:

Running plugin create_all_users
Creating 3 cluster users
Usernames listing ['aoloso', 'kskuo', 'gfekete']
newuser_names listing gfekete:3KrOjgGm:1001:1001:Cluster user account gfekete:/home/gfekete:/bin/bash

2/2 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 100%

Configuring passwordless ssh for 3 cluster users
!!! ERROR - Error occured while running plugin 'create_all_users':
!!! ERROR - Unhandled exception occured
Traceback (most recent call last):
File "/home/evalente/.virtualenvs/starcluster/StarCluster/starcluster/cli.py", line 274, in main
sc.execute(args)
File "/home/evalente/.virtualenvs/starcluster/StarCluster/starcluster/commands/runplugin.py", line 40, in execute
self.cm.run_plugin(plugin_name, cluster_tag)
File "/home/evalente/.virtualenvs/starcluster/StarCluster/starcluster/cluster.py", line 380, in run_plugin
cl.run_plugin(plug, name=plugin_name)
File "/home/evalente/.virtualenvs/starcluster/StarCluster/starcluster/cluster.py", line 1722, in run_plugin
func(*args)
File "/home/evalente/.virtualenvs/starcluster/StarCluster/starcluster/plugins/users.py", line 84, in run
auth_conn_key=True)
File "/home/evalente/.virtualenvs/starcluster/StarCluster/starcluster/node.py", line 500, in generate_key_for_user
home_folder = user.pw_dir
AttributeError: 'NoneType' object has no attribute 'pw_dir'

!!! ERROR - Oops! Looks like you've found a bug in StarCluster
!!! ERROR - Crash report written to: /home/evalente/.starcluster/logs/crash-report-20437.txt
!!! ERROR - Please remove any sensitive data from the crash report
!!! ERROR - and submit it to starcluster@mit.edu

PROBLEM LOCATION:

The function _get_newusers_batch_file behaves differently when the cluster is created and when the cluster is already running. The problem lies with the code:
if master.ssh.isfile(batch_file):
bfile = master.ssh.remote_file(batch_file, 'r')
bfilecontents = bfile.read()
bfile.close()
return bfilecontents
This piece of code identifies that the only the users present in the hidden file /root/.users/users.txt (the batch_file variable) are to be considered. However, the user name list is larger than the users.txt file contains. This leads to the attempt of generating a key to a user whose home folder does not exist.

SOLUTION/DISCUSSION:

Why have this check for a hidden users.txt file at all? Why not get rid of this conditional? Or if that is needed for some reason? How can we impart to the plugin a "skip users.txt definition" for those times that we are running the plugin during cluster execution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant