Remember this password? scheduler.SubmitJob(job, _clusterUserName, _clusterUserPwd); hangs RRS feed

  • Question

  • I have a simple test case to submit a job.  If you give it a proper use and password, it works.

    However, if as example I left the domain off the user ('phil' instead of 'dom\phil'), the submit hangs and all I get back is:

    "Enter the password for 'phil' to connect to '700IRV17170DT02': )Remember this password? (Y/N)member this password?"

     Simple as it gets code: how to NOT get hung:

    public static void TestConnect(string headNodeComputerName, string userName, string userPwd)
       using (IScheduler scheduler = new Scheduler())
          ISchedulerJob job = scheduler.CreateJob();
          ISchedulerTask task = job.CreateTask();
          task.CommandLine = "echo hello world";
          scheduler.SubmitJob(job, userName, userPwd);

    Wednesday, June 25, 2014 3:58 PM

All replies

  • You can run the command line blow to save credential on the head node:

    1. open a cmd window

    2. run "Cluscfg setcreds /password:****** /user:phil

    Then the user credential will be saved on head node, after that, you will not be prompted unless you change user password.

    Monday, June 30, 2014 5:27 AM
  • Thanks for replying, but that's not really the issue.  The problem is when we deploy our application to our clients HPC system, they have to give us their credentials they want us to use in a config file.  If the person makes a simple typo, then my application hangs.  Any other similar point in any other basic application (where you provide credentials for almost anything) properly fails if something doesn't line up.  Having the 'submit' method simply hang whilst writing 'remember the password' to stdout behind the scenes and never returning is just a plain bug.  So right now all I can tell clients is "don't type it wrong", and if our deploy tool never ever comes back, kill it in task manager and verify what you typed in.  If the darn thing would at least time out, or only ask 100 times, anything, then my submit would hopefully at least come back with an error or exception or something so I could then tell the user what's going on.

    I did find one other person that had noted this same behavior, but apparently there isn't enough concern to get any traction.  As long as my users don't make a mistake, everybody is happy.  It's just the case where he didn't and it took me 2 days to figure it out when it's unhappy.


    Wednesday, July 9, 2014 3:04 PM
  • Basically, HPC user submit job can be done with following steps:

    1. User1 logon the client machine

    2. User1 run Cluscfg setcreds /password:****** /user:User1 to save credential

    3. Then User1 can submit job with scheduler.SubmitJob(job, null, null);

    The user don't need to provider password every time as long as he/she logon the machine and doesn't change password.

    In your case, you are using scheduler.SubmitJob(job, userName, userPwd); which need to ensure the username and password to be correct every time, because the username is typing by user (which can make mistake), acutally HPC can get current logon user name automatically.

    Tuesday, July 15, 2014 3:50 AM
  • I am having a similar issue.

    The answer does not to solve my problem.

    • The user only knows the username and password (which is input in a windows application).
    • The user does now know how to open a console window, or log on a remote server, or execute cluscfg.

    I need to verify if a given username/password combination is accepted or not.

    This must be done programatically.

    Is there any command that can be executed to get a boolean (true/false) result?

    (Posting here sine this showed up on google and other people might look in the same place)

    • Edited by PBjoernerud Wednesday, December 9, 2015 10:11 AM
    Wednesday, December 9, 2015 10:09 AM
  • This can be done by "scheduler.SetInterfaceMode(false, new IntPtr(-1));".

    Then if the username/password is not correct, an InvalidCredentialException would be thrown when calling "scheduler.SubmitJob(job, userName, userPwd);".


    Yutong Sun

    • Proposed as answer by PBjoernerud Thursday, December 10, 2015 9:56 AM
    Thursday, December 10, 2015 7:18 AM
  • Thank you, this solved my problem.

    I was not aware of the SetInterfaceMode. To specify that it is not running as console is exactly what I wanted.

    Thursday, December 10, 2015 9:59 AM