meraki api connection refused

SOLVED
ihsan
Here to help

meraki api connection refused

i have a java application and it can successfully connect to api.meraki.com in my local machine but when i deploy my java application to test server, the application which lives in a docker container can not connect to api.meraki.com. but in host machine i also can curl the api.meraki.com but inside my docker container (docker exec -it xxx /bin/bash), i can not curl it gives an connection refused error. i tried to use a new api key for test server but it is still giving connection refused error. i tried to allow my test server form meraki dashboard but no succcess. any ideas that what is the problem and solution?

1 ACCEPTED SOLUTION
ihsan
Here to help

test server was behind proxy and it was not configured, configuring both container and the application resolved the problem. (i think the application is connecting other service bypassing the proxy.

View solution in original post

6 REPLIES 6
CptnCrnch
Kind of a big deal
Kind of a big deal

Can you ping api.meraki.com from within the container? Are you able to connect to some other http service from it?

i can not ping api.meraki.com in both host and container. but in host machine, running

 

 curl -L --request GET --url https://api.meraki.com/api/v0/organizations --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'X-Cisco-Meraki-API-Key: xxx'

return organizations successfully but if i run this inside container it returns connection refused. 

application is connected another http service already but still not pinging in both host and container, but can be curl in both host and container.

PhilipDAth
Kind of a big deal
Kind of a big deal

It sounds like your test server either can not resolve the DNS name or does not have access to it.  Check with whoever administers the firewall.

i think it resolves the dns name because when i ping it gives ip:

root@db3680bc4ba3:/usr/lib/jvm/java-8-openjdk-amd64/jre/bin# ping api.meraki.com
PING mun211.meraki.com (209.206.57.71): 56 data bytes

my container is redhat when i run 

getent hosts api.meraki.com

it gives 

209.206.57.38   mun178.meraki.com api.meraki.com emea.api.meraki.com n3.meraki.com

 

ihsan
Here to help

test server was behind proxy and it was not configured, configuring both container and the application resolved the problem. (i think the application is connecting other service bypassing the proxy.

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.