For me the problem was when i was doing lookup for Symbol and getting the instrument value, the datatype of the instrument was int64 which is numpy based value but the Socket Api accept int.
so converting the int64 -> int fix the issue for me.