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

remove Client 0 message #108

Closed
tbrown122387 opened this issue Dec 31, 2020 · 5 comments
Closed

remove Client 0 message #108

tbrown122387 opened this issue Dec 31, 2020 · 5 comments

Comments

@tbrown122387
Copy link

I keep getting this remove Client 0 message in my Docker Compose project. I see that this has been discussed elsewhere so I am trying to figure out this Read-Only API true default issue.

I follow the following instructions, but every time I complete the following steps, the Read-Only option is set back to true even after I have set it to false.

  1. Make sure I have Docker and Docker Compose installed on the machine.
  2. clone my repo
  3. change the config files to plug in my username/password
  4. run docker-compose up --build and wait until I see remove Client 0
  5. Open up a new terminal window and type docker ps -a to get the CONTAINER_ID for the image "dockerized_logger_tws". For me it is dcffeeb7d754
  6. In this same window open up a shell in the ibgateway container by typing docker exec -it dcffeeb7d754 /bin/bash
  7. Run the following command to allow me to visually see what's going on inside your IBGateway Docker container mkdir ~/.vnc && echo "mylongpassword" > ~/.vnc/passwd && x11vnc -passwd mylongpassword -display ":99" -forever -rfbport 5900
  8. Open up VNC viewer (or some subsitute) and connect to 127.0.0.1:5901 When it prompts me for a password, I type mylongpassword
  9. I see the ibgateway window. I click Configure -> settings -> Api -> Settings. I uncheck Read-Only API at the top, and then click OK. Then I VNC Viewer on your host machine.
  10. I go back to the terminal window running the docker containers, and hit Ctrl-Z. This exits out of everything, but I verify that the containers are still up by typing docker ps -a
  11. I type docker-compose stop
  12. I type docker-compose up or docker-compose up -d
    But then I get the same message as before: remove Client 0

I'm new to Docker so maybe the containers, when they get "rebuilt" (not sure if that's the right word) they clear out the saved progress made to /root/Jts/*encrypted user id*/ibg.xml?

@rlktradewright
Copy link
Member

rlktradewright commented Dec 31, 2020

Just set:

ReadOnlyApi=false

or

ReadOnlyApi=no

in your config.ini file.

@tbrown122387
Copy link
Author

I didn’t realize that you added this in ecb6f3d#diff-c8d8d62a34800f1c969ec30de080d73cb3d46a102c697d8d4b942e973c615f6f That’s great!

I’ve got to wait until Monday to check that the whole thing populates the database with data. I’ll check back in then.

@tbrown122387
Copy link
Author

Still having some problems, but I'm beginning to suspect it's something else with teh config of the mysql db. Here is the tail end of my docker logs

mysql_data | 2021-01-04T23:46:04.047593Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.22'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
log_app_1  | SUCCESSFULLY BUILT IB CLIENT LOGGING APP\n
log_app_1  | NOW RUNNING THE CLIENT LOGGING APP\n
mysql_data | mbind: Operation not permitted
ib_logger_app | remove Client 0

@rlktradewright
Copy link
Member

The message 'remove Client 0' is nothing to do with IBC. I think TWS/Gateway logs it when an API client disconnects.

So there is no information at all here that I can use to help you. The IBC logfile contains a lot of useful information, so you could attach that and I can then see if it looks like IBC is working - assuming you're actually creating the IBC logfile. Note that you need to run IBC from the gatewaystart.sh script to have an IBC logfile created automatically. But if you use ibcstart.sh to start it, you could create your own logfile and redirect stdout to it when you run the script. Or maybe your using some other logging mechanism?

@tbrown122387
Copy link
Author

I am using ibcstart.sh and redirecting it, but the file appears to be empty...hmm?

If I jump into the client app's container and use a shell to run the trade client manually, I get this:

root@84096c53d3d9:/usr/src/app/IBJts/samples/Cpp/TestCppClient# ./emini_logger 
prt: 4004
host: tws
Start of C++ Socket Client Test 0
Attempt 1 of 50
Connecting to tws:4004 clientId:0
Connected to tws:4004 clientId:0
requesting level1 and trade data...
tick writer size: 3
unique order id: 4000
unique trade id: 4001
Connection Closed
Error. Id: -1, Code: 504, Msg: Not connected
unique order id: 4002
unique trade id: 4003
Error. Id: -1, Code: 504, Msg: Not connected
Error. Id: -1, Code: 504, Msg: Not connected
unique order id: 4004
unique trade id: 4005
Error. Id: -1, Code: 504, Msg: Not connected
Error. Id: -1, Code: 504, Msg: Not connected
Sleeping 10 seconds before next attempt
Error. Id: 4000, Code: 504, Msg: Not connected
Error. Id: 4001, Code: 504, Msg: Not connected
Error. Id: 4002, Code: 504, Msg: Not connected
Error. Id: 4003, Code: 504, Msg: Not connected
Error. Id: 4004, Code: 504, Msg: Not connected
Error. Id: 4005, Code: 504, Msg: Not connected

That error seems to say I'm getting an unhandled error in my own client code. Judging by my client code, it looks like my call to reqTickByTickData just terminates the connection for some reason.

It looks like this is outside the realm of IBC, so I will close the issue. Thanks for your help!

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

2 participants