C# windows server 2008 r2 win32exception - iis-7.5

We have a .net 2.0 exe that we are running on windows server 2008 r2. It gets stucks and stops with below info on Event log.
The same used to run correctly on windows server 2003. there are no code changes or rebuilds done in the migration to windows server 2008 r2.
We have tried putting lots of logs in exception in our code, but not sure from which line of code this error popups, but our normal logs do popup in the eventvwr, so doesnt look like permission issue on event viewer.
Any help or pointers on this would be helpful.
1) Exception Information
*********************************************
Exception Type: System.ComponentModel.Win32Exception
NativeErrorCode: 87
ErrorCode: -2147467259
Message: The parameter is incorrect
Data: System.Collections.ListDictionaryInternal
TargetSite: Void InternalWriteEvent(UInt32, UInt16, System.Diagnostics.EventLogEntryType, System.String[], Byte[], System.String)
HelpLink: NULL
Source: System
2) StackTrace Information
*********************************************
at System.Diagnostics.EventLog.InternalWriteEvent(UInt32 eventID, UInt16 category, EventLogEntryType type, String[] strings, Byte[] rawData, String currentMachineName)
at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category)
at DefaultPublisher.WriteToLog(String entry, EventLogEntryType type)
at DefaultPublisher.Publish(Exception exception, NameValueCollection additionalInfo, NameValueCollection configSettings)
at ExceptionManager.Publish(Exception exception, NameValueCollection additionalInfo)

The message passed to WriteEntry() is too long. It's length must be less than 32706 characters

Related

CodeNameNotUniqueException after applying hotfix Kentico 7

I am having a 'CodeNameNotUniqueException' error whereby after upgrading from v7.0.37 to v7.0.70 I am getting an error on loading my website. It looks like it is related to something to do with roles as the code name 'int-sg-ctx-nz-xa6-publisheddesktopoffice2013' is a role in my website. It basically happens to all the roles and not just this one. This is the error message that I get in event viewer:
Exception information:
Exception type: CodeNameNotUniqueException
Exception message: The object with code name 'int-sg-ctx-nz-xa6-publisheddesktopoffice2013' already exists.
at CMS.DataEngine.AbstractInfoProvider`2.SetInfoInternal(InfoType info)
at CMS.DataEngine.AbstractInfoProvider`2.SetInfo(InfoType info)
at CMS.SiteProvider.UserInfoProvider.EnsureRolesAndSitesInternal(UserInfo uInfo, Boolean isWindowsAuth)
at CMS.CMSHelper.AuthenticationHelper.EnsureExternalUser(UserInfo uInfo)
at CMS.CMSHelper.AuthenticationHelper.AuthenticateWindowsUser(String userName, SecurityIdentifier sid, String siteName, String[] roles)
at CMS.CMSHelper.ContextData.GetCurrentUser(Boolean& loadUserData, Boolean cacheResult)
at CMS.CMSHelper.ContextData.get_CurrentUser()
at CMSAppBase.CMSSessionStart(Object sender, EventArgs e)
at System.Web.SessionState.SessionStateModule.CompleteAcquireState()
at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Request information:
Request URL: http://aainsurance/CMSPages/PortalTemplate.aspx?aliaspath=/home
Request path: /CMSPages/PortalTemplate.aspx
User host address: 10.212.210.58
User: INT\U362515
Is authenticated: True
Authentication Type: NTLM
Thread account name: IIS APPPOOL\AAI.Intranet
Thread information:
Thread ID: 58
Thread account name: IIS APPPOOL\AAI.Intranet
Is impersonating: False
Stack trace: at CMS.DataEngine.AbstractInfoProvider`2.SetInfoInternal(InfoType info)
at CMS.DataEngine.AbstractInfoProvider`2.SetInfo(InfoType info)
at CMS.SiteProvider.UserInfoProvider.EnsureRolesAndSitesInternal(UserInfo uInfo, Boolean isWindowsAuth)
at CMS.CMSHelper.AuthenticationHelper.EnsureExternalUser(UserInfo uInfo)
at CMS.CMSHelper.AuthenticationHelper.AuthenticateWindowsUser(String userName, SecurityIdentifier sid, String siteName, String[] roles)
at CMS.CMSHelper.ContextData.GetCurrentUser(Boolean& loadUserData, Boolean cacheResult)
at CMS.CMSHelper.ContextData.get_CurrentUser()
at CMSAppBase.CMSSessionStart(Object sender, EventArgs e)
at System.Web.SessionState.SessionStateModule.CompleteAcquireState()
at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Can anyone help with this? As of now I've had to rollback the database and restore the files for version 37 which is a shame as this version is not fully compatible with IE11.
Are you somewhere editing/creating user`s ID or GUID manually in your custom code?
Just FYI - kentico 7 has released more than one year before release of IE11 so it is really hard to support not existing product... Source: wiki devnet

Customer Search By Email

We have created a new OzLINK_WSE Web Service Endpoint for 5.30.001 and created a definition OzCustomer to enable searching based on Email address.
WSE Definition
We have tried two different searches but neither of them are working:-
The first (GetList)
var cust = c.GetList(new OzCustomer { Email = new StringValue { Value = "info#active-staffing.con" } }, false).Cast<OzCustomer>();
returns this error
An unhandled exception of type 'System.ServiceModel.FaultException' occurred in mscorlib.dll
Additional information: System.Web.Services.Protocols.SoapException: Server was unable to process request. --->
PX.Api.ContractBased.OperationDoesNotSupportValuesException: Operation does not support values.
at PX.Api.ContractBased.EntityService.GetList(EntityGateBase gate, String version, String name,
EntityImpl entity, Boolean returnFullEntities, Boolean ignoreValueFields, PXGraph graph)
at PX.Api.ContractBased.Soap.EntityGate.GetList(Entity entity, Boolean returnFullEntities)
--- End of inner exception stack trace ---
The second (Get)
var cust = c.Get(new OzCustomer { Email = new StringValue { Value = "info#active-staffing.con" } });
returns a different error
An unhandled exception of type 'System.ServiceModel.FaultException' occurred in mscorlib.dll
Additional information: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> PX.Api.ContractBased.MoreThanOneEntitySatisfiesTheConditionException: More than one entity satisfies the condition.
at PX.Api.ContractBased.EntityService.Get(EntityGateBase gate, String version, String name, EntityImpl entity, Boolean returnFullEntity, PXGraph graph)
at PX.Api.ContractBased.Soap.EntityGate.Get(Entity entity)
--- End of inner exception stack trace ---
Could someone please advise how we can search for a Contact via Email address and avoid these issues.
Use StringSearch instead of StringValue in GetList:
var cust = c
.GetList(
new OzCustomer {
Email = new StringSearch { Value = "info#active-staffing.con" }
}, false)
.Cast<OzCustomer>();

Microsoft Exchange Web service :GetUserAvailability exception :System.ArgumentException: An item with the same key has already been added

try
{
results = this.exchangeService.GetUserAvailability(attendees, new TimeWindow(startTime, endTime), AvailabilityData.FreeBusy);
}
catch (Exception ex)
{
string attendeesString = string.Empty;
foreach (AttendeeInfo item in attendees)
{
attendeesString += item.SmtpAddress + "; ";
}
LogData logData = MethodLogUtilityForExchange.GetLogDataGetAttendeesAvailabilityDebug(attendeesString, startTime, endTime, ex);
LogUtility.LogException(logData, "EWS GetAttendeesAvailability Exception", ex, LogCategory.MethodInformation);
throw;
}
Exception stack trace :
ExceptionSystem.ArgumentException: An item with the same key has already been added.
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.Exchange.WebServices.Data.ExchangeServiceBase.SaveHttpResponseHeaders(WebHeaderCollection headers)
at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponse(HttpWebResponse response)
at Microsoft.Exchange.WebServices.Data.GetUserAvailabilityRequest.Execute()
at Microsoft.Exchange.WebServices.Data.ExchangeService.GetUserAvailability(IEnumerable`1 attendees, TimeWindow timeWindow, AvailabilityData requestedData)
at Intel.Exchange.WebServices.Extension.ExchangeServiceManager.GetAttendeesAvailability(List`1 attendees, DateTime startTime, DateTime endTime)
Can you help in understanding the issue ? we are not handling any Dictionary explicitly here. but still we see the Dictionary key error. Not sure What would have gone wrong.
You might not be using any Dictionary, but apparently EWS is in its HTTP response processing. It almost looks like EWS has returned a duplicate response header. You might have to get a Fiddler trace or some such to see that. One thing to check (altho how this would cause this error is beyond me): do each of the 'attendees' have a different SMTP address? Just a shot in the dark.

GetSchema() throws UciException "*HS.OLEDBINFO" is not in the CATALOG space"

I installed UniVerse on the administrator account of a Parallels Windows installation. I subsequently created a second administrator account whose credentials I'm using to create the U2Connection.
However, when attempting to call GetSchema(...) I'm getting the following exception. I suspect this is permission-related but I'm not sure what I need to change.
{" [U2][UCINET-UO] [U2][UCINET][UNIVERSE]:\"*HS.OLEDBINFO\" is not in the CATALOG space.\r\n"}
at U2.Data.Client.Ucinet.UciStatement.ExecuteDirect(String pSQL)
at U2.Data.Client.U2Command.a(CommandBehavior A_0)
at U2.Data.Client.U2Command.ExecuteReaderObject(CommandBehavior behavior, String method, U2CursorType reqCursorType, Boolean abortOnOptValueChg, Boolean skipDeleted, Boolean isResultSet, Int32 maxRows, Boolean skipInitialValidation)
at U2.Data.Client.U2Command.ExecuteReaderObject(CommandBehavior behavior, String method)
at U2.Data.Client.U2MetaDataFactory.b(U2Command& A_0, String A_1)
at U2.Data.Client.U2MetaDataFactory.v(String[] A_0)
at U2.Data.Client.U2MetaDataFactory.GetSchema(String collectionName, String[] restrictionValues)
at U2.Data.Client.U2Connection.GetSchema(String collectionName, String[] restrictionValues)
at U2.Data.Client.U2Connection.GetSchema(String collectionName)
at Connection.Program.Main(String[] args) in c:\Program Files (x86)\Rocket Software\U2 Toolkit for .NET\U2 Database Provider\samples\C#\UniVerse\Connection\Program.cs:line 30
I'm told: He is right for the second administrator account. All UniVerse users must have the permission to access the global catalog subroutines. That “*HS.OLEDBINFO” (%AHS.OLEDBINFO) will be in the “C:\U2\UV\catdir” folder by default.
Does that help?

SharePoint SPRequest Leak

I have been getting this weird message in the ULS ever since I ported the code over to SharePoint 2010.
Here is the message:
w3wp.exe (0x1320)
0x1168 SharePoint Foundation
General
90hv
Unexpected
Detected use of SPRequest for previously closed SPWeb object. Please close SPWeb objects when you are done with all objects obtained from them, but not before.
Stack trace:
at Microsoft.SharePoint.SPWorkItem.FetchData()
at Microsoft.SharePoint.SPWorkItem.retrieveSchema(Schema schemaIndex)
at Microsoft.SharePoint.SPWorkItem.get_SiteId()
at Microsoft.SharePoint.SPWorkItem.Delete()
at Microsoft.SharePoint.Workflow.SPWinOeHostServices.WorkItemDequeue(Transaction txn, Object[] transData)
at Microsoft.SharePoint.Workflow.SPPendingWorkBatch.Commit(Transaction transaction, ICollection items)
at System.Workflow.Runtime.WorkBatch.PendingWorkCollection.Commit(Transaction transaction)
at System.Workflow.Runtime.WorkBatch.Commit(Transaction transaction)
at System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.CommitWorkBatch(CommitWorkBatchCallback commitWorkBatchCallback)
at System.Workflow.Runtime.Hosting.DefaultWorkflowCommitWorkBatchService.CommitWorkBatch(CommitWorkBatchCallback commitWorkBatchCallback)
at System.Workflow.Runtime.WorkflowExecutor.CommitTransaction(Activity activityContext)
at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation)
at System.Workflow.Runtime.WorkflowExecutor.System.Workflow.ComponentModel.IWorkflowCoreRuntime.PersistInstanceState(Activity activity)
at System.Workflow.ComponentModel.Activity.MarkClosed()
at System.Workflow.ComponentModel.Activity.ReleaseLockOnStatusChange(IActivityEventListener1 eventListener)
at System.Workflow.ComponentModel.FaultAndCancellationHandlingFilter.SafeReleaseLockOnStatusChange(ActivityExecutionContext context)
at System.Workflow.ComponentModel.FaultAndCancellationHandlingFilter.OnEvent(Object sender, ActivityExecutionStatusChangedEventArgs e)
at System.Workflow.ComponentModel.ActivityExecutorDelegateInfo1.ActivityExecutorDelegateOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
at System.Workflow.Runtime.Scheduler.Run()
at System.Workflow.Runtime.WorkflowExecutor.RunScheduler()
at System.Workflow.Runtime.WorkflowExecutor.RunSome(Object ignored)
at System.Workflow.Runtime.Hosting.DefaultWorkflowSchedulerService.WorkItem.Invoke(WorkflowSchedulerService service)
at System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService.RunOne(Guid workflowInstanceId)
at System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService.RunWorkflow(Guid workflowInstanceId)
at Microsoft.SharePoint.Workflow.SPWinOeHostServices.Send(SPWorkflow workflow, SPWinOeWorkflow winoeworkflow, SPWorkflowEvent e)
at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(SPWorkflowHostService host, SPWorkflow workflow, Collection1 events, TimeSpan timeOut)
at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow workflow, Collection1 events, SPWorkflowRunOptionsInternal runOptions)
at Microsoft.SharePoint.Workflow.SPWorkflowManager.StartWorkflowElev(Object context, SPWorkflowAssociation association, DateTime elevationTimeUtc, SPWorkflowEvent startEvent, SPWorkflowRunOptions runOptions)
at Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver.<>c_DisplayClass1.b_0(SPSite superUserSite, SPWeb superUserWeb)
at Microsoft.SharePoint.SPSecurity.<>c_DisplayClassf.b_e()
at Microsoft.SharePoint.SPSecurity.<>c_DisplayClass4.b_2()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
at Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver.AutoStartWorkflow(SPItemEventProperties properties, Boolean bCreate, Boolean bChange, AssocType atyp)
at Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver.ItemUpdated(SPItemEventProperties properties)
at Microsoft.SharePoint.SPEventManager.RunItemEventReceiver(SPItemEventReceiver receiver, SPUserCodeInfo userCodeInfo, SPItemEventProperties properties, SPEventContext context, String receiverData)
at Microsoft.SharePoint.SPEventManager.RunItemEventReceiverHelper(Object receiver, SPUserCodeInfo userCodeInfo, Object properties, SPEventContext context, String receiverData)
at Microsoft.SharePoint.SPEventManager.<>c_DisplayClassc`1.b_6()
at Microsoft.SharePoint.SPSecurity.RunAsUser(SPUserToken userToken, Boolean bResetContext, WaitCallback code, Object param)
at Microsoft.SharePoint.SPEventManager.InvokeEventReceivers[ReceiverType](SPUserToken userToken, Guid tranLockerId, RunEventReceiver runEventReceiver, Object receivers, Object properties, Boolean checkCancel)
at Microsoft.SharePoint.SPEventManager.InvokeEventReceivers[ReceiverType](Byte[] userTokenBytes, Guid tranLockerId, RunEventReceiver runEventReceiver, Object receivers, Object properties, Boolean checkCancel)
at Microsoft.SharePoint.SPEventManager.HandleEventCallback[ReceiverType,PropertiesType](Object callbackData)
at Microsoft.SharePoint.Utilities.SPThreadPool.WaitCallbackWrapper(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.Run(ExecutionContextexecutionContext, ContextCallback callback, Object state)
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
This message comes up whenever I run the workflow, it does not appear to have any harmful effects to the workflow.
Please let me know anything you folks know.
Here's the guidance from MS around the proper disposal of SharePoint objects. Odds are good that if you're following all of these (correctly) then your code will be ok. The SPDisposeCheck tool can also be helpful, although in my exeprience you still need to know all of the disposal rules. This tool only does a static analysis and can return a lot of candidate issues that may actually be fine.
When you read the exception more carefully you can see that you don't Forget to dispose the object. you reference it after it got disposed!
you can read more about it from the german SharePoint Guru Stefan Gossner

Resources