Error when calling set_credentials from AWS

Hello!

I have been using a multiple login (two logins) setup with the primary login on my laptop and a 2nd login on an AWS EC2 instance. My primary trading app is on the laptop, and I'm using the AWS instance to develop the V2.0 of my app.

Everything was running great on both systems (able to get market data on both) until a couple of days ago when I got the SSL error. I updated both systems to the new quantrocket version and that fixed everything for about a day, but then the AWS instance stopped functioning (laptop instance is working fine). It seems that on AWS I can no longer start the gateway, and calling set_credentials also fails. I have verified that both logins work on the laptop and neither login works on AWS any longer. I didn't change anything so I'm thinking something on the quantrocket side of things changed, perhaps with the new release?

Here is a relevant snippet from the error I get when attempting to set_credentials on the AWS instance:

HTTPError: ('500 Server Error: INTERNAL SERVER ERROR for url: http://localhost:1969/ibg1/credentials', {'status': 'error', 'msg': "failed to set ibg1 credentials due to error updating API settings: Cannot start gateway due to error. API settings not updated. Please try again or manually update the API settings after the error is resolved. IBC log output is below:

Any ideas?

I didn't post the entire error message because I noticed it had my IB username and password listed in plaintext, but after re-reading it I did see another line that seemed relevant a bit further down the block, so here it is:

java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.

Did you try restarting the ibg service or re-creating it?

docker-compose up -d --force-recreate ibg1

You can also try to open the IB Gateway GUI to see if there is an error message.

Based on the localhost:1969 URL in your error message, it seems you are running a local installation on AWS, as opposed to using Docker Machine as in the cloud tutorial. Plenty of people do that, but there are a few forum posts from a long time ago where people doing the same thing ran into a similar X11 error message. (Search the forum for x11.) It's not clear what the resolution was other than maybe just try again.

Nothing relevant changed in the release, so it was likely the act of re-deploying that was the relevant "change".

1 Like

That did the trick! I had rebooted the server a few times but had not thought to recreate the ibg service. Thanks so much!