-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Operation canceled on some pages #12750
Comments
I see the same thing with a build of PhantomJS 2.0. Given the nature of Thales Group, perhaps they just have some safeguards in place against this sort of scraping. |
That's not some sort of special protection. Curl works just fine with no additional configuration, even the UA String. |
I'm experiencing this as well with Linux x86_64 PhantomJS 1.9.8 and PhantomJS 2.0. It doesn't happen all the time, but I'll get an "Operation canceled" on the request with id === 1. |
Network - Resource request error: 5 ( "Operation canceled" ) |
👍 |
same here... |
I cannot understand what is really trouble? I made simple app on qt5 with Qt5.4 and QWebView and my url loaded successfull. |
I also have the same issue with various websites. For example, http://www.bbc.co.uk/ fails when fetching it through an HTTP proxy, but can be fetched successfully without a proxy. Is ther any information I can provide that'll help you diagnose the issue? |
Happened to me as well. I had a page containing multiple IFRAMEs, and the script attempted a series of requests by clicking links in one IFRAME, causing a refresh on another IFRAME. Each "click" on a link in the menu IFRAME was preceded by a call to "switchToFrame", and then the actual "click" on the link (using page.evaluate). Once I added a "switchToMainFrame" right after the "page.evaluate", the problem disappeared for me. |
Is this issue solved yet? I am getting the same error |
i also getting it on some pages |
I am also getting this issue about 50% of the time my script runs. My script deals with a website with around 25 iframes and am using switchToFrame multiple times to get into nested iframes. Oddly enough the onResourceError url is always a image. However it may be because the website loads mostly images with ajax the the probability of getting another resource is low. Note, I'm on Arch Linux with phantomJS 2.0 |
@mattlyons0 Exactly, I am facing the same issue, which is leading me to lots of unnecessary error. |
I have the same trouble, on many pages. This trouble reproduced on versions: 1.9.8, 2.0.0, 2.0.1-dev. Anybody have idea how to solve this problem ? I suffer 2 weeks with this bugs |
Me also facing same issue, it stops at such error |
I am getting this as well - Phantom 2.0.0 OSX 10.10.5 Any advice or feedback? |
Hello guys, I am facing similar issues and it seems to be related to redirection, since direct loading of the url works. Any idea why this could be happening? |
I have this error - PhantomJS 2.0.0, Centos 7 |
any solution with this problem? |
After some tinkering, my root cause was initiating async work after the complete event has been fired. I'm not sure if there's a better time in the lifecycle to try to bring in async resources (I was trying to load Google Charts, since it doesn't allow me to inline the JavaScript library). I wound up setting the page content to include the resource request as a script tag and this issue stopped for me, but your milage and root cause may vary. |
I am seeing this when the page loads Javascript through the CloudFront CDN. When Javascript is loaded from the same host I don't get the "operation canceled" errors. |
I switched from phantomjs 1.9 to 2.1 and I'm getting murdered by this error. No websites work. Zero. Every website dies with this:
I updated QT to 5.5, same thing. Anyone?? |
None of us devs have been able to reproduce this bug. It must be caused by something about the environment in which y'all are running the tests. We are going to need you to tinker with your environment and try to find out what triggers it. Unfortunately, I don't have the least idea what could be the problem. Please note that PhantomJS is statically linked against Qt (we have to do this, our copy of Qt is nontrivially modified) and therefore upgrading the system copy of Qt will never make anything change. 2.1 is already using Qt 5.5. |
Hello, we too have been struggling a lot with this issue. We're on RHEL using PhantomJS 2.1.1. The application is AngularJS-based with require loading lots of modules simultaneously. The problem for us always occurred at startup when one (random) module failed to load due to the cancelled network operation, breaking the app. However, some observations and a workaround for our case: Not sure where exactly the issue lies, maybe a race condition or a concurrent request overload? We've analysed the logs of the app server and can only conclude that in problem cases the requests never reached the app server. Hope this helps... |
I have been struggling with this problem for a little while. I have come up with a bit of a hacky fix, that for the most part seems to be working at the moment. First of all, i store all of the urls that are causing the resource errors and then causing the operation to be cancelled.
Next, I have an array of resources that frequently causes resource errors.
Now we can check against these resources as we load them and skip them as necessary. By simply redirecting to my own server, I can return a simple 200 response. From below, you can see that I am actually concatanating skipResourcesList with config.errorResources. The first time that this runs, the config.errorResources will be empty. If however, the page fails and I have a set of resources that were stored because there were resource errors, then the 'errorResources' array can be returned to the program that executed the phantomjs script. If i then pass this in with the config object, I can add this to the resources that are skipped during loading and increase the chance that second time round, the operation will not be cancelled.
This sure is a very hacky solution to the problem. But it is a solution that has let me move forwards. I hope it might be useful for someone. |
hi, @vitallium I ran into the similar issue, and it only happens when I use 2.5 beta version, when I use 2.1 release, everything is good. the error is something like this: sorry for that I can't paste more detailed info due to I'm working on a business project. |
Currently running into this exact issue. Was happening on 2.1 and I've updated to trial 2.5 and still happening there.
While running a simple GET on https://getproxylist.com/ the error appears for the following resources:
|
Thanks to @ariya for all the hard work! Still seeing this issue using the latest release (2.1.1) and after compiling the latest commit to the master branch. I used the example site from @marktheunissen to confirm:
|
Inspired by @outboundexplorer , Added this '--cookies-file=/tmp/phantom/cookies.txt' to my phantom config and finally able to get It looks like ads provider scripts has strange behaviours if cookies is disabled, which causes all the strange operation canceled in PhantomJS. There are still a lot of script errors after that, but at least it works for me now. Hope this help! P.S. The first loading would still fail, but second loading and afterwards would be success after cookie is setup (I guess?) |
@Hoiy thanks for the suggestion... unfortunately, it still doesn't work for me. I continue to get "Operation canceled" on certain pages. |
@Hoiy Thanks a lot. It's not fixed for me either. @vitallium It happens with 2.5 too. The problem is that when the bug is triggered, success is not "success". Before I was doing this:
But right now I'm supposing it's always working ok, so:
|
I had the same problem. A simple modification solved it for me. Changed
to
like it is done in the example script renderize.js. The timeout must be chosen large enough, of course. |
For those looking for alternative solutions, try https://developers.google.com/web/updates/2017/04/headless-chrome |
I found that the |
This bug is also affecting me. bump |
i am currently facing this issue and cannot resolve it after reading all of this my output is the following. 2017-11-22T19:39:10 [DEBUG] CookieJar - Created but will not store cookies (use option '--cookies-file=' to enable persistent cookie storage) |
I would abandon all hope of this getting fixed. Multiple people are reporting the problem, which has been around for a long time. Well. We will be ditching PhantomJS for headless Chrome/Firefox. |
For anyone hopping to get it fixed: https://www.infoq.com/news/2017/04/Phantomjs-future-uncertain |
For what it's worth, this error also shows up if you have an htpassword that isn't being given. If this is your case then passing an auth header should do the trick. Obviously doesn't address the real problems cited above though... |
I have faced the same problem when trying to get data from multiple websites. I have fixed that by closing & re-creating the page. This is my source code:
Hope this help! |
I strongly believe that this is caused by some protection that checks the order of the HTTP headers sent by the browser, and since phantomjs uses QT which has a random/awkward HTTP headers order that we cannot even configure, this fails. |
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! |
Hello,
I'm experiencing some issues with phantomJS when trying to render some Urls.
It works well for 99% of the requested urls but some are not working and i'm getting the "Operation canceled" error.
To reproduce the error you can use this simple script :
It will produce the following result.
Thanks for your help.
Guillaume.
The text was updated successfully, but these errors were encountered: