Open forhonourlx opened 3 months ago
Can you provide your docker-compose.yml file (remove sensitive info such as passwords)?
You can try to verify the port mapping setting in docker-compose against the IB Gateway API port setting (via VNC), to see if they match. If not, you can remove the program file dir and let it try again. If the issue persists, please report back, I'll see if I can reproduce it.
Thank you, Mr He.
When I try to connect to port 4000, still no api respond...
And my config is docker-compose.yml
:
version: '2'
services:
my-ibga:
image: heshiming/ibga
restart: unless-stopped
environment:
- TERM=xterm
- IB_USERNAME=xxx
- IB_PASSWORD=xxx
- IB_REGION=China
- IB_TIMEZONE=America/New York
- IB_LOGINTAB=IB API
- IB_LOGINTYPE=Live Trading
- IB_APILOG=data
- IB_LOGLEVEL=Error
- IB_LOGOFF=4:30 AM
volumes:
- ./run/program:/home/ibg
- ./run/settings:/home/ibg_settings
ports:
- "15800:5800"
- "4000:4000"
Can you provide your docker-compose.yml file (remove sensitive info such as passwords)?
You can try to verify the port mapping setting in docker-compose against the IB Gateway API port setting (via VNC), to see if they match. If not, you can remove the program file dir and let it try again. If the issue persists, please report back, I'll see if I can reproduce it.
Ok I can reproduce it. Let me fix it.
That's very helpful! Thank you indeed!
It should be fixed now. It had actually been fixed a while ago, but for some reason the official docker image did not contain the change.
Rebuilt and get API connection failed: TimeoutError()
at this moment.
How should I do to get the latest update?
If you are using the official docker hub image, just issue docker pull heshiming/ibga
to update the image. Be aware at the moment IBKR servers are off due to hours long Friday/Saturday maintenance.
As far as I know, it is only reproducible with an older docker image of heshiming/ibga
on docker hub. But if you built your own version, I'm not sure why it didn't work in the first place.
If you are interested in debugging, you can observe the log of the docker container. Since your screenshot shows that the script didn't change anything in the settings screen (i.e. Read-only API is still checked, and port is not 9000), the script might be stuck at:
- option check, clicking menu Configure/Settings ...
If this step is successful, it then goes on to
- option check, clicking tree item Configuration/Lock and Exit ...
- option check, changing logoff time from 11:45 to 05:25 ...
- option check, clicking Auto restart ...
- option check, double clicking tree item Configuration/API ...
- option check, clicking tree item Configuration/API/Settings ...
The corresponding line is https://github.com/heshiming/ibga/blob/caec7a5e61d75ba0c97f407fd4f57ce6f6c214f9/scripts/_run_ibg.sh#L240 , where it searches for the menu item and click it.
I've previously noticed that the IBG window title is different for different account types. For example, Advisor Master accounts and institutional accounts have "IB Gateway", while individual accounts may have "IBKR Gateway" as window title.
So if you can confirm that the script stuck at this "menu click Config/Settings" step, you can further help me analyze it. Go into the container docker exec -ti container-name bash
. At command prompt, type:
$ echo "/tmp/test.txt|list_menu" > /tmp/ibg-jauto.in
$ cat /tmp/test.txt
This will show your window title together with the menu positions. With this information, I might have a clue why it's stuck.
If I build with docker-compose up -d
, it does not conduct '- option check' (like off Read-only API, and later)
Whatsmore, I notice that there comes a notification in the front( it could be closed by right-click), does it prevent the coming option-check scripts?
If I build with docker build --progress plain --rm -f ./dockerfile -t ibga ./
, auto inputs off username and password does not work correctly? So, where should I define username and password?
Here's the debug info:
PS C:\Users\Administrator> docker exec -ti ibga_my-ibga_1 bash
ibg@0dacffbda358:~$ echo "/tmp/test.txt|list_menu" > /tmp/ibg-jauto.in
ibg@0dacffbda358:~$ cat /tmp/test.txt
javax.swing.JFrame,ibgateway.aB,window:0,x:162,y:109,w:700,h:550,act:1,title:IBKR Gateway
File,x:0,y:0,w:27,h:21,mx:383,my:121,pop:n
File/Gateway Logs,x:0,y:0,w:27,h:21,mx:13,my:10
File/API Logs,x:0,y:0,w:27,h:21,mx:13,my:10
File/Gateway Layout/Settings,x:0,y:0,w:27,h:21,mx:13,my:10
File/Close,x:0,y:0,w:27,h:21,mx:13,my:10
Configure,x:32,y:0,w:63,h:21,mx:433,my:121,pop:n
Configure/Settings,x:32,y:0,w:63,h:21,mx:31,my:10
Configure/Automatic Encryption,x:32,y:0,w:63,h:21,mx:31,my:10,selected:1
Help,x:100,y:0,w:33,h:21,mx:486,my:121,pop:n
Help/About Gateway,x:100,y:0,w:33,h:21,mx:16,my:10
Help/Redundant Backup Status,x:100,y:0,w:33,h:21,mx:16,my:10
If you are using the official docker hub image, just issue to update the image. Be aware at the moment IBKR servers are off due to hours long Friday/Saturday maintenance.
docker pull heshiming/ibga
As far as I know, it is only reproducible with an older docker image of on docker hub. But if you built your own version, I'm not sure why it didn't work in the first place.
heshiming/ibga
If you are interested in debugging, you can observe the log of the docker container. Since your screenshot shows that the script didn't change anything in the settings screen (i.e. Read-only API is still checked, and port is not 9000), the script might be stuck at:
- option check, clicking menu Configure/Settings ...
If this step is successful, it then goes on to
- option check, clicking tree item Configuration/Lock and Exit ... - option check, changing logoff time from 11:45 to 05:25 ... - option check, clicking Auto restart ... - option check, double clicking tree item Configuration/API ... - option check, clicking tree item Configuration/API/Settings ...
The corresponding line is
, where it searches for the menu item and click it. I've previously noticed that the IBG window title is different for different account types. For example, Advisor Master accounts and institutional accounts have "IB Gateway", while individual accounts may have "IBKR Gateway" as window title.
So if you can confirm that the script stuck at this "menu click Config/Settings" step, you can further help me analyze it. Go into the container . At command prompt, type:
docker exec -ti container-name bash
$ echo "/tmp/test.txt|list_menu" > /tmp/ibg-jauto.in $ cat /tmp/test.txt
This will show your window title together with the menu positions. With this information, I might have a clue why it's stuck.
The debug info appears to be ok.
However, the "Login Messages" window is a problem. The mechanism simulates mouse clicks, which won't work if a window is blocking the menu. I've never seen this. Is there any setup in your account that I can replicate? If you are using TWS or IBG on your desktop for example, what's the content in this message, any way for me to turn it on?
The "Login Messages" window is quite odd, with no contents on this window. If I directly login on windows ver IB Gateway 10.19 stable, no "Login Messages" window would show. Do you have any opinion about why "API Server" is not activated on ibga ib gateway UI?
The debug info appears to be ok.
However, the "Login Messages" window is a problem. The mechanism simulates mouse clicks, which won't work if a window is blocking the menu. I've never seen this. Is there any setup in your account that I can replicate? If you are using TWS or IBG on your desktop for example, what's the content in this message, any way for me to turn it on?
Their servers are offline for extended maintenance period from Friday night to Saturday US ET. Try again later.
I will further report after the maintenance time. Thank you for your help!
Hi Mr. He. Same account do not have "Login Messages" on windows ver IB Gateway 10.19 stable...
Their servers are offline for extended maintenance period from Friday night to Saturday US ET. Try again later.
Can you try the latest though? The current implementation only downloads the latest version, which is 10.30.1j now. Perhaps if you try the latest version you'll see that message box.
Emmmm.... For IB reasons and bugs, I cannot finish these tasks windows, it would show again and again. Could you add some code to close optional "Login Messages" window? Or can you upload a "stable" tag of ibga docker, that would be very useful? Many Thanks!
I can only close it if I can reproduce the window. Right now none of my accounts have this. So you might as well try to login at web portal, I'm sure you'll see the same tasks to finish.
After I finish form on web portal, "Login Messages" window no longer shows. And I notice that TCP:localhost:9000 should be filled in Socket Port. Finally it works! Thank you for your help! Thanks!
2024-08-06 12:30:51 ------------------------------------------------
2024-08-06 12:30:51 Manager Startup / Tue Aug 6 00:30:51 EDT 2024
2024-08-06 12:30:51 ------------------------------------------------
2024-08-06 12:30:51 • starting xvfb (/usr/bin/Xvfb :0 -ac -screen 0 1024x768x16 +extension RANDR) ...
2024-08-06 12:30:51 pid: 209
2024-08-06 12:30:56 still waiting for display :0 to be ready ...
2024-08-06 12:31:02 display timed out, will try again ...
2024-08-06 12:31:02 stopping xvfb ...
2024-08-06 12:31:02 1 pids were not killed
2024-08-06 12:31:02 No process in pidfile '/var/run/xvfb.pid' found running; none killed.
2024-08-06 12:31:02 • starting xvfb (/usr/bin/Xvfb :0 -ac -screen 0 1024x768x16 +extension RANDR) ...
2024-08-06 12:31:02 pid: 273
2024-08-06 12:31:02 display :0 is ready
2024-08-06 12:31:03 • starting x11vnc (/usr/bin/x11vnc -forever -rfbport 5900 -o /var/log/x11vnc.log -display :0) ...
2024-08-06 12:31:03 pid: 295
2024-08-06 12:31:03 • starting novnc (/opt/noVNC-1.3.0/utils/novnc_proxy --listen 5800 --vnc localhost:5900) ...
2024-08-06 12:31:03 pid: 309
2024-08-06 12:31:03 • starting socat (/usr/bin/socat TCP-LISTEN:4000,fork,reuseaddr TCP:localhost:9000,forever,shut-down) ...
2024-08-06 12:31:03 pid: 331
2024-08-06 12:31:03 • found IBG at /home/ibg/Jts/ibgateway/ibgateway.
2024-08-06 12:31:03 ---------------------------------------------------
2024-08-06 12:31:03 IB Gateway Startup / Tue Aug 6 00:31:03 EDT 2024
2024-08-06 12:31:03 ---------------------------------------------------
2024-08-06 12:31:03 • time: Tue Aug 6 00:31:03 EDT 2024
2024-08-06 12:31:03 • starting IB Gateway ...
2024-08-06 12:31:03 pid: 359
2024-08-06 12:31:03 • waiting for jauto availability ...
2024-08-06 12:31:04 jauto is ready
2024-08-06 12:31:04 • waiting for main window ...
2024-08-06 12:31:12 found: IBKR Gateway at 117,79
2024-08-06 12:31:12 • filling in login form ...
2024-08-06 12:31:16 - skipping combobox Region since persisted state (/home/ibg_settings/skip_login_combobox_Region) indicates it already matches China
2024-08-06 12:31:16 - skipping combobox Time Zone since persisted state (/home/ibg_settings/skip_login_combobox_Time Zone) indicates it already matches America/New York
2024-08-06 12:31:16 • logging in ...
2024-08-06 12:31:17 • entered maintenance cycle
2024-08-06 12:31:18 - welcome: 28% Build 10.30.1j Authenticating... Logging in xxx
2024-08-06 12:31:19 !!! IB Gateway is waiting for two-factor authentication !!!
2024-08-06 12:31:23 !!! IB Gateway is waiting for two-factor authentication !!!
2024-08-06 12:31:27 - welcome: 50% Build 10.30.1j Requesting startup parameters... Logging in xxx
2024-08-06 12:31:29 LogModuleConfigurator-Init: Log4j Ver2.x found on classpath
2024-08-06 12:31:29 LogModuleConfigurator-Init: LogModuleConfigurator initialized with Log4j Verd.x
2024-08-06 12:31:32 - option check skipped, to perform again remove /home/ibg_settings/skip_option_check2
2024-08-06 12:35:02 addLogConsole Client 1
2024-08-06 12:35:02 JTS-EServerSocket-104: Couldn't write to log file - java.io.IOException: write beyond end of stream
2024-08-06 12:35:02 JTS-EServerSocket-104: Couldn't write to log file - java.io.IOException: write beyond end of stream
I can only close it if I can reproduce the window. Right now none of my accounts have this. So you might as well try to login at web portal, I'm sure you'll see the same tasks to finish.
No problemo. Sometimes it takes a trading day for those "tasks" to disappear. I've seen them, primarily via email notifications. But somehow I've never seen it during IBG login. If I did reproduce it, it would be a 5 minute job to fix it. So I'll keep watching.
Great job! Thank you on behalf of all users. Wish you earn big money!
Hi,
After build ibga container, I cannot connect to port:4000. And vnc shows no API connection on IB Gateway and Timeout Error of ib_insync. Is there anything wrong? Could somebody help? Thanks inadvance.