getting error while fetching data from redisDB using rest API

82 views
Skip to first unread message

Amaresh Parida

unread,
Jan 11, 2022, 7:31:22 AM1/11/22
to sonic-mgmt-workgroup
Hi All,

I am trying to test the sonic-mgmt-framework with sonic-vs
I run both the component in 2 docker.

with that I lunched test UI "https://REST_SERVER_IP/ui"
and tried to do GET operation. I tried  get interface and port information which fails.

As per my understanding any docker including sonic-mgmt-docker talks to redis which is part of  sonic-vs(in my case) over a unix socket. I bind mounted the folder /var/run/redis for connectivity between rest-server and redisDB. I could able to see sonic-mgmt-framework connect to the redis database present in the other container sonic-vs. However get/set/post operation fails.

Here how  I run the 2 docker

sudo docker run  --name APsonic -v /var/run/redis:/var/run/redis -d docker-sonic-vs:latest
docker run --name APsonicMgmtFrMod -p 443:443 -v /var/run/redis:/var/run/redis  -d docker-sonic-mgmt-framework:latest

Here are the log of mgmt docker.
Capture.JPG

Appreciate your help.

Thanks,
Amaresh

Sachin Holla

unread,
Jan 11, 2022, 11:43:28 AM1/11/22
to Amaresh Parida, sonic-mgmt-workgroup
Hi Amaresh,

Looks like mgmt-framework is using tcp based redis connection -- https://github.com/Azure/sonic-mgmt-common/blob/master/translib/db/db.go#L361. Can you try mapping the redis ports also or use --net=host in docker run options?

Sachin

--
You received this message because you are subscribed to the Google Groups "sonic-mgmt-workgroup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonic-mgmt-workg...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonic-mgmt-workgroup/2e52ab69-6623-428b-9c9e-473fdd7d360bn%40googlegroups.com.

This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.

Amaresh Parida

unread,
Jan 11, 2022, 1:51:53 PM1/11/22
to sonic-mgmt-workgroup
Hi Sachin,

Thanks for the response. 
with your suggestion its working now.

Thank you for your help.

Amaresh
Reply all
Reply to author
Forward
0 new messages