0x8000FFFF access violation when disposing Redemption RdoMail object - outlook-addin

Six of our 400+ users reported this error in the last two months:
System.Runtime.InteropServices.COMException (0x8000FFFF): Access violation at address 0000000000D7BA95
in module 'Redemption64.dll. Read of address FFFFFFFFFFFFFFFF
at System.IDisposable.Dispose()
This exception is raised just after a mail is saved on the user drive. The code that raises this exception is:
var msg = rdoMail as IDisposable;
if (msg != null)
msg.Dispose();
Any idea why this error occurs once in a while?
Notes:
Our Outlook 365 client version is "Product ID Version 2008 (Build 13127.20408 Click-to-Run Semi-Annual Entreprise Channel (Preview)"
The Redemption64.dll file version: 5.18.0.5142.

This problem (64 bit specific) was fixed about a month ago after version 5.24 was released. Please send an email to redemption (at) dimastr (dot) com for an updated version.

Related

NullReferenceException during compilation of a SQLCLR function

I am running a sql server function below on 5 different databases on sql 2016 instance:
select * FROM fn_myfunction('', 0, 0,'30 Apr 2015','1', 0)
And am getting this error message:
Msg 10313, Level 16, State 51, Line 1
An error occurred while using the .NET Framework during IL compilation. The server may be running out of resources. Try running the query again. If the problem persist, contact a support professional.
System.NullReferenceException: Object reference not set to an instance of an object.
System.NullReferenceException:
I have made a backup of these databases and restored to a different sql 2016 instance and the error disappeared. So I now think that this has nothing to do with my databases or sql code. This could be an environment issue?
Any suggestions please?
I have restarted my instance and this worked. The issue here was not db or code related as suggested by #Panagiotis because I used the same db on a different instance and could not reproduce the error. This was down to Memory being fully utilized. So I changed my memory settings and restarted the instance and worked like a hammer!!!!!!!!!!!!!!

Vb6 Adodb error codes with equivalent nativeerror

I need to know the list of Visual Basic 6 error codes returned by ADODB SQL Server connection. I also want to know the Err.Nativeerror for each SQL ADODB error code.
Any information about where we can get these errors codes or any VB6 codes which list the exceptions and error codes with descriptions of the error details and what the errors mean.
A table of the ADODB error codes with brief descriptions are located at ADO Programmer's Reference > ADO API Reference > ADO Enumerated Constants.
There is a note:
OLE DB errors may be passed to your ADO application. Typically, these
can be identified by a Windows facility code of 4. For example,
0x8004.
Also to determine if an HRESULT error code is an ADODB error, this additional note indicates:
Hexadecimal—The hexadecimal representation of the full error number.
The Windows facility code is in the fourth digit. The facility code
for ADO error numbers is A. For example: 0x800A0E7B.
See also [MS-ERREF]: Windows Error Codes from Microsoft which has a link to a pdf of a document from Microsoft with a fairly comprehensive list of codes and their descriptions. There is an RSS feed to subscribe for notifications of updates.
See as well as very comprehensive list of Error Codes list for Microsoft technologies from Symantech.
See this Wikipedia topic HRESULT describing the error code format used by Microsoft for HRESULT error codes. From the topic the format as to how bits are used is:
S - Severity - indicates success/fail
0 - Success
1 - Failure
R - Reserved portion of the facility code, corresponds to NT's second severity bit.
1 - Severe Failure
C - Customer. This bit specifies if the value is customer-defined or Microsoft-defined.
0 - Microsoft-defined
1 - Customer-defined
N - Reserved portion of the facility code. Used to indicate a mapped NT status value.
X - Reserved portion of the facility code. Reserved for internal use. Used to indicate HRESULT values that are not status values, but are instead message ids for display strings.
Facility - indicates the system service that is responsible for the error. Example facility codes are shown below (for the full list see [1]).
1 - RPC
2 - Dispatch (COM dispatch)
3 - Storage (OLE storage)
4 - ITF (COM/OLE Interface management)
7 - Win32 (raw Win32 error codes)
8 - Windows
9 - SSPI
10 - Control
11 - CERT (Client or server certificate)
...
Code - is the facility's status code
The ITF facility code has subsequently been recycled as the range in which COM components can define their own component-specific error code.
A few of the more common codes are:
adErrItemNotFound - -2146825023 or 0x800A0CC1 - Item cannot be found in the collection that corresponds to the requested name or ordinal.
adErrNoCurrentRecord - -2146825267 or 0x800A0BCD - Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
adErrObjectNotSet - -2146824868 or 0x800A0D5C - Object is no longer valid.
One programmer error that I have done myself which resulted in an HRESULT of 0x800A0CC1 when doing an Update() is that the I did not have my SAFEARRAY setup properly. See usage differences between _variant_t, COleVariant, CComVariant, and VARIANT and using SAFEARRAY variations.

Catastrophic failure followed by MAPI_E_INTERFACE_NOT_SUPPORTED when trying to AddPstStore

I am trying to add pst store from outlook addin using Redemption with the code:
RdoSession = Redemption.RedemptionLoader.new_RDOSession();
RdoSession.MAPIOBJECT = (AddinModule.CurrentInstance as AddinModule).OutlookApp.Session.MAPIOBJECT;
string path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + #"\Microsoft\Outlook\mystore.pst";
RDOStores stores = RdoSession.Stores;
RDOStore store = stores.AddPSTStore(path, Outlook.OlStoreType.olStoreDefault, "test");
Line stores.AddPstStore throws System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure and it creates mystore.pst in correct location with the size of 265 KBs. New store/data file is not displayed in outlook and it does not apear in RdoSession.Stores on next execution. So my program tries to create it again (since it didint found it) and then same line crashes with:
System.InvalidCastException: Error in IMsgServiceAdmin::AdminProviders: MAPI_E_INTERFACE_NOT_SUPPORTED
Using office PIAs code works without any problems:
https://msdn.microsoft.com/en-us/library/office/bb612380.aspx
I would keep redemption code since there is much more logic around it. I just moved these 5 lines to the begining of function to isolate the problem.
MAPI has a few marshaling bugs in the profile management interfaces (such as IMsgServiceAdmin).
Try to replace setting the RDOSession.MAPIOBJECT property with calling RDOSession.Logon.
Is you code running in a Outlook addin or a standalone app?

VB.Net "COMException was unhandled" Error

I have a VB.Net program written with .Net 2.0
I'm trying to write a code that logs entire registry entries into a log file.
I have got it to work wit the following code.
http://pastebin.com/kmA63cUe
However whenever I try to add an additional Registry key to log
LogPrint4("<-----------------HKLM/WebCheck-------------------->")
If reg.enumvalues(&H8000002, "Software\Microsoft\Windows\CurrentVersion\WebCheck", keys2, types) = 0 Then
If IsArray(keys2) Then
For p = 0 To UBound(keys2)
reg.getstringvalue(&H8000002, "Software\Microsoft\Windows\CurrentVersion\WebCheck", keys2(p), value)
LogPrint4(keys2(p) & "=" & value)
Next
End If
End If
It comes up with the following error
COMException was unhandled Check the ErrorCode Property of the
exception to determine the HRESULT returned by the COM object.
I'm not sure why it is limiting it only to 5 checks.
Anyone have any ideas?
Consider using the built-in Registry support instead of the COM libraries. At a minimum, you'll get clearer error messages. It is supported in .NET 2.0.
http://msdn.microsoft.com/en-us/library/microsoft.win32.registry(v=vs.80).aspx
Good luck!

SSIS package fails and then runs successfully 15 minutes later

I have an SSIS package that is scheduled to run every weekday morning at 8:15. It copies data to and from Active Directory and SQL. About two weeks ago, it started failing, with no changes having been made to the server (beyond MS updates).
The funny thing is that if I then immediately run the package again, it succeeds. Here is the error text from when it fails:
Date 7/14/2011 8:15:00 AM
Log Job History (Reference: Active Directory)
Step ID 1
Server MMCI-GD1SQL2
Job Name Reference: Active Directory
Step Name Run Package
Duration 00:00:32
Sql Severity 0
Sql Message ID 0
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0
Message
Executed as user: MMCI\service-sql. Microsoft (R) SQL Server Execute Package Utility Version 10.0.1600.22 for 32-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved.
Started: 8:15:00 AM Error: 2011-07-14 08:15:31.88
Code: 0xC0047062
Source: Synchronize Permissions Active Directory Permissions [133]
Description: System.DirectoryServices.AccountManagement.PrincipalOperationException: There is no such object on the server. ---> System.DirectoryServices.DirectoryServicesCOMException (0x80072030): There is no such object on the server.
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.RefreshCache()
at System.DirectoryServices.AccountManagement.ADStoreCtx.LoadDirectoryEntryAttributes(DirectoryEntry de)
--- End of inner exception stack trace ---
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e)
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PrimeOutput(Int32 outputs, Int32[] outputIDs, PipelineBuffer[] buffers)
at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPrimeOutput(IDTSManagedComponentWrapper100 wrapper, Int32 outputs, Int32[] outputIDs, IDTSBuffer100[] buffers, IntPtr ppBufferWirePacket) End Error Error: 2011-07-14 08:15:31.90
Code: 0xC0047038
Source: Synchronize Permissions SSIS.Pipeline
Description: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Active Directory Permissions" (133) returned error code 0x80131501. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 8:15:00 AM Finished: 8:15:31 AM Elapsed: 31.343 seconds. The package execution failed. The step failed.
Any thoughts?
Has some new Group Policy been applied that changed the permissions for the account your automated run uses, but which doesn't apply to your user id? I'm assuming when you say "I then ... run the package", you mean your logged-in user id.
Based on the error message that you had provided, the issue seems to be that the task within your package is trying to query an object in Active Directory that might no longer exist.
System.DirectoryServices.AccountManagement.PrincipalOperationException:
There is no such object on the server. --->
System.DirectoryServices.DirectoryServicesCOMException (0x80072030):
There is no such object on the server.
I could be wrong on the below part. I am just speculating what your package might be doing based on the description provided.
Since your package synchronizes data between SQL Server and Active Directory, I assume that the task named Synchronize Permissions Active Directory Permissions selects some form of data stored in SQL Server and updates the content in Active Directory or vice versa. If my assumption is correct, this task is probably Script Task or Script Component. I believe that the code inside this component is failing to select an object (group/user) in Active Directory.
I would check whether a group/user was deleted in Active Directory on the days prior to when the package failed to run.
Hope this helps.