Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

COM error 0x80070005 #14095

Closed
branneman opened this issue Mar 14, 2016 · 47 comments
Closed

COM error 0x80070005 #14095

branneman opened this issue Mar 14, 2016 · 47 comments

Comments

@branneman
Copy link

Using:

  • npm package phantomjs-prebuilt version 2.1.5
  • tested with Node.js versions 4.0, 4.4, 5.0 and 5.8
  • tested on Windows Server 2012 R2 (x64) at AppVeyor, more specs here

Error:

SetProcessDpiAwareness failed: "COM error 0x80070005  (Unknown error 0x0ffffffff80070005)"

Possibly related to:

@vitallium
Copy link
Collaborator

Could you please verify that you're using 2.1.1 version? 2.1.1 version is based on Qt 5.5.1.

@branneman
Copy link
Author

Using 2.1.1 of what? Like I said before I am using version 2.1.5.

@vitallium
Copy link
Collaborator

Of PhantomJS. 2.1.5 is version of the npm package, not phantomjs.

Find the PhantomJS executable in your node_modules (or by running the where phantomjs command) and check its version: phantomjs -v

@branneman
Copy link
Author

Yes, that reports 2.1.1

@branneman
Copy link
Author

Any command will produce this error at the moment, this is one producing just the version number:

node -e "console.log(require('child_process').execFileSync(require('phantomjs-prebuilt').path, ['--version'], {encoding:'utf8'}));"

Which outputs:

SetProcessDpiAwareness failed: "COM error 0x80070005  (Unknown error 0x0ffffffff80070005)"
2.1.1

@johnnyreilly
Copy link

I'm also seeing this with 2.1.6

johnnyreilly added a commit to johnnyreilly/poorclaresarundel that referenced this issue Mar 20, 2016
@DavidKuennen
Copy link

We are having this issue as well. It's really frustrating. Does anyone know a shortcut in fixing this (older version?), until the master version is working again?

Edit:
Ok I fixed this for me by using Version 1.5.0 of html-pdf, instead of 2.1.0. Version 1.5.0 uses phantomjs Version 1.9.19

@johnnyreilly
Copy link

also tried 2.1.2 but that fails

@harm-less
Copy link

We're trying to run Prerender as a Windows service created by node-windows. This however fails because in the log it reports this error.

A couple of interesting things we found though:

  • The thing we found is that it seems to depend on the Windows version. We tested on Windows Server 2012, Windows 10, Windows 8 and Windows 7. It failed on every version except Windows 7.
  • If I run the Prerender server with node server.js it does work as expected and Phantomjs gets started.
  • If I start the server using the Windows service I get all these errors.

At the moment of typing we did find a temporary fix. Reverting back to a pre-compiled 2.0.0 did the trick and the server as a service ran as expected.

@johnnyreilly
Copy link

I don't think it's been mentioned so far but this error doesn't prevent me using phantom for Karma; the error is visible but doesn't error out the process. So for me it's an irritation rather than a blocker. Would still be good to get if resolved though.

@harm-less
Copy link

It does work, but in some situations it does cause fatal errors by some libraries that use Phantomjs as a dependency. Their error handling will prevent Phantomjs from even starting. I think Phridge is one of those libraries as that's used by Prerender. Going into its code and debugging the startup phase it failed to start Phantomjs was my conclusion.

But again, this happened only when I ran my node code as a service. With a regular node server.js command that executed the very same code it did not cause the SetProcessDpiAwareness error.

@mribichich
Copy link

Hi there, did anyone find a solution to be able to run this as a windows service? because the same thing as @harm-less its happening to me
thanks

@harm-less
Copy link

harm-less commented May 28, 2016

@siulung4073 You also can't get it to work using the suggestions I already gave?

@mribichich
Copy link

I made it work using html-pdf 1.5 that uses phantomjs 1.9.19
Thanks!

@Nicholas-Westby
Copy link

@harm-less Running into the same issue with Prerender. I tried to run this:

npm i phantomjs-prebuilt@2.0.0

However, that didn't seem to work, as there is apparently no version 2.0.0 available: https://www.npmjs.com/package/phantomjs-prebuilt

Here's the error I get:

