PDA

View Full Version : [OPEN] Sencha Cmd v5.0.0.116 not able to generate app behind proxy



abraxxa
7 Apr 2014, 2:59 AM
$ sencha generate app -ext Test ./Test
Sencha Cmd v5.0.0.116
[WRN] Failed to download remote catalog : Error downloading http://cdn.sencha.com/cmd/packages/catalog.json
[ERR] Cannot satisfy requirements for "ext"!
[INF] The following versions are available:
[INF] The following versions can be satisfied:
[ERR] The following versions cannot be satisfied:
[ERR] framework package dependency: ext@5- (No matches!)
[ERR] Cannot resolve package requirements

This is Linux 64bit with the *_proxy env vars set.

dongryphon
8 Apr 2014, 10:37 AM
You might check the sencha.cfg file in the installation directory. I believe there are some JVM settings for proxy that might help commented out in there, but since Cmd uses the standard Java URL class to download it should be configurable using system properties. For details on Java and proxy setup see http://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html - just add "system." to those properties and they should work in the sencha.cfg file.

abraxxa
8 Apr 2014, 11:42 AM
Thanks for the pointers, but sadly nothing helped.
We have a authenticating proxy and neither configuring the system.http.proxy* variables helped nor using cntlm as a local proxy that does the userauth.

dongryphon
8 Apr 2014, 10:46 PM
I'd love to hear more about what you tried (sans actual credentials of course :) ) because we certainly want this to work, so I will open a ticket for that.

In the meantime, if you want you can download the SDK zip archive at http://cdn.sencha.com/ext/beta/ext-5.0.0.736.zip and use the "-sdk" switch as with previous versions.

If you'd rather use "-ext" switch (say for a dev team eventually), you can directly download the ext.pkg file from the CDN at http://cdn.sencha.com/cmd/packages/ext/5.0.0.736/ext.pkg and then do this:



sencha package add ext.pkg


That will add the package to your local Cmd repository so Cmd will no longer need to download it from outside your network. To solve this issue then for a group of people you could host that content and setup a Cmd package repository inside your network. See http://docs.sencha.com/extjs/4.2.2/#!/guide/command_package_authoring-section-hosting-a-package-repository for some guidance on this.

It probably sounds harder than it is - it is just an HTTP file server pointed at a sub-folder of the Cmd install folder.

abraxxa
10 Apr 2014, 8:17 AM
I've seen the other way to generate an app in the getting started docs (http://docs.sencha.com/extjs/5.0.0/getting_started/getting_started.html) which works fine.

My setup is an Ubuntu notebook as dev box behind a NTLM authenticating proxy running cntlm locally, all env vars configured to point at localhost:3128 which authenticates against the upstream proxy.
I tried the java vars to connect and authenticate directly to the upstream proxy without success.
I haven't done any packet captures so far but will do to find out what's going on.

The problem is when it tries to download http://cdn.sencha.com/cmd/packages/catalog.json, if that file exists in the correct directory it fails differently when the file is empty. I don't know how but that happened once when I tried the different proxy settings.

abraxxa
24 Jun 2014, 8:59 AM
I tried 5.0.0.160 which fails like 5.0.0.116 did.
Then I found those outdated Java 6 docs mentioned in the sencha.cfg file http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html (http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html)which point to setting the proxy parameters using -D.

sencha.cfg also says:

# NOTE: If you find that you need to adjust these settings, you may want to do
# so in a "sencha.cfg" file one folder above this folder. The settings in that
# file override these settings, so be sure to only copy the settings you need
# to that location. The advantage to putting these settings in that location is
# that they will not be "lost" as you upgrade Cmd.

Creating a sencha.cfg in $INSTALLDIR/Sencha/Cmd/ didn't work, editing $INSTALLDIR/Sencha/Cmd/5.0.0.160/sencha.cfg and changing
cmd.jvm.args=-Xms128m -Xmx1024m -Djava.awt.headless=true to
cmd.jvm.args=-Xms128m -Xmx1024m -Djava.awt.headless=true -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128 did the trick!

So please look into why the system.http.proxyHost and system.http.proxyPort config options in sencha.cfg aren't used and also why sencha.cfg in 'one folder above this one' doesn't work!