I have started getting an InvalidCredentialException error

Hi,

I am running a client/server application using remoting. I start the server okay and have multiple clients connected and using the system for a number of hours when suddenly I get lots System.Security.Authentication.InvalidCredentialException exceptions thrown. The exceptions keep occuring until I stop and re-start the server application.

Here is the full exception trace:-

Error Log

[26/09/2007 11:32:10.820 ERROR]: mscorlib,RealProxy.HandleReturnMessage sysspear on LONS0637:
Failed to post DataChanged message to subscribed view with credentials failure.
[System.Security.Authentication.InvalidCredentialException]: The server has rejected the client credentials. at mscorlib,RealProxy.HandleReturnMessage.
Stack Trace:

Server stack trace:
at System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
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.SocketCache.CreateSocketHandler(Socket socket, String machineAndPort)
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 Nomura.EFT.Infrastructure.ViewManager.IView.DataChanged(Subject subject)
at Nomura.EFT.Infrastructure.ViewManager.ModelBase.PostSubscriberDataChanged(ModelSubscriber subscriber, Subject subject)
Inner Exceptions:
[System.ComponentModel.Win32Exception]: The logon attempt failed at Unknown Source,Unknown method.

Here is my remoting configuration:-

Code Snippet

<system.runtime.remoting>

<customErrorsmode="off" />

<applicationname="Spear">

<lifetimeleaseManagerPollTime="10S"leaseTime="5M"renewOnCallTime="2M"sponsorshipTimeout="2M" />

<channels>

<channelref="tcp"port="8001"secure="true"impersonate="true"tokenimpersonationlevel="Impersonation">

<serverProviders>

<providerref="wsdl" />

<formatterref="binary"typeFilterLevel="Full" />

</< FONT>serverProviders>

<clientProviders>

<formatterref="binary" />

</< FONT>clientProviders>

</< FONT>channel>

<channeltype="Ch.Elca.Iiop.IiopChannel,IiopChannel"port="9000" />

</< FONT>channels>

.....

</< FONT>application>

</< FONT>system.runtime.remoting>

Here is my code calling remoting configuration:-

Code Snippet

// Initialise remoting ...

if (System.Runtime.Remoting.RemotingConfiguration.ApplicationName ==null)

{

System.Runtime.Remoting.RemotingConfiguration.Configure(System.AppDomain.CurrentDomain.SetupInformation.ConfigurationFile,false);

}

Any help is much appreciated,

Jeremy

[10700 byte] By [JeremyCupit] at [2008-1-10]
# 2

Sorry but linking to that post does not help very much. At no point did a user enter an incorrect username/password. The channel is okay to begin with but fails at a later time.

Jeremy

JeremyCupit at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 3

Do you get the exceptions in all clients?

Does restarting the client and not the server solve the problem?

AlbertoArias-MSFT at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 4

Hi,

The error is on the server not the client. I am using an MVC system design, and the error occurs when the server attempts to access the view object via remoting onto the client.

Restarting the client does not cure the problem. I'm don't know if closing down all clients would fix the problem as trying to arrange for all users to quit the application (it's an organisation wide application) is hard to do.

Jeremy

JeremyCupit at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 5

Hi,

This is interesting, the client then becomes the server I guess :-)

Can you please give us more details on how the server gets the reference to the object in the client?

Thank you.

AlbertoArias-MSFT at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 6

I bet you are using Delegates, Events or are holding MarshalByRefObjects to the client on the server side. When you start seeing the exceptions? What is happening in the clients? Are they sitting idle?

Thanks,

JR

JesusRuiz(MSFT) at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...

.NET Development

Site Classified