Closed awe79 closed 10 years ago
I have the same issue, it's due to a "SSL handshake failed" error... (use this setting for phantomjs --ssl-protocol=any)
A fix has been opened in twolfson/fontsmith#9. I am evaluating it now and it should be landed shortly.
The fix has been landed as a patch so it will automatically be picked up upon installation. To get the fix, reinstall grunt-fontsmith
:
npm uninstall grunt-fontsmith
npm install grunt-fontsmith@latest
Hi all, this is happening again. I ran into it last Thursday (31/04) and today is still going on. It seems that TLSV1 is not a solution anymore to open the Icomoon webpage.
Trying to load it with a simple Phantom script like:
var page = require('webpage').create();
page.open('http://icomoon.io/app-old', function(status) {
console.log("Status: " + status);
phantom.exit();
});
Leads to Status: fail
using any of the SSL protocols (SSLV3, SSLV2 and TLSV1). Running the script with --ignore-ssl-errors=true
leads to a successful page load.
Now i'm no security expert to say if ignoring SSL errors is a valid solution. I can prepare a pull request with the changes if you agree it with.
Can we verify that the normal app https://icomoon.io/app/
has these issues as well?
Using the normal app, with any of the 3 SSL configurations, the behaviour is the same when trying to generate fonts. While using the new app and --ignore-ssl-errors=true
leads to
Fatal error: Command failed: ReferenceError: Can't find variable: $
phantomjs://webpage.evaluate():2
phantomjs://webpage.evaluate():3
phantomjs://webpage.evaluate():3
It's still working for me at the moment. However i've been wondering if icomoon is aware of this great plugin which uses their old app so that they won't remove it at some point.
Yep, Keyamoon is aware of this library but it's almost been a year since we talked about it:
https://github.com/twolfson/icomoon-phantomjs/issues/6#issuecomment-48275314
I will take a look at reproducing the SSL errors by the end of next weekend.
I have decided to triage the SSL errors much sooner. I don't seem to be having any errors either with the icomoon-phantomjs
test suite. @pedrompg What version of phantomjs
are you running and are you behind any proxy that might be causing SSL issues?
phantomjs --version
I'm not behind any proxy.
▶ phantomjs --version
1.9.8
Also i forgot to thank you for the quick responses :smile:
Damn, that's the same phantomjs
version I am on =/ Let's do a sanity check and have you run the icomoon-phantomjs
test suite. Can you run the following steps?
# Clone the repository
git clone https://github.com/twolfson/icomoon-phantomjs
cd icomoon-phantomjs/
# Install our dependencies and dev dependencies
npm install
# Run our test suite
npm test
Result of npm test:
/tmp/icomoon-phantomjs master ✔ 51d
▶ npm test
> icomoon-phantomjs@0.6.1 test /private/tmp/icomoon-phantomjs
> mocha
․․
✖ 2 of 9 tests failed:
1) A set of SVGs processed by IcoMoon returns a valid URL:
actual expected
"""Error: IcoMoon app \"https://icomoon.io/app-old\" could not be opened.\nSaving debug screenshot to \"icomoon-phantomjs-debug.png\"\n"
at Context.<anonymous> (/private/tmp/icomoon-phantomjs/test/icomoon-phantomjs_test.js:46:30)
at Test.Runnable.run (/private/tmp/icomoon-phantomjs/node_modules/mocha/lib/runnable.js:213:32)
at Runner.runTest (/private/tmp/icomoon-phantomjs/node_modules/mocha/lib/runner.js:351:10)
at /private/tmp/icomoon-phantomjs/node_modules/mocha/lib/runner.js:397:12
at next (/private/tmp/icomoon-phantomjs/node_modules/mocha/lib/runner.js:277:14)
at /private/tmp/icomoon-phantomjs/node_modules/mocha/lib/runner.js:286:7
at next (/private/tmp/icomoon-phantomjs/node_modules/mocha/lib/runner.js:234:23)
at Object._onImmediate (/private/tmp/icomoon-phantomjs/node_modules/mocha/lib/runner.js:254:5)
at processImmediate [as _immediateCallback] (timers.js:354:15)
2) A set of SVGs processed by IcoMoon returns a zip file "before all" hook:
Error: options.uri is a required argument
at Request.init (/private/tmp/icomoon-phantomjs/node_modules/request/index.js:162:31)
at new Request (/private/tmp/icomoon-phantomjs/node_modules/request/index.js:124:8)
at request (/private/tmp/icomoon-phantomjs/node_modules/request/index.js:1230:11)
at Context.<anonymous> (/private/tmp/icomoon-phantomjs/test/icomoon-phantomjs_test.js:57:9)
at Hook.Runnable.run (/private/tmp/icomoon-phantomjs/node_modules/mocha/lib/runnable.js:196:15)
at next (/private/tmp/icomoon-phantomjs/node_modules/mocha/lib/runner.js:243:10)
at Object._onImmediate (/private/tmp/icomoon-phantomjs/node_modules/mocha/lib/runner.js:254:5)
at processImmediate [as _immediateCallback] (timers.js:354:15)
npm ERR! Test failed. See above for more details.
Damn =( Can you upload the screenshot?
The screenshot being the one from the test output:
"""Error: IcoMoon app \"https://icomoon.io/app-old\" could not be opened.\nSaving debug screenshot to \"icomoon-phantomjs-debug.png\"\n"
It's just a blank image =(
Damn, I am still really clueless. It looks like you are on Mavericks and there seems to be something between Mavericks/SSL:
https://github.com/ariya/phantomjs/issues/12746
Can you try a similar script to see if there are the same issues?
var page = require('webpage').create();
page.onResourceError = function(resourceError) {
console.log('Unable to load resource (#' + resourceError.id + 'URL:' + resourceError.url + ')');
console.log('Error code: ' + resourceError.errorCode + '. Description: ' + resourceError.errorString);
};
page.open('https://icomoon.io/app-old/', function() {
phantom.exit();
});
I'm getting the same output described on the PhantomJS issue.
/tmp
▶ phantomjs script.js
Unable to load resource (#1URL:https://icomoon.io/app-old/)
Error code: 6. Description: SSL handshake failed
I'll check if anyone else on the company is still running OSX 10.9 to try and to narrow the possible solution. Also I'll check with the folk running Linux if they are having any issues building our fonts.
UPDATE Checked with a colleague running Linux and he can run the task (he's getting a timeout though...but we have way too many icons right now). Unfortunately no OSX < 10.10 to test if it's only Yosemite having the issue
Damn =( Can you try a higher version of PhantomJS? Maybe the 2.0 version doesn't have the issue?
Still getting the same with PhantomJS 2.0. For now i'm not sure if any other solution aside from using the --ignore-ssl-errors=true
flag (but again, not sure if it would be valid....maybe apply this flag only on OSX ?) is possible until those Phantom issues are addressed .
Ugh, that's frustrating. I have thought of a few options for us:
grunt-fontsmith
(and fontsmith
) which allows for passing CLI options to phantomjs
phantomjs
but also adds on the --ignore-ssl-errors=true
(maybe you can do that with an OSX specific flag)Thoughts/preferences?
I'm always for configuration over customisation...so having the possibility to pass CLI options seems to be the most appropriate solution for me. But again i have no experience writing open source plugins so maybe i'm not the most suited person to vote on this hehe
Yea, passing CLI options is definitely the better option but aliasing is more of a quick/dirty workaround. My hesitation is coming from considering deprecation and how much work we should put into this project.
I have decided to do this last part as a quick implementation but I am going to mark grunt-fontsmith
, fontsmith
, and icomoon-phantomjs
as deprecated/open to forking.
@pedrompg I have introduced an undocumented feature named exportOptions
. You can use it to pass through options to the exporter. In the case of the PhantomJS exporter, you can pass in phantomjsOptions
which is an array of arguments to pass through to phantomjs
when invoking it.
For your scenario, you can use:
src: ...
dest: ...
exportOptions: {
phantomjsOptions: ['--ignore-ssl-errors=true']
}
Awesome @twolfson...sorry about the delay on the response, lost track off my emails. I'll try it out
Since last week the plugin does not work anymore. I get the message below. To be sure this was not network related or anything, I also tested at a different system connected to a different network and I get the same error.
Fatal error: Command failed: Error: IcoMoon app "https://icomoon.io/app-old" cou ld not be opened.
I hope this can be fixed because it's a great plugin that saves me lots of time.