Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address already in use #53

Open
akh64bit opened this issue Jan 3, 2023 · 6 comments
Open

Address already in use #53

akh64bit opened this issue Jan 3, 2023 · 6 comments
Assignees

Comments

@akh64bit
Copy link

akh64bit commented Jan 3, 2023

The scripts runs fine.
However, If I change the config.ini.tmpl and make it auto-start at a fixed time everyday by adding the following lines, I get the error which is shown in the logs.
These lines were added under "4. TWS Auto-Closedown"
AutoLogoffTime= AutoRestartTime=10:00 PM
The logs are shown below.
2023-01-03 14:22:59:252 IBC: Setting ReadOnlyApi ib-gateway_1  | 2023-01-03 14:22:59:321 IBC: Read-Only API checkbox is now set to: false ib-gateway_1  | 2023-01-03 14:22:59:321 IBC: Setting Auto restart time ib-gateway_1  | 2023-01-03 14:22:59:341 IBC: Auto restart time set to 10:00 PM ib-gateway_1  | 2023-01-03 14:22:59:341 IBC: Performing port configuration ib-gateway_1  | 2023-01-03 14:22:59:349 IBC: TWS API socket port was set to 4001 ib-gateway_1  | 2023-01-03 14:22:59:350 IBC: TWS API socket port now set to 4000 ib-gateway_1  | 2023-01-03 14:22:59:350 IBC: Click button: OK ib-gateway_1  | Forking :::4000 onto [0.0.0.0:4001](http://0.0.0.0:4001/) ib-gateway_1  | 2023/01/03 14:23:15 socat[229] E bind(5, {AF=2 [0.0.0.0:4001](http://0.0.0.0:4001/)}, 16): Address already in use

@efernandesng
Copy link
Contributor

Hi @akh64bit,

Interesting, I'll take a look at that.

@efernandesng efernandesng self-assigned this Jan 8, 2023
@akh64bit
Copy link
Author

akh64bit commented Jan 9, 2023

Thanks @efernandesng. Please let me know if you know any other details.

@akh64bit
Copy link
Author

Any update on this?

@johnjohnk2
Copy link

johnjohnk2 commented Jan 12, 2024

I have the same issue here ... @akh64bit do you have any update on this ?

@johnjohnk2
Copy link

@akh64bit I ve found the solution and i will make a PR

@mprusinski
Copy link

mprusinski commented May 17, 2024

We have similar problem (Address already in use):

2024-05-17 11:42:24:564 IBC: TWS API socket port was set to 4002 2024-05-17 11:42:24:564 IBC: TWS API socket port now set to 4000 2024-05-17 11:42:24:564 IBC: Setting Auto restart time 2024-05-17 11:42:24:616 IBC: Auto restart time set to 04:00 AM 2024-05-17 11:42:24:685 IBC: detected dialog entitled: Warning; event=Lost focus 2024-05-17 11:42:24:686 IBC: detected dialog entitled: Warning; event=Deactivated 2024-05-17 11:42:24:686 IBC: detected dialog entitled: Warning; event=Closed 2024-05-17 11:42:24:715 IBC: Configuration tasks completed 2024-05-17 11:42:24:715 IBC: Click button: OK Forking :::4000 onto 0.0.0.0:4002 2024/05/17 11:42:24 socat[291] E bind(5, {AF=2 0.0.0.0:4002}, 16): Address already in use 2024-05-17 11:42:24:987 IBC: detected dialog entitled: Pending Tasks; event=Closed 2024-05-17 11:42:25:024 IBC: detected dialog entitled: IB Gateway; event=Opened 2024-05-17 11:42:25:027 IBC: Click button: OK 2024-05-17 11:42:25:168 IBC: detected dialog entitled: IB Gateway; event=Activated 2024-05-17 11:42:25:188 IBC: detected dialog entitled: IB Gateway; event=Focused 2024-05-17 11:42:25:189 IBC: detected dialog entitled: IB Gateway; event=Lost focus 2024-05-17 11:42:25:191 IBC: detected dialog entitled: IB Gateway; event=Deactivated 2024-05-17 11:42:25:216 IBC: detected dialog entitled: IB Gateway; event=Closed

After running ib-gateway I have manually run the socat TCP-LISTEN:4002,fork TCP:127.0.0.1:4000 command inside the container and it succeded. I see there is constant 30s delay before running this command - is it possible to move this timeout to env variable, so it could be changed on demand? Probably this would make a pretty good workaround before issue is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants