[SOLVED] MarketPlace proxy not working


#1

Hi,

I’m running a fresh install of OpenNebula 5.2.1 on Debian 8.
To get access to the internet from my network I need to connect to a proxy. In sunstone-server.conf I added the proxy like this:

# Enable an http proxy for the support portal and to download MarketPlaceApps
# from the MarketPlace to the user's desktop.
:proxy: http://172.14.36.74:35360

I restarted the OpenNebula services but the marketplace is still empty and I get this error log:

Fri Jan 13 17:26:26 2017 [Z0][MKP][I]: Command execution fail: /var/lib/one/remotes/market/one/monitor P[...]4= 0
Fri Jan 13 17:26:26 2017 [Z0][MKP][I]: /usr/lib/ruby/2.1.0/net/http.rb:879:in `initialize': getaddrinfo: Name or service not known (SocketError)
Fri Jan 13 17:26:26 2017 [Z0][MKP][I]: from /usr/lib/ruby/2.1.0/net/http.rb:879:in `open'
Fri Jan 13 17:26:26 2017 [Z0][MKP][I]: from /usr/lib/ruby/2.1.0/net/http.rb:879:in `block in connect'
Fri Jan 13 17:26:26 2017 [Z0][MKP][I]: from /usr/lib/ruby/2.1.0/timeout.rb:76:in `timeout'
Fri Jan 13 17:26:26 2017 [Z0][MKP][I]: from /usr/lib/ruby/2.1.0/net/http.rb:878:in `connect'
Fri Jan 13 17:26:26 2017 [Z0][MKP][I]: from /usr/lib/ruby/2.1.0/net/http.rb:863:in `do_start'
Fri Jan 13 17:26:26 2017 [Z0][MKP][I]: from /usr/lib/ruby/2.1.0/net/http.rb:852:in `start'
Fri Jan 13 17:26:26 2017 [Z0][MKP][I]: from /usr/lib/ruby/2.1.0/net/http.rb:583:in `start'
Fri Jan 13 17:26:26 2017 [Z0][MKP][I]: from /var/lib/one/remotes/market/one/monitor:54:in `get'
Fri Jan 13 17:26:26 2017 [Z0][MKP][I]: from /var/lib/one/remotes/market/one/monitor:66:in `get_appliances'
Fri Jan 13 17:26:26 2017 [Z0][MKP][I]: from /var/lib/one/remotes/market/one/monitor:170:in `<main>'
Fri Jan 13 17:26:26 2017 [Z0][MKP][I]: ExitCode: 1
Fri Jan 13 17:26:26 2017 [Z0][MKP][E]: Error monitoring marketplace 0: -

The server itself is able to connect to the proxy and access the internet (tested with wget).
How can I fix the marketplace issue?

Thanks in advance!


(Anton Todorov) #2

Hi Hathagat,

I am not using a proxy, but reading the docs and the code the marketplace’s proxy should be configured via MARKET_MAD in /etc/one/oned.conf .

I think that the related docs are one step behind the comments in the oned.conf(noted to do some more research and create a pull request that fixes the docs):

I’d try editing /etc/one/oned.conf to something like

MARKET_MAD = [
    EXECUTABLE = "one_market",
    ARGUMENTS  = "-t 15 -m http,s3,one --proxy 1.2.3.4:1234"
]

Then restart the opennebula service.

The --proxy is used by the shell wrapper to export the argument as http_proxy variable in the shell. Then it should be used by the market daemon… As I said I’ve not tested it. Just red the code.

Hope this helps…

Kind Regards,
Anton Todorov


#3

Thanks for your fast reply!
Currently I’m not able to test your advice. I will report back as soon as I could test it out.

Best regards


#4

It is working now! Thanks a million Anton!

Your snippet didn’t work and results in this error:

Tue Jan 17 11:16:52 2017 [Z0][MKP][I]: /usr/lib/ruby/2.1.0/uri/common.rb:176:in `split': bad URI(is not URI?): 1.2.3.4:1234 (URI::InvalidURIError)
Tue Jan 17 11:16:52 2017 [Z0][MKP][I]: from /usr/lib/ruby/2.1.0/uri/common.rb:211:in `parse'
Tue Jan 17 11:16:52 2017 [Z0][MKP][I]: from /usr/lib/ruby/2.1.0/uri/common.rb:747:in `parse'
Tue Jan 17 11:16:52 2017 [Z0][MKP][I]: from /usr/lib/ruby/2.1.0/uri/common.rb:1232:in `URI'
Tue Jan 17 11:16:52 2017 [Z0][MKP][I]: from /var/lib/one/remotes/market/one/monitor:41:in `get'
Tue Jan 17 11:16:52 2017 [Z0][MKP][I]: from /var/lib/one/remotes/market/one/monitor:66:in `get_appliances'
Tue Jan 17 11:16:52 2017 [Z0][MKP][I]: from /var/lib/one/remotes/market/one/monitor:170:in `<main>'

But adding a simple http:// in front of the IP solved the problem:

MARKET_MAD = [
    EXECUTABLE = "one_market",
    ARGUMENTS  = "-t 15 -m http,s3,one --proxy http://1.2.3.4:1234"
]

Thanks again and best regards


(Anton Todorov) #5

Hi Hathagat,

Thank you for the feedback, a pull request was merged to the docs project so the documentation will be uptodate on next rebuild.

Kind Regards,
Anton Todorov


(Javi Fontán) #6

Thanks Anton!


(Roland) #7

Sorry to re-open an old topic, but my current test-env. is setup behind a proxy.
I am using ONE 5.4, and configured my marketplace proxy with:

MARKET_MAD = [
EXECUTABLE = “one_market”,
ARGUMENTS = “-t 15 -m http,s3,one --proxy https://proxy.example.com:8080
]

With this set I was not able to download any images from the opennebula marketplace:

Mon Aug 7 15:12:44 2017 [Z0][ImM][E]: cp: Command “/var/lib/one/remotes/datastore/fs/…/downloader.sh --md5 c75e0559f0827f1991cbb02e665d77d5 http://marketplace.opennebula.systems//appliance/575fcaa28fb81d438c000001/download/0 /var/lib/one//datastores/1/1fe5ae7ae8d2e5752f159e382cd6d931” failed: curl: (7) Failed to connect to marketplace.opennebula.systems port 80: Connection timed out

So it seems in 5.4 the --proxy is not parsed to curl, I fixed this by setting the proxy for curl manually in a .curlrc file in oneadmin’s homedir. Sorry to revive an old topic, but in my case following this example in 5.4 did not work.

The one_market process knows about the --proxy tho:

oneadmin 8347 8141 0 14:31 ? 00:00:00 ruby /usr/lib/one/mads/one_market.rb -t 15 -m http,s3,one --proxy https://proxy.example.com:8080


(Jean Sébastien Frerot) #8

Hi, any news on this? I still experience the same issue with 5.4. The workaround with .curlrc works but it would be great if a real fix is done.


(Tino Vazquez) #9

Honestly this wasn’t in our radar. Could you please open a feature request on github so we don’t miss it again?

https://github.com/OpenNebula/one


(Jean Sébastien Frerot) #10

Issue opened: https://github.com/OpenNebula/one/issues/2283