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

vmoptions not found on mac #59

Closed
elastictree opened this issue Jul 1, 2019 · 15 comments
Closed

vmoptions not found on mac #59

elastictree opened this issue Jul 1, 2019 · 15 comments

Comments

@elastictree
Copy link

elastictree commented Jul 1, 2019

vmoptions are installed in ~/Jts, so, ibcstart.sh must search via

tws_vmoptions="${tws_settings_path}/tws-${tws_version}.vmoptions"

instead of

tws_vmoptions="${tws_path}/tws-${tws_version}.vmoptions"

right?

@rlktradewright
Copy link
Member

No, not right.

tws_settings_path is nothing to do with where the TWS installer places the files: it controls where TWS stores its settings (hence the name), and defaults to the installation directory, but the user can set it to wherever they like.

I don't actually have access to a mac, but as far as I'm aware the .vmoptions file is always installed to ~/Applications/tws-nnn.vmoptions where nnn is the version number, and that's exactly the same thing as ${tws_path}/tws-${tws_version}.vmoptions.

If you're having a problem, it would probably be worth attaching your IBC log file to your reply (attach, don't quote).

@elastictree
Copy link
Author

Hm, I had the same problem like in this message: https://groups.io/g/ibcalpha/topic/24239631#675
I installed on a fresh Mac the TWS offline 972, and also the Gateway, same Version, and both put their vmoptions in ~/Jts.

@rlktradewright
Copy link
Member

Can you be a bit more precise please?

Exactly what file did it put in ~/Jts ?

Perhaps give a directory listing of ~/Jts.

@elastictree
Copy link
Author

this is the structure of my home-directory. I have no single files directly under ~/Applications/
image

@rlktradewright
Copy link
Member

Ah right, thanks for that, I understand now.

The previous version of ibcstart.sh worked because it said:

tws_vmoptions="${tws_settings_path}/${tws_version}/tws.vmoptions"

This was technically incorrect, because as I said before ${tws_settings_path} would not necessarily be set to ~/Jts, but in practice it always was because that was the default and no (top-level) way was provided to change it. But now that ${tws_settings_path} can be set from the top-level scripts, that line is no longer viable. Unfortunately the change I made was equally incorrect!

I've attached an amended version of ibcstart.sh, which should fix the problem. I'd be grateful if you could test if for me.

(I've had to put it in a .zip, because GitHub won't let me attach a .sh)

ibcstart.zip

@elastictree
Copy link
Author

elastictree commented Jul 2, 2019

I tested your file, but still have problems, log is below. ${tws_path} points to ~/Applications, therefore tws_vmoptions="${tws_path}/tws-${tws_version}.vmoptions" won't work. Furthermore I don't understand the error message of the script, because the path of the jars seems to be correct. This was not an issue with the previous version.

Starting IBC version 3.8.1 on 2019-07-02 at 13:45:43

Operating system: Darwin xxx.xxx 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64

Arguments:

TWS version = 972
Entry point = ibcalpha.ibc.IbcTws
--tws-path = /Users/xxx/Applications
--tws-settings-path = /Users/xxx/Jts
--ibc-path = /opt/ibc
--ibc-ini = /Users/xxx/ibc/config.ini
--mode = 
--java-path = 
--user =
--pw =


=========================== An error has occurred =============================



Error: TWS version 972 is not installed: can't find ~/Applications/IB Gateway 972/jars
       You must install the offline version of TWS/Gateway
       IBC does not work with the auto-updating TWS/Gateway

@elastictree
Copy link
Author

The previous version worked fine for me with the changes I wrote in my first message.

@rlktradewright
Copy link
Member

rlktradewright commented Jul 2, 2019

Ok, the reason that ${tws_path} points to ~/Applications is that it has been passed down from twsstart.sh, ie the top-level script. The default setting is:

TWS_PATH=~/Jts

whereas you presumably have:

TWS_PATH=/Users/xxx/Applications

So change that back to the default, and at least then the .vmoptions file should be found ok.

I don't understand the error message either, unless your home directory structure has changed since you sent the picture. Can you please confirm that ~/Applications/Trader Workstation 972/jars and/or ~/Applications/IB Gateway 972/jars do actually still exist, and that you haven't made any changes at all to the revised script I sent you.

Yes, I understand that your original 'fix' worked, but it's an incorrect fix - ie it only works by accident: ${tws_settings_path} is not (in general) the right place to search for the .vmoptions file, though it happens to point to the right place by default. Once you've set TWS_PATH=~/Jts in twsstart.sh, ${tws_path} WILL be pointing to the right place.

I'll be away from the computer for the next several hours.

@elastictree
Copy link
Author

regarding to the path of the jars: If I replace ~ in ibcstart with the absolute path /Users/xxx then the script will find the jars. Don't ask me why. The directory structure is unchanged, like in your last message.

And also, by setting TWS_PATH=~/Jts your version of the script is working fine. But I am still a bit confused, because TWS_PATH=~/Applications is the default in twsstartmacos.sh & gw.

btw, thanks a lot for contributing this important project!!

@rlktradewright
Copy link
Member

Oops! I had completely forgotten that there are top-level scripts specifically for macOS: thanks for reminding me. I'll have to amend them to include the TWS_SETTINGS_PATH variable, and correct the TWS_PATH default setting.

But not tonight!....

@davidyu513
Copy link

I don't think the path issue for Mac was fixed

@rlktradewright rlktradewright reopened this Feb 2, 2020
@rlktradewright
Copy link
Member

Can you elaborate a bit please? I don't have a Mac, or access to one, so any work I do on the macOS scripts is with one hand tied behind my back!

So any hard evidence you can supply would be appreciated: just the IBC log from a run on macOS would probably be a big help

Thanks.

@davidyu513
Copy link

davidyu513 commented Feb 2, 2020

Log file below, I believe it's the same issue @elastictree mentioned. Because in script ibcstart.sh for Mac OX it's tws_vmoptions="${tws_path}/tws-${tws_version}.vmoptions" and TWS_PATH=~/Applications. However .vmoptions for Mac locates in ~/Jts. What I did to fix it was put TWS_SETTINGS_PATH=~/Jts in the twsstartmacos.sh and in ibcstart.sh change from tws_vmoptions="${tws_path}/tws-${tws_version}.vmoptions" to tws_vmoptions="${tws_settings_path}/tws-${tws_version}.vmoptions" like @elastictree and it worked. Bottom line is .vmoptions locates in ~/Jts for Mac

` =============================================================================

Starting IBC version 3.8.2 on 2020-02-02 at 10:37:11

Operating system: Darwin Davids-MacBook-Pro.local 19.2.0 Darwin Kernel Version 19.2.0: Sat Nov 9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64 x86_64

Arguments:

TWS version = 972
Entry point = ibcalpha.ibc.IbcTws
--tws-path = /Users/david/Applications
--tws-settings-path =
--ibc-path = /opt/ibc
--ibc-ini = /Users/david/ibc/config.ini
--mode =
--java-path =
--user =
--pw =

=========================== An error has occurred =============================

Error: does not exist
`

@rlktradewright
Copy link
Member

Sorry for the delay in responding: I did actually start to reply a couple of days ago, but that got overtaken by other events.

Your fix only works as long as the user doesn't set TWS_SETTINGS_PATH in twsstartmacos.sh to something else, and the whole point of TWS_SETTINGS_PATH is to enable the user to store TWS settings in a non-default location (for example because they want to run live and paper TWSs, and want them separated out, or because they want to run two different versions of TWS).

Anyway, I've just pushed an amended version of ibcstart.sh which should fix the problem properly. It simply makes use of the fact that on macOS, the .vmoptions files are always in ~/Jts (as you pointed out).

Please can you pick that new version up from here, and give it a whirl.

@davidyu513
Copy link

Sorry for the delay in responding: I did actually start to reply a couple of days ago, but that got overtaken by other events.

Your fix only works as long as the user doesn't set TWS_SETTINGS_PATH in twsstartmacos.sh to something else, and the whole point of TWS_SETTINGS_PATH is to enable the user to store TWS settings in a non-default location (for example because they want to run live and paper TWSs, and want them separated out, or because they want to run two different versions of TWS).

Anyway, I've just pushed an amended version of ibcstart.sh which should fix the problem properly. It simply makes use of the fact that on macOS, the .vmoptions files are always in ~/Jts (as you pointed out).

Please can you pick that new version up from here, and give it a whirl.

Yes, I agree this would be a better fix

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

3 participants