apiaryio / apiary-client

Apiary CLI client
https://help.apiary.io/tools/apiary-cli/
MIT License
204 stars 70 forks source link

Apiary client in docker behind proxy #173

Closed matus753 closed 6 years ago

matus753 commented 6 years ago

Hello,

I'm trying to publish apiary content stored in gitlab by gitlab-runner using docker I did set up proxy in the enviroment of running docker container, i even try curl from it to https://api.apiary.io and it was working, but after i run apiary publish --api-name="****" i always end up with error:

warning: Overriding "Content-Type" header "text/plain" with "application/x-www-form-urlencoded" due to payload /usr/local/lib/ruby/2.5.0/net/http.rb:939:in rescue in block in connect': Failed to open TCP connection to api.apiary.io:443 (getaddrinfo: Name or service not known) (SocketError) from /usr/local/lib/ruby/2.5.0/net/http.rb:936:inblock in connect' from /usr/local/lib/ruby/2.5.0/timeout.rb:93:in block in timeout' from /usr/local/lib/ruby/2.5.0/timeout.rb:103:intimeout' from /usr/local/lib/ruby/2.5.0/net/http.rb:935:in connect' from /usr/local/lib/ruby/2.5.0/net/http.rb:920:indo_start' from /usr/local/lib/ruby/2.5.0/net/http.rb:909:in start' from /usr/local/bundle/gems/rest-client-2.0.2/lib/restclient/request.rb:715:intransmit' from /usr/local/bundle/gems/rest-client-2.0.2/lib/restclient/request.rb:145:in execute' from /usr/local/bundle/gems/rest-client-2.0.2/lib/restclient/request.rb:52:inexecute' from /usr/local/bundle/gems/rest-client-2.0.2/lib/restclient.rb:71:in post' from /usr/local/bundle/gems/apiaryio-0.11.1/lib/apiary/command/publish.rb:75:inquery_apiary' from /usr/local/bundle/gems/apiaryio-0.11.1/lib/apiary/command/publish.rb:52:in publish_on_apiary' from /usr/local/bundle/gems/apiaryio-0.11.1/lib/apiary/command/publish.rb:40:inexecute' from /usr/local/bundle/gems/apiaryio-0.11.1/lib/apiary/cli.rb:47:in publish' from /usr/local/bundle/gems/thor-0.19.4/lib/thor/command.rb:27:inrun' from /usr/local/bundle/gems/thor-0.19.4/lib/thor/invocation.rb:126:in invoke_command' from /usr/local/bundle/gems/thor-0.19.4/lib/thor.rb:369:indispatch' from /usr/local/bundle/gems/thor-0.19.4/lib/thor/base.rb:444:in start' from /usr/local/bundle/gems/apiaryio-0.11.1/bin/apiary:5:in<top (required)>' from /usr/local/bundle/bin/apiary:23:in load' from /usr/local/bundle/bin/apiary:23:in

'

tu1ly commented 6 years ago

hi,

try to set http_proxy env. var

https://github.com/apiaryio/apiary-client/blob/master/lib/apiary/command/publish.rb#L23

matus753 commented 6 years ago

thank you,

the problem was in the variable name, i was setting up HTTPS_PROXY meanwhile client search for variable http_proxy