twolfson / grunt-fontsmith

**DEPRECATED** Grunt plugin for composing SVGs into multiple fonts, a character mapping, and CSS variables
MIT License
38 stars 3 forks source link

Does not work anymore #27

Closed awe79 closed 10 years ago

awe79 commented 10 years ago

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.

dineshduggal commented 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)

twolfson commented 10 years ago

A fix has been opened in twolfson/fontsmith#9. I am evaluating it now and it should be landed shortly.

twolfson commented 10 years ago

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
pedrompg commented 9 years ago

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.

twolfson commented 9 years ago

Can we verify that the normal app https://icomoon.io/app/ has these issues as well?

pedrompg commented 9 years ago

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
awe79 commented 9 years ago

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.

twolfson commented 9 years ago

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.

twolfson commented 9 years ago

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
pedrompg commented 9 years ago

I'm not behind any proxy.

▶ phantomjs --version
1.9.8

Also i forgot to thank you for the quick responses :smile:

twolfson commented 9 years ago

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
pedrompg commented 9 years ago

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.
twolfson commented 9 years ago

Damn =( Can you upload the screenshot?

twolfson commented 9 years ago

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"
pedrompg commented 9 years ago

It's just a blank image =( screen shot 2015-05-09 at 17 28 18

twolfson commented 9 years ago

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();
});
pedrompg commented 9 years ago

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

twolfson commented 9 years ago

Damn =( Can you try a higher version of PhantomJS? Maybe the 2.0 version doesn't have the issue?

pedrompg commented 9 years ago

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 .

twolfson commented 9 years ago

Ugh, that's frustrating. I have thought of a few options for us:

Thoughts/preferences?

pedrompg commented 9 years ago

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

twolfson commented 9 years ago

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.

twolfson commented 9 years ago

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']
}
pedrompg commented 9 years ago

Awesome @twolfson...sorry about the delay on the response, lost track off my emails. I'll try it out