# \[SOLVED\] MarketPlace proxy not working

**URL:** <https://forum.opennebula.io/t/solved-marketplace-proxy-not-working/3571>\
**Category:** Product Support\
**Created:** [January 13, 2017, 2:30pm UTC](https://forum.opennebula.io/t/solved-marketplace-proxy-not-working/3571 "2017-01-13T14:30:19Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hathagat](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@Hathagat](https://forum.opennebula.io/u/Hathagat)\
**Post date:** [January 13, 2017, 2:30pm UTC](https://forum.opennebula.io/t/solved-marketplace-proxy-not-working/3571/1 "2017-01-13T14:30:19Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![atodorov\_storpool](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/atodorov_storpool/32/5327_2.png) [@atodorov\_storpool](https://forum.opennebula.io/u/atodorov_storpool)\
**Post date:** [January 13, 2017, 7:55pm UTC](https://forum.opennebula.io/t/solved-marketplace-proxy-not-working/3571/2 "2017-01-13T19:55:39Z")

</div>

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](http://docs.opennebula.org/5.2/deployment/references/oned_conf.html#marketplace-driver-configuration) 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):

> <https://github.com/OpenNebula/one/blob/master/share/etc/oned.conf#L566>

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](https://github.com/OpenNebula/one/blob/master/src/mad/sh/madcommon.sh#L61) [wrapper](https://github.com/OpenNebula/one/blob/master/src/market_mad/one_market) 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

---

<div class="post-metadata">

**Author:** ![Hathagat](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@Hathagat](https://forum.opennebula.io/u/Hathagat)\
**Post date:** [January 14, 2017, 1:08pm UTC](https://forum.opennebula.io/t/solved-marketplace-proxy-not-working/3571/3 "2017-01-14T13:08:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Hathagat](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@Hathagat](https://forum.opennebula.io/u/Hathagat)\
**Post date:** [January 17, 2017, 8:22am UTC](https://forum.opennebula.io/t/solved-marketplace-proxy-not-working/3571/4 "2017-01-17T08:22:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![atodorov\_storpool](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/atodorov_storpool/32/5327_2.png) [@atodorov\_storpool](https://forum.opennebula.io/u/atodorov_storpool)\
**Post date:** [January 17, 2017, 8:43am UTC](https://forum.opennebula.io/t/solved-marketplace-proxy-not-working/3571/5 "2017-01-17T08:43:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jfontan](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jfontan/32/18_2.png) [@jfontan](https://forum.opennebula.io/u/jfontan)\
**Post date:** [January 17, 2017, 9:27am UTC](https://forum.opennebula.io/t/solved-marketplace-proxy-not-working/3571/6 "2017-01-17T09:27:00Z")

</div>

Thanks Anton!

---

<div class="post-metadata">

**Author:** ![VURoland](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/vuroland/32/7682_2.png) [@VURoland](https://forum.opennebula.io/u/VURoland)\
**Post date:** [August 7, 2017, 2:27pm UTC](https://forum.opennebula.io/t/solved-marketplace-proxy-not-working/3571/7 "2017-08-07T14:27:40Z")

</div>

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](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](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](https://proxy.example.com:8080)

---

<div class="post-metadata">

**Author:** ![jsfrerot](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jsfrerot/32/6690_2.png) [@jsfrerot](https://forum.opennebula.io/u/jsfrerot)\
**Post date:** [July 10, 2018, 12:07pm UTC](https://forum.opennebula.io/t/solved-marketplace-proxy-not-working/3571/8 "2018-07-10T12:07:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tinova](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/tinova/32/25_2.png) [@tinova](https://forum.opennebula.io/u/tinova)\
**Post date:** [July 10, 2018, 2:27pm UTC](https://forum.opennebula.io/t/solved-marketplace-proxy-not-working/3571/9 "2018-07-10T14:27:17Z")

</div>

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](https://github.com/OpenNebula/one)

---

<div class="post-metadata">

**Author:** ![jsfrerot](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jsfrerot/32/6690_2.png) [@jsfrerot](https://forum.opennebula.io/u/jsfrerot)\
**Post date:** [July 12, 2018, 4:58pm UTC](https://forum.opennebula.io/t/solved-marketplace-proxy-not-working/3571/10 "2018-07-12T16:58:10Z")

</div>

Issue opened: [https://github.com/OpenNebula/one/issues/2283](https://github.com/OpenNebula/one/issues/2283)

---

<div class="post-metadata">

**Author:** ![bilcalrk](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@bilcalrk](https://forum.opennebula.io/u/bilcalrk)\
**Post date:** [September 25, 2020, 10:14pm UTC](https://forum.opennebula.io/t/solved-marketplace-proxy-not-working/3571/11 "2020-09-25T22:14:06Z")

</div>

Opennebula 5.12.0.1  
I have tried every recommendation:

oned.conf  
MARKET\_MAD = [  
EXECUTABLE = “one\_market”,  
ARGUMENTS = “-t 15 -m http,s3,linuxcontainers,turnkeylinux,dockerhub,one --proxy http://:80”

sunstone-server.conf  
:proxy: http://:80  
:no\_proxy: localhost, 127.0.0.0/8

.curlrc  
proxy=http://:80

I am still getting the curl error:  
Command “set -e -o pipefail; /var/lib/one/remotes/datastore/fs/…/downloader.sh ‘[http://marketplace.opennebula.systemsappliance/154f6edf-47dc-4bcb-af77-e55c7d31e945/download/0](http://marketplace.opennebula.systemsappliance/154f6edf-47dc-4bcb-af77-e55c7d31e945/download/0)’ ‘/var/lib/one//datastores/1/428dc4f078adbe115195bc41fb3acba1’” failed: curl: (22) The requested URL returned error: 503 Service Unavailable
