Free Support Forum - groupdocs.com

AccessViolationException on IIS with custom account


#1

Hi,

We are considering purchasing GroupDocs.Conversion for .NET and while evaluating it we ran into a problem when converting certain .doc files to .pdf when the project is hosted on IIS using a custom account for the application pool identity (Application Pool -> Advanced Settings -> Identity -> Custom account).

We get the following exception:

System.AccessViolationException: ‘Attempted to read or write protected memory. This is often an indication that other memory is corrupt.’

We reproduced the problem in a new ASP.NET Web API project (new Web API project in Visual Studio 2017 using .NET Framework 4.6.2) to which we added the simple SamDocumentsController you can find attached. To see the issue, issue a PUT request (from something like Postman) to the endpoint in the controller (http://localhost:8050/api/SamDocuments/Process in my case).

The exception is thrown only for certain documents, it was thrown for 2 out of our 9 sample files, I attached one of the files for which the conversion failed (11466808 Offer Acceptance.doc).

GroupDocs.Conversion 19.6.0
Windows 10
IIS 10

SamDocumentsController.zip (538 Bytes)
11466808 Offer Acceptance.zip (4.5 KB)

The issue happens only on IIS (not on IIS Express) and only when using a custom account for the application pool identity, as explained above (not when using ApplicationPoolIdentity). We are constrained to use a custom account for our project though.

Have you had any similar report? Can you recommend a work-around?

Thanks,
Dan Dumitru


#2

@dan.dumitru,

Can you please share complete application with us? Please specify how did you apply the licence.


#3

Here is the full project code (you’ll have to restore the NuGet packages):

GroupDocsWebApi2.zip (1.1 MB)

We didn’t apply a license, it’s running in evaluation mode (we get watermarks in the converted documents).


#4

@dan.dumitru,

There are some limitations when you are using API without a license, such as:

  • Documents with more than 3 pages are not supported.
  • Only 15 document conversions per hour.

Please go through the API evaluation limitations article.
But the good thing is you can request a temporary license that is actually a time-restricted full license. Using this you can evaluate the API features.
You can avail temporary license here, this Wizard.zip (152.9 KB) will be helpful.
Please note that you have to apply license in Global.asax.cs.

protected void Application_Start()
{
       GroupDocs.Conversion.License license = new GroupDocs.Conversion.License();
       license.SetLicense("license file path");
       AreaRegistration.RegisterAllAreas();
       FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
       RouteConfig.RegisterRoutes(RouteTable.Routes);
       BundleConfig.RegisterBundles(BundleTable.Bundles);
}

We hope this will resolve your issue.


#5

I got the temporary license, I applied it, it works for normal use (no more watermaks on converted documents), but the problem I described in my first post persists.

Here is the updated project code, with the license applied:

GroupDocsWebApi2.0715.1753.zip (772.9 KB)


#6

@dan.dumitru,

We are investigating this scenario. Your investigation ticket ID is CONVERSIONNET-3181. As we have any further update on this, we’ll notify you.


#7

Could you give us an estimate on how long will it take you to give us an answer?

We depend on this answer to decide how we will go forward with our project and if we will use the GroupDocs library.

Thanks.


#8

@dan.dumitru,

Can you please set conversion config like this:

ConversionConfig conversionConfig = new ConversionConfig
{
       StoragePath = HostingEnvironment.MapPath(@"~/App_Data"),
       OutputPath = HostingEnvironment.MapPath(@"~/App_Data")
};

Also make sure if the custom account has read/write permissions on the file system. If issue persists, please share complete steps you took (on your machine) to host the application, step by step.


#9

I modified the code as indicated, but the issue still persists.

My user has read/write permissions, it’s in the Administrators user group.

Here is the modified project code:

GroupDocsWebApi2.0717.1614.zip (826.2 KB)

The steps I took to host the application (on my computer):

  1. Publish from Visual Studio (to target location D:\Publish\GroupDocsWebApi)
  2. In IIS, added a new website (name: GroupDocsWebApi, physical path: D:\Publish\GroupDocsWebApi, application pool: the suggested GroupDocsWebApi, port: 8050)
  3. In the IIS Application Pools, selected GroupDocsWebApi and clicked Advanced Settings. There, at Identity, I selected Custom account and entered my Windows account

This is all, the error is shown then when issuing a PUT request (from something like Postman) to http://localhost:8050/api/SamDocuments/Process

It is thrown when converting the document 11466808 Offer Acceptance.doc that you can find in my sample code, but for other documents (not all) the conversion works, so it seem the conversion library has an issue in this setup with only certain documents.


#10

@dan.dumitru,

Thanks for sharing the steps. We are not able to reproduce this issue at our end. Please see this output.png (149.5 KB).
Please use the following attributes in Web API action:

[System.Web.Http.AcceptVerbs("POST","PUT")]
[System.Web.Http.HttpGet]

Eventually, your code will look like this.png (40.4 KB).
Hopefully this will resolve your issue. Additionally, this problem may occur on a computer that is running certain types of driver software or antivirus programs. It doesn’t seem a back-end API issue.