version-2-failed

How'd you install version 2 of PhantomJS?

@harm-less
Copy link

@Nicholas-Westby I don't think used the prebuild package you're referring to. I remember using a prebuild .exe from the PhantomJS website as I was sick and tired of this bug. A quick look didn't result in anything, but perhaps a bit more effort will turn up a page with old releases.

However, I did found this topic:
http://stackoverflow.com/questions/30084690/how-to-install-phantomjs-v2-with-npm
I'd try that package. Hopefully that works so you still have PhantomJS as a dynamic npm dependency.

@Nicholas-Westby
Copy link

@harm-less Thanks for the quick reply!

I actually just got it working (I think) by installing PhantomJS version 1.9.19 and modifying phridge to require that instead of the prebuilt version:

phantom-change

Bit of a pain. Hopefully PhantomJS or Prerender or whoever should fix this issue adds a fix soon so this silly workaround isn't required.

Thanks again for the tip about installing a different version of PhantomJS.

@Nicholas-Westby
Copy link

Maybe I spoke too soon. While PhantomJS is starting now, it doesn't seem to actually be converting the Angular directives into HTML as I would expect.

@vitallium
Copy link
Collaborator

Hi! Sorry for taking this so long. Could someone of you test this version to check if the problem fixed?
https://dl.dropboxusercontent.com/u/30021413/phantomjs/phantomjs-2.5.0-windows.7z

@Nicholas-Westby
Copy link

@vitallium Didn't seem to work for me (same error), though I'm not sure I tested it correctly. I just dropped the contents of your ZIP file into the bin folder for PhantomJS under Prerender:

path

Here's the error message:

SetProcessDpiAwareness(2) failed: COM error 0xffffffff80070005  (Unknown error 0x0ffffffff80070005), using 2

Interestingly, I see that your phantomjs.exe is only 553KB, while the previous one was 18,152KB. Also, the old one didn't include any DLL's (it was just an EXE). Not sure if that's relevant, but thought I'd mention it just in case.

@vitallium
Copy link
Collaborator

vitallium commented Jul 6, 2016

This is the next major version. It contains a huge amount of fixes plus a complete fresh WebKit. But it's strange that it didn't work for you. I guess it's a Qt bug after all.
Can you try to run Otter Browser on your server? This one - https://sourceforge.net/projects/otter-browser/files/otter-browser-weekly131/otter-browser-win64-weekly131-qtwebkitng.7z/download
I want to isolate that crash.

@Nicholas-Westby
Copy link

I'm not sure if the Qt bug was fixed, but it appears to have at least been reported (several years ago): https://bugreports.qt.io/browse/QTBUG-38993

Which version of Qt are you using?

@Nicholas-Westby
Copy link

Based on the file details, it seems you are using Qt 5.6. Perhaps 5.7 would help?

@Nicholas-Westby
Copy link

@vitallium Just noticed your edit regarding Otter Browser. Not sure what to do once it's installed, but I'll give it a go.

@Nicholas-Westby
Copy link

@vitallium I ran Otter Browser on the server and viewed the website. Seems to work fine. Is there something in particular you wanted me to do?

@vitallium
Copy link
Collaborator

@Nicholas-Westby yep. Thanks! Now I'm pretty much sure that this is something in PhantomJS.

@Nicholas-Westby
Copy link

@vitallium Cool. Let me know if you want me to test anything.

@KpjComp
Copy link

KpjComp commented Nov 14, 2016

Just a head's up..

I'm getting this error in my logs too, it's actually not causing us any issues.

But the error is appearing in my logs. I'm using NPM phantom, that appears to use phatom-prebuilt. Checking version of phantomjs.exe it is 2.1.1.. This is running on Server 2012 R2.

Like I say it's not causing me any issues, as it appears NPM phantom doesn't bomb out, but just letting you know in case it helps.

@kmw12321
Copy link

I'm still getting this error in my logs. It's working find in my test and local environment, but when the phantomjs call occurs in my prod environment this error is thrown and the pdf does not generate (but the pdf generates fine on dev and locally). I have done an npm install on dev and prod and they're running the exact same code.

@kmw12321
Copy link

kmw12321 commented Dec 2, 2016

...and now it's happening on dev as well.

@dhwaneetbhatt
Copy link

dhwaneetbhatt commented Dec 22, 2016

I get the following error everytime I run phantomjs:

SetProcessDpiAwareness failed: "COM error 0x80070005 (Unknown error 0x0ffffffff80070005)"

I am using phantomjs 2.1.1 on Windows 2012 x64. It does not affect anything, but confuses other devs/tech support guys who are looking into logs for problems.

Are there any ways to avoid or suppress this error?

@Ks89
Copy link

Ks89 commented Dec 29, 2016

Same problem on AppVeyor with Phantomjs 2.1.1

@rasjani
Copy link

rasjani commented Feb 2, 2017

Anyone with a bit of free time could look into starting phantomjs with commandline switch -platform windows:dpiawareness=0 and report back ..

@rasjani
Copy link

rasjani commented Feb 3, 2017

In my case, the issue ended up being where the application was launched. In our case, if I ran the tests via Jenkins, things worked fine but from cygwin/ssh it did not. Reason for this is that windows limits GUI access for processes launched when session parent is a service.

I changed my setup to start ssh as a user script when test slave autologins to desktop and got rid of the issue. ymmv

@michaelhiatt
Copy link

@rasjani referring to your request of trying that command (-platform windows:dpiawareness=0) starting the REPL I do not receive an error.
Starting the REPL without the command line switch I receive the SetProcessDpiAwareness.... error.

@frank-orellana
Copy link

Still happening here, I was using html-pdf@2.1.0 and got this error but only when the script was executed from a service. It worked well if I executed it myself from the command line (The problem was occurring on a WinServer 2012 R2, but I'm guessing it is not because of the OS but because of the execution of the script as a service).
Worked around by going back to html-pdf@1.5.0 which uses phantomjs.exe version 1.9.8

@ghost
Copy link

ghost commented Feb 18, 2017

On Windows 10 64 bit, no "SetProcessDpiAwareness failed" error when running
phantomjs -platform windows:dpiawareness=0
Error is present without the switch, -platform windows:dpiawareness=0

@EugeneSnihovsky
Copy link

I have same issue using protractor + cucumber.js. Can someone help me please to pass params from protractor?

Thanks in advance.

@KresoJ
Copy link

KresoJ commented Mar 17, 2017

same error using phantomjs-prebuilt 2.1.14 (npm) on win 10

ERROR [phantomjs.launcher]: SetProcessDpiAwareness failed: "COM error 0x80070005 (Unknown error 0x0ffffffff80070005)

PhantomJS 2.1.1 (Windows 8 0.0.0): Executed 0 of 0 ERROR (0.719 secs / 0 secs)

@rasjani
Copy link

rasjani commented Mar 18, 2017

Worth to mention that main reason why this error message (but ymmv) comes is due to windows restriction of not being able to run GUI apps if the parent process is a service.

For example, in my case, if we launch everything from Jenkins and slave master connection is via ssh that has been started with cygrunsrv.

@makileeshao
Copy link

Hi! Any updates on this? Or is there a Windows Policy that can be disabled?

Although it is still able to render pages, the exe file returns to the program calling it right away with a status of 0.

Also, it is working fine in Windows 2008 but it is having this issue in Windows 2012.

@frank-orellana
Copy link

I think this is related: marcbachmann/node-html-pdf#295

@dimithras
Copy link

Error does not appear on windows 10 x64 if I set compatibility mode to Win7 in executable properties (not an option on run, just a tick in properties)

@arnas
Copy link

arnas commented Dec 15, 2017

I was having this issue when phantomjs was running on windows server 2012. I believe it's because that windows server 2012 doesn't allow to run interactive services on default. Changing the flag in registry to false i successfully managed to run it.

@harvzor
Copy link

harvzor commented Jan 2, 2018

Same error found on Windows 10 with PhantomJs version 2.1.1.

I found that running the console as administrator did not cause the error:
admin

@stale
Copy link

stale bot commented Dec 28, 2019

Due to our very limited maintenance capacity (see #14541 for more details), we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed. In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

@stale stale bot closed this as completed Dec 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests