Auto Restart with Two Factor Authentication

@Brian for my Live account I changed my AUTO RESTART time in my docker-compose.override.yml file. I receive the Authentication notices from IBKR every night at the time designated in my override.yml file but the way I interpret the QR Usage Guide the authentication should only be required on Sundays and the remaining days of the week I will automatically be logged back in.

Auto-restart with two-factor authentication
For live accounts with two-factor authentication, the Sunday auto-restart will require two-factor authentication. On other days, the auto-restart will automatically log you back in without the need to perform two-factor authentication. Thus, accounts with two-factor authentication can remain logged in all week, with mobile authentication on Sundays.

Did I misinterpret the Usage Guide and authentication is required every day or do I need to add special instructions in the override.yml file to automatically log back in without Authentication?

Please advise.

Thanks.

It's supposed to be weekly. Do you know exactly when the 2FA notifications began happening nightly instead of weekly for you? Was it correlated with any particular action such as moving to the cloud, changing the auto-restart time, etc? I've been having to perform nightly 2FA as well for the last couple weeks and have an open ticket with IBKR about it. No insights yet on why it's happening or how to resolve it.

@Brian it's been this way since I set up my Oracle Cloud Instance a couple of weeks ago so unfortunately I can't connect it with any action or change in my environment. Appreciate the response and hopefully they figure it out soon. Thanks.

This turned out to be an issue on QuantRocket's side. It isn't specifically related to Oracle but is related to the fact that Oracle is running on Arm64 architecture. On Arm64, the IB Gateway container uses a custom installation of Java rather than the Java that ships with IB Gateway. Since Java is located in a different location than IB Gateway expects, it's causing IB Gateway not to see the login token during auto-restart, which triggers 2FA.

To fix the issue, please edit your docker-compose.yml to add 3 environment variables to the ibg1 container (and any other ibg containers, if applicable) to tell IB Gateway where to look for Java, like this:

  ibg1:
    image: 'quantrocket/ibg:2.11.0'
    environment:
      # The following settings will be unnecessary in the next release
      JAVA_HOME: '/usr'
      INSTALL4J_JAVA_HOME: '/usr'
      app_java_home: '/usr'

Then re-deploy the container:

docker --context cloud compose up -d ibg1 

These environment variables won't be necessary in the next release, so they can go in your docker-compose.yml rather than your docker-compose.override.yml; that way, they'll be overwritten when you update to the next version.

1 Like

Great. Thanks for following up Brian.

@Brian I made the suggested changes but after re-deploying the container I can no longer connect with ibg1. Any ideas?

What do the logs say or what error message do you get?