coldbox install via commandbox error - ForgeBox returned something other than JSON

So it looks like your PC has no issues hitting that URL now. Are you using a proxy in CommandBox. What are the settings? “Config show proxy”

Happy Connecting. Sent from my Sprint Samsung Galaxy S® 5

Brad,

It only works if I hit the URL via the web browser, but fails when I do it from commandbox CLI.

The commandbox proxy config are correct. Can’t show the actual values, but here’s an indication:
CommandBox:commandbox> config show proxy
{
“server”:“our.proxy.url”,
“port”:1234
}

> The commandbox proxy config are correct.

I guess that’s what I’m concerned about. If your browser works, but CommandBox doesn’t it makes me wonder if perhaps your proxy needs something different. Of course, it’s entirely possible CommandBox has a bug in its proxy support that isn’t playing well with your proxy. I rely on the underlying Java proxy support, but testing it is quite difficult for me since I don’t use a proxy and I don’t have access to anyone else’s :slight_smile:

At this point, you’re sort of the only person who can troubleshoot this for me. Can you open up your CommandBox REPL (type the “repl” command) and run the following lines which just makes a simple HTTP request to the ForgeBox API?

repl

Enter any valid CFML code in the following prompt in order to evaluate it and print out any results (if any)

Type ‘quit’ or ‘q’ to exit!

CFSCRIPT-REPL: http url=“https://www.forgebox.io/api/v1” proxyServer=“our.proxy.url” proxyPort=“1234” result=“webResponse” {}
CFSCRIPT-REPL: webResponse.responseHeader
CFSCRIPT-REPL: webResponse.filecontent

I’m curious if you can get a standard cfhttp call to work with your proxy. That might help us determine if there’s a bug in CommandBox, or if your proxy just needs some additional information.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Here’s the outcome:

CFSCRIPT-REPL: webResponse.responseHeader
{
“Date”:“Wed, 06 Jul 2016 04:22:10 GMT”,
“X-Upstream-Response-Time”:“1467778831.328”,
“Server”:“cloudflare-nginx”,
“Vary”:“Accept-Encoding”,
“X-Powered-By”:“Ortus Solutions”,
“set-cookie”:[
“__cfduid=df50cd6cb868856c6d4d46d62d304ae061467778930; expires=Thu, 06-Jul-17 04:22:10 GMT; path=/; domain=.forgebox.io; HttpOnly”,
“cfid=d1bf93c7-621f-4f2b-8d8c-e605da5085b4;Path=/;Domain=.www.forgebox.io;Expires=Thu, 05-Jul-2046 12:13:07 GMT;HTTPOnly”,
“cftoken=0;Path=/;Domain=.www.forgebox.io;Expires=Thu, 05-Jul-2046 12:13:07 GMT;HTTPOnly”,
“JSESSIONID=882DF587F645D60F32215D394A01D971; Path=/; HttpOnly”
],
“CF-RAY”:“2be04628731a0b6e-NRT”,
“x-response-time”:“1”,
“Transfer-Encoding”:“chunked”,
“status_code”:200,
“X-Upstream”:“192.126.83.29:80”,
“X-Upstream-Status”:“200”,
“x-cached-response”:“false”,
“Content-Type”:“application/json;charset=utf-8”,
“Connection”:“keep-alive”,
“explanation”:“OK”
}
CFSCRIPT-REPL: webResponse.fileContent
{“data”:"",“error”:false,“messages”:[“Welcome to the ForgeBox IO API version 1.0.0”],“errorcode”:“0”}

Also when I ping 192.126.83.29, I get time outs. So maybe the issue’s on our end. I will speak to our network guys.

Apparently my network guy says that the request to https://www.forgebox.io did not go through even though I have configured commandbox to use our proxy.
Has anyone successfully use CommandBox CLI with a proxy configured?

Also disregard that message about not been able to ping because that command is disallowed.

That response actually looks correct. After reviewing the code, I think I found a bug where the proxy server wasn’t being used for ForgeBox calls.

I’ve just committed a fix for this: COMMANDBOX-408

Please give the build a few minutes to run and please let me know if the bleeding edge of CommandBox behaves better.

http://integration.stg.ortussolutions.com/artifacts/ortussolutions/commandbox/3.2.0-snapshot/

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Brad,

I’ve download latest snapshot commandbox 3.2.0, and commandbox is now using our configured proxy.
It’s hitting this url to download coldbox 4.2.0: http://downloads.ortussolutions.com

However I am getting a connection timeout:

CommandBox:coldbox> install coldbox

Installing package [forgebox:coldbox]
Verifying package ‘coldbox’ in ForgeBox, please wait…
Installing version [4.2.0].
Verified entry in ForgeBox: ‘coldbox’
Deferring to [http] endpoint for ForgeBox entry [coldbox]…
Downloading [HTTP://downloads.ortussolutions.com/ortussolutions/coldbox/4.2.0/coldbox-standalone-4.2.0.zip]
Connection timed out: connect

So it sounds like you’re saying that was an improvement that it’s now going through your proxy. I don’t know why you’re getting a timeout though. That URL is hosted on Amazon S3. Perhaps your network team need to whitelist it as well?

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Brad,

Unfortunately most external website are blocked in our environment, so I will need all the URL that commandbox will visit so I can get them whitelisted in advance in one go. Otherwise we will be spending quite a lot of time discovering them one by one, adding to whitelist, testing, and then potentially repeating this cycle many times.

To be honest, that sounds a little crazy. I don’t know how you put up with it :slight_smile:

There is no possible way for me to tell you all the URLs that a package could possibly be stored at. ForgeBox is a public registry that allows anyone in the world to post their work and we don’t restrict where the files are hosted. Even if I tell you all the domains stored on ForgeBox, I can’t (easily) tell you where they might redirect to. Github, for instance, usually redirects several times before serving a raw download.

For what it’s worth though, here are all the domains currently in the forgebox.io regisry sorted in the order most used:

http://downloads.ortussolutions.com

http://www.coldbox.org
http://integration.stg.ortussolutions.com

http://www.lunarfly.com
http://downloads.presidecms.com
http://www.alagukannan.com

http://www.compknowhow.com
http://oss.silowebworks.com
http://postbox.riaforge.org
http://recaptchacoldbox.riaforge.org
http://www.danvega.org

http://dbdesigns.dragonbait.com

http://cbbuglog.riaforge.org
http://sample.evengame.com
https://sites.google.com

http://www.siteobjects.com
http://www.jbuda.co.uk

http://cfgloss.com

http://demirkapi.net
http://code.assembla.com
https://downloads.sourceforge.net
http://jqueryuiplugin.riaforge.org
http://www.gocontentbox.org
https://integration.stg.ortussolutions.com

Brad,

Thank you, and so sorry for consuming a large chunk of your valuable time.
In the worse case scenario, we will just have to manually download and install it, and it will still work out. :slight_smile: