How can I run scm commands on a sandbox that is open in RTC Eclipse client?
Christian Prosch (11●1●1)
| asked Feb 05 '19, 6:40 a.m.
retagged Mar 21 '19, 3:18 p.m. by Ken Tessier (841●1●7)
We are operating RTC 6.0.6. I am trying to run scm commands from the command line like described here: https://jazz.net/help-dev/clm/index.jsp?topic=%2Fcom.ibm.team.scm.doc%2Ftopics%2Fc_scm_cli.html .
In general this works well, except if I try to run commands that work on a sandbox which is open in RTC Eclipse client. E.g. “lscm show status” on such a sandbox throws an error
Problem running 'show status': Could not initialize data area. Could not lock C:\sandboxes\example - locked by other process. I guess this is because RTC Eclipse client creates a lock file (C:\sandboxes\example\.jazz5\.jazzlock) in the sandbox that indicates to the lscm command that access to this sandbox is not allowed. Is there a way to access those sandboxes by command line interface even though they are locked by RTC Eclipse client? Or is there any other way to operate SCM from a script that does not have this sandbox locking problem?
Background/Why do I need this? We are developing "core" scripts that are under SCM version control. We have users that write their own scripts but use our "core" scripts. Our development environment is eclipse. We have the requirement that the core scripts shall check if they are part of a certain baseline and do certain actions if not (i.e. if they are too old or modified by the users).
|
One answer
Shashikant Padur (4.3k●2●7)
| answered Feb 05 '19, 10:46 p.m.
JAZZ DEVELOPER edited Feb 05 '19, 10:47 p.m.
Is it happening for all the users? or just one user? Which version of RTC are you using?
'lscm' should be able to work with the sandbox that is used by the RTC Eclipse client. Every sandbox is registered to a daemon process (it could be RTC Eclipse client daemon or a daemon launched by scm cli). When you run 'lscm' it looks for a daemon registered for that sandbox and if one available should be able to connect to it. Looks like there is some other issue here.
Running 'scm ls daemon' will list all the daemon processes along with the sandbox paths registered to it.
Can you try the following: Exit RTC Eclipse client, run 'scm daemon stop -a', restart RTC Eclipse client, connect to the repository, run 'lscm show status'.
Comments
Hello Shashikant,
thank you for the quick answer.
We are operating RTC 6.0.6. I tried only with my user so far.
As you suggested I did the following:
Close eclipse
scm daemon stop -a Daemon successfully terminated Start eclipse scm ls daemon Port Description 55395 org.eclipse.ui.ide.workbench C:\sandboxes\example lscm show status <nothing>
On the last command there was just nothing neither error nor data.
I then tried
scm daemon deregister C:\sandboxes\example
<error message suggested to consult log file>
message in scm0.log:
Problems deregistering sandbox C:/sandboxes/example com.ibm.team.filesystem.client.FileSystemException: Unable to deregister sandbox because there are shared Eclipse projects in it
When trying
scm daemon register 55395 C:\sandboxes\example
Sandbox registered. lscm show status <again nothing>
In the end only after closing eclipse and then running
scm daemon stop -a
lscm show status will finally show me the status of workspace and components.
It looks to me like eclipse is firmly prohibiting command line access to the sandbox.
Is there any way to tell the lscm commands to use the existing eclipse daemon?
Christian Prosch
commented Feb 06 '19, 3:49 a.m.
Hello Shashikant
sorry, my reply was too long for a comment, so I posted it as answer below.
Can you confirm if c:\sandboxes\example a sandbox? Have you loaded any repository workspace into it. If so, it should have a .jazz5 directory below it.
If the folder is not a sandbox, then it will not display anything.
Edit: As per you deregister message, looks like you have loaded a repository workspace.
Also, I hope you have run 'lscm login -r <repo>' to login to the repository.
What if you close RTC Eclipse client and then run lscm show status? Does it work?
Christian Prosch
commented Feb 06 '19, 6:46 a.m.
After closing eclipse and then running
scm daemon stop -a
lscm show status
it works and I get the status of workspace and components.
Christian Prosch
commented Feb 07 '19, 2:41 a.m.
... but closing eclipse is not what I want.
I need the scm-commands to be working on a sandbox even though the sandbox is open in eclipse RTC client.
Geoffrey Clemm
commented Feb 12 '19, 12:23 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Please see Shashi's original answer:
'lscm' should be able to work with the sandbox that is used by the RTC Eclipse client'
So Shashi is trying to help you find out why this isn't working for you.
Shutting down Eclipse and stopping the daemon was just a way to make sure there were no rogue daemons still running. You then restart the Eclipse client, and try to access via the lscm command line (note: you have to be using the lscm command line, not the scm command line).
Christian Prosch
commented Feb 18 '19, 10:11 a.m.
Hi Geoffrey,
OK, after closing eclipse and then running
"scm daemon stop -a"
"lscm show status" works and I get the status of workspace and components.
Then, I restarted eclipse client.
"scm ls daemon" shows me 2 daemons and only the command line daemon is attached to C:\sandboxes\example
"lscm show status" still works and I get the status of workspace and components.
But now in eclipse client I can no longer work with the sandbox C:\sandboxes\example. If I try to modify and save any file in the sandbox in eclipse I get an error "Save could not be completed. ... Reason: Unable to lock file C:\sandboxes\example\.jazz5\.jazzlock".
So command line works but now eclipse doesn't.
Finally after "scm daemon stop C:\sandboxes\example" eclipse works again.
So it looks like I have to close eclipse manually to make the command line work on the sandbox.
Is there no other way?
It is known (unsupported case) that Eclipse will not reuse the daemon launched by scm cli but reverse is a supported case.
Observation: In your first description you mentioned that when running 'lscm show status' you got a sandbox locked error and in subsequent response you mentioned the same command returned no response.
I am not sure what is going on but one more thing to try out is as follows:
* Close RTC Eclilpse client, stop all daemons (to stop any CLI daemon processes running)
* Delete <app_data_folder>\.jazz-scm folder.
* Restart RTC Eclipse client and then launch 'lscm show status'
If this does not work you may have to contact support to diagnose the issue.
showing 5 of 8
show 3 more comments
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
As far as I can tell, you cannot.