locked
Schedule from remote RRS feed

  • Question

  • Hi,
    when I use the Scheduler object remotely:

    IScheduler store = new Scheduler();
    store.Connect(headNodeHost);

    the Connect method throws this exception:

    System.Security.Authentication.InvalidCredentialException
    with Message "The server has rejected the client credentials."
    (see below for the full exception detail)

    I don't see a way to specify the credential, and, of course, I don't want to run the application with an account added in hpc server :).
    I've seen the method IScheduler.SubmitJob that takes an username and a password but I cannot invoke this method before the IScheduler.Connect, so I can't use this to provide my credentials.

    It's a bug or there is a way to connect remotely? :)

    Thanks,
    Marco


    The full exception detail:
    ---------------------------------------
    System.Security.Authentication.InvalidCredentialException was unhandled
      Message="The server has rejected the client credentials."
      Source="mscorlib"
      StackTrace:
        Server stack trace:
           at System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult)
           at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.CreateAuthenticatedStream(Stream netStream, String machinePortAndSid)
           at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.CreateSocketHandler(Socket socket, SocketCache socketCache, String machinePortAndSid)
           at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(EndPoint ipEndPoint)
           at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
           at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
           at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
           at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
           at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
        Exception rethrown at [0]:
           at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
           at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
           at Microsoft.Hpc.Scheduler.Store.ISchedulerStoreInternal.Register(String agentName, String userName, ConnectionRole role, ConnectionToken& token, UserPrivilege& privilege)
           at Microsoft.Hpc.Scheduler.Store.StoreServer._Connect()
           at Microsoft.Hpc.Scheduler.Store.StoreServer.Connect(String server, Int32 port)
           at Microsoft.Hpc.Scheduler.Store.SchedulerStoreSvc..ctor(String server, Int32 port)
           at Microsoft.Hpc.Scheduler.Store.SchedulerStoreSvc.RemoteConnect(String server, Int32 port)
           at Microsoft.Hpc.Scheduler.Store.SchedulerStore.Connect(String server)
           at Microsoft.Hpc.Scheduler.Scheduler.Connect(String cluster)
           at Myform.getScheduler(String headNode) in C:\Users\mura\Documents\Visual Studio 2008\Projects\IsPrime\IsPrimeFormHPC_API_fs\myform.fs:line 27
           at Myform.MyForm.get_ButtonHeadConnectClick() in C:\Users\mura\Documents\Visual Studio 2008\Projects\IsPrime\IsPrimeFormHPC_API_fs\myform.fs:line 132
           at Myform.ctor@81_2.Invoke(EventArgs _arg1) in C:\Users\mura\Documents\Visual Studio 2008\Projects\IsPrime\IsPrimeFormHPC_API_fs\myform.fs:line 81
           at Myform.ctor@81_1.Invoke(Object sender, EventArgs e) in C:\Users\mura\Documents\Visual Studio 2008\Projects\IsPrime\IsPrimeFormHPC_API_fs\myform.fs:line 81
           at System.Windows.Forms.Control.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
           at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
           at System.Windows.Forms.Control.WndProc(Message& m)
           at System.Windows.Forms.ButtonBase.WndProc(Message& m)
           at System.Windows.Forms.Button.WndProc(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
           at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
           at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
           at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
           at <StartupCode$isprimeformhpc_api_fs>.$Myform._main() in C:\Users\mura\Documents\Visual Studio 2008\Projects\IsPrime\IsPrimeFormHPC_API_fs\myform.fs:line 177
      InnerException: System.ComponentModel.Win32Exception
           Message="The logon attempt failed"
           ErrorCode=-2147467259
           NativeErrorCode=-2146893044
           InnerException:

    Thursday, July 3, 2008 1:27 AM

Answers

  • The IScheduler Connect() API connects to the scheduler using your Windows Credential Manager credentials . . . namely the creds for the account that you are logged in with (so the logged in account will need to be a User or Admin on the cluster).

    If you want to use different credentials than you are logged in with (for example because you are not logged in with a domain account), you can set your credentials in the Control Panel by going to User Accounts -> Manage Network Passwords.

    Thanks,
    Josh
    -Josh
    Monday, July 7, 2008 3:33 AM
    Moderator