Open victornoel opened 6 years ago
btw I know I'm running in root and I shouldn't, but I tried also as a normal user and it doesn't seem to be related.
Note that I setup the prerequisites by hand since I'm not on one of the supported distributions (I'm actually trying to build a docker image that can be accessed via X11 forwarding, I will contribute it to the project when it works).
~ok, one reason that could explain this is that GsDevKit_home/server/stones/devKit_34/bin/
is empty and I suppose it should contain the binary startnetldi
.~
edit: scratch that, I misunderstood how things were working.
Suprisingly, while trying to debug it, I ran the installation in an environment with an X session (which wasn't the case before) and the error didn't appear.
I suppose there is some hidden dependency to having an X session available. any way to not to? Since I'm trying to build a docker image... thanks!
Welll devKitCommandLine
is a headless pharo image so perhaps pharo requires X libraries to be installed whether or not it is running headless ... or it's possible that even in headless mode it hits an X server ... It might be worth asking on the pharo list about what prerequisites are needed to run a headless pharo image .. I'll see if I can figure out where the MNU is coming from and perhaps all it takes is some bullet-proofing of the code
Okay the fact that the error is occuring during Array>>collect: implies that the following chunk of code is being executed:
ifFalse:
[args := (OrderedCollection new: arrayOfStrings size + 2)
add: progName;
addAll: (arrayOfStrings collect: [:e | e, nullString ]); "Null terminate each string"
yourself;
asArray].
and the arrayOfStrings
should be the netldi arguments .... the most likely culprit is TDSessionDescription>>netldiArgsOn:
:
netldiArgsOn: netldiArgs
netldiArgs
add: '-g';
add: '-a';
add: self osUserId.
self netLDIPort isEmpty
ifFalse: [
netldiArgs
add: '-P';
add: self netLDIPort ].
self netLDIPortRange
ifNotNil: [ :range |
| vrsnAr |
vrsnAr := self gemstoneVersion findTokens: '.'.
((vrsnAr at: 1) asNumber < 3 or: [ (vrsnAr at: 1) asNumber = 3 and: [ (vrsnAr at: 2) asNumber < 2 ] ])
ifTrue: [
"after GemStone 3.2, port range no longer accepted by netldi"
range isEmpty
ifFalse: [
netldiArgs
add: '-p';
add: range ] ]
ifFalse: [
Transcript
cr;
show: 'port range: ' , range printString , ' no longer needed for netldi in GemStone versions 3.2 and later' ] ].
netldiArgs add: self netLDI
and other than the oSUserId
message all other arguments are guaranteed to be not NIL.
osUserId
could return NIL if the USER
env var is not set ... I think:
osUserId
osUserId == nil
ifTrue: [ ^ OSPlatform current environment getEnv: 'USER' ].
^ osUserId
BTW, the -D
flag can be set in scripts for a call to devKitCommandLine
...the flag causes the pharo vm to come up head full and if an error occurs during processing a debugger will come up ... also if there are no errors you can manually exit the image for processing to continue ... if you run devKitCommandLine -D
on the bash command line you can come up with an interactive session of the image to read code (which is what I did here...
BTW, the -D flag can be set in scripts for a call to devKitCommandLine
That's actually how I realised that it was working when using a X environment, I wanted to call it with -D and debug it.
When I get some time, I will try to see if the problem is from the $USER
variable or if OSPlatform
is requiring X to be present. Thanks!
Just ran into the same issue, when starting netldi (via startNetldi command) from monit (Linux monitoring tool, see: https://mmonit.com/monit/documentation/monit.html). monit does not set the USER environment variable, nor does "bash --login". I tracked it down for hours...
Set USER environment variable in the start command manually (e.g. USER=ubuntu /home/ubuntu/script_that_starts_netldi.sh
)
Don't rely on the environment to have USER been set in the osUserId
method.
@dassi ... that makes a lot of sense ... thanks for the detective work ...
Hi,
I'm trying to install GsDevKit_Home and during the execution of
createStone devKit_33 3.3.0
(it is the same with 3.4), I get the following error:I'm not sure what is causing this, if you have an idea what I could try to look for, I can maybe help find the source of the problem.