Keyboard Shortcuts
Likes
- Ibcalpha
- Messages
Search
Re: 2FA prevents TWS restarts without human authorisation
Hi Chen I don't think there's a way round that with TWS. But it can be made reasonably painless with IBC and IB Gateway. With Gateway you only get a forced restart over the weekend. I schedule my Gateway to shutdown early afternoon Saturday anyway and restart?early afternoon Sunday (UK time). IBC has a really useful setting that will keep retrying if you miss the first 2FA request. Andy ? ------ Original Message ------
From chen.wang3891@...
Date 16/10/2023 16:40:26
Subject [ibc] 2FA prevents TWS restarts without human authorisation Hi, |
2FA prevents TWS restarts without human authorisation
Hi,
For the last 2 years, I have kept TWS consistently and constantly running through daily scheduled and every odd unscheduled restart with the need for any human intervention. This is achieved through the help of IBC and Watchdog. Unfortunately, with the recently mandated 2FA security measure, no restart can be completed without a human acknowledgement through the IB Key on my iPhone. I have been searching for a remedy/workaround for weeks. The closest I have come across is to set the Lock and Exit behaviour in TWS to "Restart" instead of "Logoff", which did not improve things. It still requires the IB Key authorisation. I would be immensely grateful if someone in the community could offer me tips/suggestions, including switching to IB Gateway if absolutely necessary to restore the convenience I used to have. Thanks very much in advance! I am running IBC 3.16.2+ and TWS from 10.19+ on both Linux and macOS platforms. Chen |
Re: macOS difficulty setting up
开云体育You can have the main TWS window minimized by using this setting in config.ini: ? MinimizeMainWindow=yes ? I can’t guarantee that this will work consistently on macOS as I don’t have access to a macOS machine. TWS has a habit of un-minimizing itself when certain things happen, and IBC has to try and catch that and re-minimize. It may well not catch all cases, since few people use this setting (and neither do I, so I’d never notice unless someone tells me). ? On macOS, it’s not possible to hide the terminal window which displays the information about the log file. The Linux and Windows scripts provide a means to do this, but this doesn’t carry over to macOS. I dare say that there is technically a way to do it, but without being able to get my hands on a macOS computer I can’t really figure it out (if anyone reading this has any ideas, please let me know). ? Having said that, there is actually a way to run without the terminal window, but it has some disadvantages. If you look at the IBC log file you’ll see a line like this: ? Starting IBC with this command: ? The following line is a command that you can run directly from a command shell (presumably Bash), and it will run IBC and TWS in exactly the same way, but without the ‘wrapping’ provided by the normal shell script (if the command includes a -Drestart=… switch, remove it). Also redirect stdout and stderr to a file using normal redirection operators, to capture log output from IBC . ? The primary disadvantage is that some IBC features won’t work properly: for example, autorestart will succeed in restarting TWS, but you’ll have to re-authenticate via 2FA every time (for a live account). (Actually I need to verify that that last statement is really true: the 2FA automation probably should work provided you don’t let the 2FA prompt time out on IBKR Mobile). ? Frankly I see no real benefit in trying to hide TWS from view. It won’t save any resources. In my view, a much better approach is to run TWS in a virtual machine that’s used for nothing else, and access it when needed via VNC or whatever remote access mechanisms macOS provides. Richard |
Re: macOS difficulty setting up
Haha yup that worked sorry about that. I appreciate what you guys are doing with this. It makes life easier when working with an already annoying user experience with IBKR. While I have you, is there a way to open TWS headless from the shell script so that no window pops up? Thanks.
|
Re: macOS difficulty setting up
开云体育Read the notes for the TWS_MAJOR_VRSN variable in twsstartmacos.sh. It says this: ? #?? TWS_MAJOR_VRSN # #???? Specifies the major version number of TWS to be run. If you are #???? unsure of which version number to use, run TWS manually from the #???? icon on the desktop, then click Help > About Trader Workstation. In the #???? displayed information you'll see a line similar to this: # #?????? Build 10.19.1f, Oct 28, 2022 3:03:08 PM # #???? The major version number is 10.19. (Note that this is different from #???? the equivalent Windows and Linux settings because the macOS installer #???? includes the period in the install folder name). # #???? Do not include the rest of the version number in this setting. ? But you appear to have: ? TWS_MAJOR_VRSN=1019 ? Richard ? ? From: [email protected] <[email protected]> On Behalf Of blotterdavid@...
Sent: Thursday, September 21, 2023 3:45 PM To: [email protected] Subject: [ibc] macOS difficulty setting up ? I'm trying to set up IBC 3.18.0 on my macOS with TWS version 1019. Attached is what my directories looks like. I installed the offline version of TWS 10.19 for macOS but it's still saying I don't and it can't find the jars folder but it's in the directory I specified in the shell scripts. TWS version = 1019 Program = TWS Entry point = ibcalpha.ibc.IbcTws --tws-path = ~/Applications --tws-settings-path =? --ibc-path = /opt/ibc --ibc-ini = ~/ibc/config.ini --mode =? --java-path =? --user = --pw = ? ? =========================== An error has occurred ============================= ? ? ? Error: Offline TWS/Gateway version 1019 is not installed: can't find jars folder ? ? ? ?Make sure you install the offline version of TWS/Gateway ? ? ? ?IBC does not work with the auto-updating TWS/Gateway |
macOS difficulty setting up
I'm trying to set up IBC 3.18.0 on my macOS with TWS version 1019. Attached is what my directories looks like. I installed the offline version of TWS 10.19 for macOS but it's still saying I don't and it can't find the jars folder but it's in the directory I specified in the shell scripts.
This is what my log file looks like: TWS version = 1019
Program = TWS
Entry point = ibcalpha.ibc.IbcTws
--tws-path = ~/Applications
--tws-settings-path =?
--ibc-path = /opt/ibc
--ibc-ini = ~/ibc/config.ini
--mode =?
--java-path =?
--user =
--pw =
?
?
=========================== An error has occurred =============================
?
?
?
Error: Offline TWS/Gateway version 1019 is not installed: can't find jars folder
? ? ? ?Make sure you install the offline version of TWS/Gateway
? ? ? ?IBC does not work with the auto-updating TWS/Gateway Thanks. |
Re: how to disable UseSSL=True or uncheck SSL in login dialog from IBC
开云体育Mark ? Perhaps you didn’t see, or didn’t read properly, my post on 10 September? If not, please read it! ? Then, please, can you respond to what I asked? Which was this: ? Have you actually got this working, ie cross-connect login, running TWS manually, ie without IBC? If so, then please send me the actual jts.ini that it uses. ? If you haven’t had it working manually, then I really don’t understand why you started this thread: IBC is not magic: it can’t make TWS do something that it doesn’t do when run manually. ? Thanks ? Richard |
Re: how to disable UseSSL=True or uncheck SSL in login dialog from IBC
开云体育That’s irrelevant now. I’ve understood the difference. ? I need you to respond to my post from yesterday. ? ? From: [email protected] <[email protected]> On Behalf Of Mark
Sent: Monday, September 11, 2023 4:33 AM To: [email protected] Subject: Re: [ibc] how to disable UseSSL=True or uncheck SSL in login dialog from IBC ? Its is 1019 / 1023 ? ? On Fri, Sep 8, 2023 at 12:52 AM Richard L King <rlking@...> wrote:
|
Re: how to disable UseSSL=True or uncheck SSL in login dialog from IBC
开云体育Mark ? I don’t think this is going to work. I’ve done the changes I suggested, and when IBC runs it sets the right things in jts.ini, which ends up like this: ? [IBGateway] ApiOnly=true ? [Logon] Locale=en s3store=true tradingMode=p TimeZone=Europe/London displayedproxymsg=1 UseSSL=false ? [Communication] Peer=65.90.92.40:4001 ? But when TWS runs, the UseSSL option on the login screen is checked, ie it ignores UseSSL=false in jts.ini. If I run TWS manually with this jts.ini, and then uncheck the UseSSL option on the login screen, it won’t let it run unless I agree to use SSL. ? So it seems to me that IBKR have given you bad information: telling you to make sure UseSSL=false in jts.ini simply doesn’t help. The fact is that current versions of TWS insist on using SSL, and there’s no way around it. ? Now it may be that I’m missing something, and there is additional settings that are needed. So my question to you is this: ? Have you actually got this working, ie cross-connect login, running TWS manually, ie without IBC? If so, then please send me the actual jts.ini that it uses. ? If you haven’t had it working manually, then I really don’t understand why you started this thread: IBC is not magic: it can’t make TWS do something that it doesn’t do when run manually. ? Richard ? |
Re: how to disable UseSSL=True or uncheck SSL in login dialog from IBC
开云体育Mark ? Ok, I’ve spent some time looking at this, and I think I know what I’m going to do. ? What I propose is to introduce a new setting in config.ini, which will be like this: ? CrossConnectPeer=65.90.92.40:4001 ? When IBC starts up, it always examines the jts.ini file and makes sure it contains the required minimal lines . If the CrossConnectPeer setting has a value, this mechanism will now set the Peer line to the value of that setting, and set UseSSL=false. ? If CrossConnectPeer is not set, or is absent, the jts.ini processing will be unchanged. ? I can’t test this fully myself because I can’t connect to your cross-connect server, so I’ll produce a beta version for you to test. ? With any luck I’ll be able to let you have this beta version tomorrow (Sunday) evening. ? Richard ? |
Re: how to disable UseSSL=True or uncheck SSL in login dialog from IBC
开云体育At the moment, the answer is ‘no’: there’s no way to disable SSL with IBC. ? However, it should be possible to amend IBC to allow this. ? I’m out for the day, so I can’t look at this now. I’ll try to look into it at the weekend. ? However in the meantime, what version of TWS are you using? My login screen (10.19 or 10.24) doesn’t look like that. I’m unwilling to make changes to IBC that only work for old versions of TWS, so you’ll need to be on the current stable or latest version. ? ? ? From: [email protected] <[email protected]> On Behalf Of Mark
Sent: Friday, September 8, 2023 12:17 AM To: [email protected] Subject: Re: [ibc] how to disable UseSSL=True or uncheck SSL in login dialog from IBC ? Richard, Cross connected login is changing in jts.ini? ? instead of connecting?to the public?network?ndc1 you connect to a dedicated ip address that gives the following error shown in image? ? this causes ibc to not reboot it and gets stuck w the mismatch ssl certificate error shown in image - this doesnt even login to gateway? advise from ibkr :?Could you kindly confirm that you have unchecked the SSL option? If not, could you?kindly uncheck and try again, and let us know the outcome? ? ? attached in the second screenshot is use SSL : is there a way to disable?the useSSL or uncheck the SSL option |
Re: how to disable UseSSL=True or uncheck SSL in login dialog from IBC
开云体育Can you please explain what you’re trying to do, because I have no idea what you’re talking about. What do you mean by ‘cross connected logins’? ? TWS no longer allows not to use SSL. If you change the UseSSL setting in jts.ini to false, TWS automatically resets it to true. ? Is it possible to do what you’re trying to do without using IBC? If so, then tell me exactly what this involves and I’ll look into it. If it’s not possible, then there is certainly nothing at all that IBC can do about it. ? Richard ? ? ? From: [email protected] <[email protected]> On Behalf Of Mark
Sent: Thursday, September 7, 2023 10:11 PM To: [email protected] Subject: [ibc] how to disable UseSSL=True or uncheck SSL in login dialog from IBC ? How to disabled this as i am getting the SSL certificate mismatch error for cross connected logins? |
Re: IBC returned exit status 137
开云体育No idea. Exit code 137 means that the process has been sent a KILL signal. Nothing in IBC ever does this, so there must be some external reason for it (for example, running out of memory would do it). ? Send the IBC logfile (attach it, don’t quote it in the post): it might provide some useful info, but probably not if you haven’t changed anything. ? Richard ? ? From: [email protected] <[email protected]> On Behalf Of mattias.lindsjo@...
Sent: Friday, August 25, 2023 11:15 AM To: [email protected] Subject: [ibc] IBC returned exit status 137 ? Hi! /root/ibc/scripts/ibcstart.sh: line 504:? ? 28 Killed? ? ? ? ? ? ? ? ? "$java_path/java" -cp "$ibc_classpath" $java_vm_options$autorestart_option $entry_point "$ibc_ini" "$ib_user_id" "$ib_password" ${mode} IBC returned exit status 137 autorestart file not found Gateway finished
TWS version 10.19.2c IBC version 3.18.0 ? |
IBC returned exit status 137
Hi!
I have started to get this error message after a couple of hours up time: /root/ibc/scripts/ibcstart.sh: line 504:? ? 28 Killed? ? ? ? ? ? ? ? ? "$java_path/java" -cp "$ibc_classpath" $java_vm_options$autorestart_option $entry_point "$ibc_ini" "$ib_user_id" "$ib_password" ${mode}
IBC returned exit status 137
autorestart file not found
Gateway finished
The same environment has been running smoothly for months up until yesterday with: TWS version 10.19.2c
IBC version 3.18.0
Any pointers or idees on what's going on? ? |
Re: Username and Password Fields Not Populating, New Issue
Hi Richard,
Unfortunately, I do not have any of the previous logs.? I am 95% sure that the situation that you described above is not what preceded the issue.? However, if it happens again I shall look out for what lead up to it in the future and send across the logs for further information. Thanks for coming back so swiftly as ever. Alistair |
Re: Username and Password Fields Not Populating, New Issue
开云体育Alistair ? The way to avoid this is not to do something that causes it to happen! ? I realise that’s a bit vague, but actually it’s quite difficult to make this happen at all. I’d be interested to see the log file(s) immediately preceding the first one that gave problems. ? For example, in your case, the autorestart file was found in C:\Jts\fgihapeajlfebknncbmjpfjgkajakgelpmcnfhif. Given that you haven’t specified TWS_SETTINGS_PATH in your start script, the only ways an autorestart file could be there is if: ?
? So probably the best advice is this: don’t shut down TWS/Gateway by killing the process or by closing the banner window unless you’re absolutely sure that auto-restart is not under way. ? Having said that, it’s perfectly possible that I’m missing something (because what I’ve described above is pretty rare), and that’s why it would be helpful to see those earlier logs if you still have them. ? Richard ? ? From: [email protected] <[email protected]> On Behalf Of agftrading@...
Sent: Tuesday, August 15, 2023 1:06 PM To: [email protected] Subject: Re: [ibc] Username and Password Fields Not Populating, New Issue ? Hi Richard, |
Re: Username and Password Fields Not Populating, New Issue
Hi Richard,
After posting this, I kept searching and found this thread:?/g/ibcalpha/topic/97467926#2020.? Following the steps there has solved the issue. How best to avoid this in the future? Thanks, Alistair |
Username and Password Fields Not Populating, New Issue
Hi Richard,
IBC Gateway had been working until this morning.? However, now it does not populate the username and password fields and log in.? It was a problem that I encountered when using Gateway 1023, so I stuck with 1019.? It now seems to work for neither.? I have attempted to fix it by updating to the latest IBC version, however the problem persists.? I realise this seems to be a common issue, one that I have solved in the past deploying various fixes, but it seems to persist for me at the moment.? I attach two log files; one for each gateway version. Thanks, Alistair IBC-_GATEWAY-1019_TUESDAY.txt
IBC-_GATEWAY-1019_TUESDAY.txt
IBC-_GATEWAY-1023_TUESDAY.txt
IBC-_GATEWAY-1023_TUESDAY.txt
|