Developer forum

Forum » CMS - Standard features » Exception with IronPDF (licensing)

Exception with IronPDF (licensing)

Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

We're receiving the following exception on rendering PDF documents after upgrading to 9.12.7 (see below). 

After looking into it, it looks like IronPDF was upgraded in 9.12.6 (http://doc.dynamicweb.com/downloads/dynamicweb-9/bug-fixes/bug-fixes-for-9-12)

After looking into the IronPDF DLL for that class and exception, it appears that it's calling home for licensing, and it's not able to obtain the license correctly. 

What do we need to do to get the IronPdf licensing working correctly? (Here's a site with the exception: https://dev-rapidrizzo34.mydwsite1.com/?pdf=true)

System.Exception: Pdf creator constructor exception ---> IronPdf.Exceptions.IronPdfDeploymentException: Failed to get NuGet package deployment lock. Is there another deployment already in progress? If this problem persists, consider manually adding NuGet package https://www.nuget.org/api/v2/package/IronPdf.Native.Chrome.Windows/2022.1.4593 to your solution. See https://www.nuget.org/packages?q=ironpdf+native+chrome for more information. ---> System.Exception: Inadequate permissions to access existing mutex 'Global\IronSoftwareDeploymentNuGet': 'Access to the path 'Global\IronSoftwareDeploymentNuGet' is denied.'
   at .(String )
   at .()
   --- End of inner exception stack trace ---
   at IronPdf.Engines.Chrome.ChromeClient.Create()
   at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Lazy`1.get_Value()
   at .RenderPdfDocumentFromUri(ChromePdfRenderOptions Options, ChromeHttpLoginCredentials Login, Uri url)
   at Dynamicweb.Imaging.Providers.IronPdfProviders.IronPdfRendererProvider.RenderFromRequest(PdfRequest request, PdfRendererSettings settings)
   at Dynamicweb.Imaging.Pdf..ctor(String url, String extranetUserName, String extranetPassword, Boolean landscape, Boolean isUsLetterFormat, Int32 leftRightMargin, Int32 topBottomMargin, PdfPaperSize pageSize)
   --- End of inner exception stack trace ---
   at Dynamicweb.Imaging.Pdf..ctor(String url, String extranetUserName, String extranetPassword, Boolean landscape, Boolean isUsLetterFormat, Int32 leftRightMargin, Int32 topBottomMargin, PdfPaperSize pageSize)
   at Dynamicweb.Frontend.PageView.Output()


Replies

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Bump. We had a big upgrade on a project scheduled for this week, so we're standing by to see if there is a solution for this. 

Thanks!

Scott

 
Nicolai Pedersen
Reply

Hi Scott

It is a little tricky for us - we cannot reproduce that one and we do not have enough logging. But we also have a similar situation (with a very different exception) on a development environment here.

The new provider is very different from the previous one. You can download the provider to the previous version manually.

Also this one might be able to help you out: https://iron.helpscoutdocs.com/article/166-error-while-deploying-chrome-dependencies

Also the app pool user would need permissions to system tmp/temp folder on your box.

Are you hosting on regular virtualized Windows - or is it docker or something else?

Thank you for clarifying.

BR Nicolai

 
Nicolai Pedersen
Reply

Hi Scott

Also just made an example where I have upgrade the provider to use the slim version of the ironpdf provider. More info here: https://ironpdf.com/docs/questions/advanced-installation-nuget/

But it will download something and try to install it locally. So also try to elevate priviligies on the app pool identity to have that access to /bin or change to network service account.

Using the attached dlls and using networkservice as apppool identity, I made it work. Using networkservice might not be needed.

BR Nicolai

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Nicolai,

Thanks for looking into this. I finally got it working. I tried what you suggested with your version of the dlls, elevating the app pool user, using Process Monitor to see what was happening, manually downloading and extracting from the Nuget files, etc, etc.

Then, I tried installing the Visual C++ runtime as suggested in the help doc (https://iron.helpscoutdocs.com/article/166-error-while-deploying-chrome-dependencies). It didn't work immediately, but, after the next recycle, all appears to work. Best I can tell, I'm in business now.

I'm 95% certain that the Visual C++ runtime install was it, but I'll provide the last few steps that I took, just in case it was something else, and in case this is helpful later.

  • I tried a bunch of things as mentioned above
  • Installed Visual C++ runtime and tested. The error message appeared to change slightly (longer stack trace) but it didn't fix it yet
  • Since the error message is about the Chrome extensions, I tried in Firefox again. The error was still there but the error displayed very quick, so I assumed that the error was cached server-side
  • I recycled the app pool and tested in Firefox again. It worked! I concluded (I now believe incorrectly) that if I visit in Firefox first after a recycle, then it works
  • Then I tested in Chrome, and it also worked!
  • To confirm, I recycled again and visited in Chrome first, and it still worked
  • At this point, I remembered that I hadn't tested after installing Visual C++ runtime and recycling. So I'm leaning more towards Visual C++ runtime plus a recycle being the fix.

Therefore, I'm 95% certain that the Visual C++ runtime install fixed it. However, there is a slight chance that visiting the page in Firefox after a fresh recycle was able to download the correct dependencies or register the license. 

It's unfortunate that it has that dependency on a specific version of Visual C++ runtime that we apparently didn't have on this server. But, at least everything appears to be working now.

Scott

 

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Nicolai,

This has come up 2 more times since this message, and I was able to resolve it confidently with just the runtime install. So we can rule out the Firefox-first idea.

It would be nice to have that embedded with the platform so that it doesn't require installing on our dev and production servers. But at least this confirms what the issue was and gives us a workaround in the meantime.

Thanks,

Scott

 
Nicolai Pedersen
Reply

Hi Scott

I do not think we can embed c++ runtime in the packages...

BR Nicolai

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Nicolai,

I thought I saw mention of embedding the files in something I had read last week but rather than finding that again, I reached out to Iron Software and received an answer which I forwarded the email to you. It isn't certain that it's possible, but they gave some pointers which seem promising.

Thanks,

Scott

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,.

I'm also having problems with IronPDF and 9.13.1. I get this:

System.Exception: Pdf creator constructor exception ---> IronPdf.Exceptions.IronPdfDeploymentException: Error while deploying Chrome dependencies. To learn how to solve this issue please read https://iron.helpscoutdocs.com/article/166-error-while-deploying-chrome-dependencies [Issue Code IRONPDF-CHROME-DEPLOYMENT-ERROR] at IronPdf.Engines.Chrome.ChromeClient.() at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue() at .RenderPdfDocumentFromUri(ChromePdfRenderOptions Options, ChromeHttpLoginCredentials Login, Uri url) at Dynamicweb.Imaging.Providers.IronPdfProviders.IronPdfRendererProvider.RenderFromRequest(PdfRequest request, PdfRendererSettings settings) at Dynamicweb.Imaging.Pdf..ctor(String url, String extranetUserName, String extranetPassword, Boolean landscape, Boolean isUsLetterFormat, Int32 leftRightMargin, Int32 topBottomMargin, PdfPaperSize pageSize) --- End of inner exception stack trace --- at Dynamicweb.Imaging.Pdf..ctor(String url, String extranetUserName, String extranetPassword, Boolean landscape, Boolean isUsLetterFormat, Int32 leftRightMargin, Int32 topBottomMargin, PdfPaperSize pageSize) at Dynamicweb.Frontend.PageView.Output()
 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Aki,

The solution is to install the Visual C++ runtime on your web server. Here's a link to it: https://iron.helpscoutdocs.com/article/148-visual-c-redistributable (explained here: https://iron.helpscoutdocs.com/article/166-error-while-deploying-chrome-dependencies).

They say to install both 32 and 64-bit but you probably just need one, whichever one that you app pool is set at. It's a quick install (usually) with a small footprint, so it shouldn't hurt to install both.

Scott

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi Scott,

Thanks. 

I have asked the IT-guys to install that. Will test later. 

Regards / Aki

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

Got at least another error after installing the Visual C++ runtime. 

System.Exception: Pdf creator constructor exception ---> IronPdf.Exceptions.IronPdfAssemblyVersionMismatchException: Invalid assembly version for 'IronInterop' (actual: 2021.12.0.4389; expected: 2022.1.0.4593). This version of IronPdf requires updated native dependencies. Please clear your build output directory of old assemblies so IronPdf can automatically download the new dependencies at runtime. Alternatively, you may add NuGet package IronPdf.Native.Chrome version 2022.1.4593 to your project and rebuild. at IronPdf.Engines.Chrome.ChromeClient.Create() at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue() at .RenderPdfDocumentFromUri(ChromePdfRenderOptions Options, ChromeHttpLoginCredentials Login, Uri url) at Dynamicweb.Imaging.Providers.IronPdfProviders.IronPdfRendererProvider.RenderFromRequest(PdfRequest request, PdfRendererSettings settings) at Dynamicweb.Imaging.Pdf..ctor(String url, String extranetUserName, String extranetPassword, Boolean landscape, Boolean isUsLetterFormat, Int32 leftRightMargin, Int32 topBottomMargin, PdfPaperSize pageSize) --- End of inner exception stack trace --- at Dynamicweb.Imaging.Pdf..ctor(String url, String extranetUserName, String extranetPassword, Boolean landscape, Boolean isUsLetterFormat, Int32 leftRightMargin, Int32 topBottomMargin, PdfPaperSize pageSize) at Dynamicweb.Frontend.PageView.Output()

Regards / Aki

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Aki,

In that case, the version of IronPdf doesn't match what is expected. You can grab that version from the application zip folder if it differs (maybe from other troubleshooting, it just needs to be copied back). Otherwise, you can create an explicit version reference in web.config. Just copy one of the existing <dependentAssembly></dependentAssembly> sections and edit it to match the version. 

Scott

 

 

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

Thanks for the input Scott. That is propably it. 

/Aki

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi.

We still have problems with this. On our stagingserver installning the runtimes solved the problem. 

But on our productionsserver, where the runtimes also is installed, the problem still occurs after upgrading to 9.13.1 with the new IrodPDF.dll.

We made a copy of the site on the productionserver. 

There it seems that the ironpdf chrome dependencies is installed (sceenshot).

We also tried with the dlls Nicolai provided. 

The apppool has all permissions.  

What more could we try to get this work?

 

Testlink:

https://industrilasprod.mindflower.se/en-us/pdf/datasheet-industrilaas?MainProductID=ImportedPROD303&pdf=true&filename=Industrilas - Butt Hinge Stainless Steel - 6-496.pdf

ironpdf.png
 
Nicolai Pedersen
Reply

Hi Aki

Sorry about the problems.

Has the production box been rebooted after installation? What user is the app pool running under - and have you tried running at as network services?

And do you have access to windows event virewer on the production box and can see any additional logging in that?

BR Nicolai

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi Nicolai, 

I'll check with the IT-guys.

/Aki

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

We have not rebooted the production box (we'll try that outside of office hours) , other than that the answer from IT:

The app pool has been tested to run as Network Service, without result. It now runs under "ApplicationpoolIdentity" but the applicationpool has been granted FULL access to all folders and files used.

ICACLS <location of top folder> /grant "IIS AppPool\<appPoolName>:(OI)(CI)M" /T //have also tested to give it F instead of M

Event viewer does not show anything regarding the request that fails, nor not so much else that is related to this issue.

 
Scott Forsyth Dynamicweb Employee
Scott Forsyth
Reply

Hi Aki,

This looks like the same issue as when the Visual C++ runtime isn't installed. The reboot is worth trying first. However, if that doesn't work, how about having the IT-guys install it again, just to be sure: https://iron.helpscoutdocs.com/article/148-visual-c-redistributable

Make sure to install both the x86 and x64 versions.

Scott

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

Thanks, reboot did not do it, we are going to try to install the redistrutables again. 

Regards / Aki

 

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

Now we upgraded to DW 19.13.3 where the IronPDF was supposed to be switched to a lite version but there were nodifference. The same error occurs. 

Regards / Aki

 
Aki Ruuskanen
Aki Ruuskanen
Reply

The server is running "Windows Server 2022 Core".

 
Nicolai Pedersen
Reply

Can you share the exception?

It is a problem with installing the visual runtime. Can you install chrome on the server - can visual c++ runtime even install on server core?

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

We tested to upgrade a second solution to 9.13 on a Core server with the same result.

Testpage:

https://nevotest.mindflower.se/sv-se/ansoek-om-webbkonto-1?pdf=true

The setup of Visual C++ runtimes goes through without errors and says "Setup complete"

Feels like DW cannot run on Core servers due to IronPDF?

FYI @Nicolai: I have an ongoing case about this also:  CAS-20491-T5F0J4

Regards / Aki

 

 

 

You must be logged in to post in the forum