Trading TWS session is connected from a different IP address


trying to fetch the historical data, and I get the following error:

“Historical Market Data Service error message:Trading TWS session is connected from a different IP address”

I have a live (ibg1) and a demo (ibg2) accounts, and I was suspecting that could be a cause of the above error (just a guess as I am not logged in from anywhere else). But I unfort cannot get rid of ibg2.

I proceeded as following:
I deleted ibg2 from docker-compose.yml, and restarted => I still see both ibg1 and ibg2 started.

I tried to follow the steps suggested by Brian in this post:

but I get the following error:
ERROR: No such service: ibg2

1- do you think the market data download error is related to these two igb1 ibg2 both started?
2- how to get rid of ibg2 or/and stop it?


If ibg2 is the paper login corresponding to the live login used by ibg1, yes, that is the reason for the error. Due to market data restrictions, IB won’t let you receive data simultaneously to both accounts.

Add ibg2 back to your Compose file, then follow the steps in the linked post.


I added back ibg2, and followed the steps to remove it.
now ibg2 no longer appears in “docker ps”

But when I do:
quantrocket launchpad start --wait

I get the following:

status: running
msg: ‘502 Server Error: Bad Gateway for url: http://houston/ibg2/gateway?wait=True:
status: error

How can I get quantrocket to completely forget ibg2?


Launchpad verifies the gateways every couple of minutes to see if they’re still there so ibg2 should disappear on its own.