rtcTo / rtc2gitcli

An IBM's RTC SCM tool extension to migrate an RTC repository into a Git repository
https://rtc.to
MIT License
28 stars 34 forks source link

issue while running migration #47

Closed himmakam closed 6 years ago

himmakam commented 6 years ago

I followed all the steps in rtc2gitcli and started migration. I get the following error - Can anyone help me with this. Do we need to create git repo before and do some other settings? I dont see any reference to git repo in this document. It would be good if we mention those steps here.

ccuRev Transaction Id: 50 with comment: L10N Kit Version Controlling [2018-04-18 10:26:47] Baseline [HEAD] with original name [HEAD] created at [Sun Aug 17 12:42:55 IST 292278994] total number of changesets [0] will be tagged [false] [2018-04-18 10:26:47] TOTAL NUMBER OF CHANGESETS [144] [2018-04-18 10:26:47] ** BASELINE INFOS ** [2018-04-18 10:26:47] Start migration of tags. [2018-04-18 10:26:48] org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of add command at org.eclipse.jgit.api.AddCommand.call(AddCommand.java:246) at to.rtc.cli.migrate.git.GitMigrator.gitCommit(GitMigrator.java:228) at to.rtc.cli.migrate.git.GitMigrator.init(GitMigrator.java:435) at to.rtc.cli.migrate.MigrateTo.run(MigrateTo.java:147) at to.rtc.cli.migrate.git.MigrateToGit.run(MigrateToGit.java:25) at com.ibm.team.filesystem.cli.core.AbstractSubcommand.run(AbstractSubcommand.java:51) at com.ibm.team.rtc.cli.infrastructure.internal.core.SubcommandLauncher.run(SubcommandLauncher.java:601) at com.ibm.team.rtc.cli.infrastructure.internal.core.SubcommandLauncher.doStart(SubcommandLauncher.java:370) at com.ibm.team.rtc.cli.infrastructure.internal.core.SubcommandLauncher.run(SubcommandLauncher.java:130) at com.ibm.team.rtc.cli.infrastructure.internal.Application.start(Application.java:41) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575) at org.eclipse.equinox.launcher.Main.run(Main.java:1408) Caused by: java.io.IOException: The process cannot access the file because another process has locked a portion of the file at java.io.FileInputStream.read0(Native Method) at java.io.FileInputStream.read(Unknown Source) at org.eclipse.jgit.util.IO.readWholeStream(IO.java:216) at org.eclipse.jgit.treewalk.WorkingTreeIterator.possiblyFilteredInputStream(WorkingTreeIterator.java:384) at org.eclipse.jgit.treewalk.WorkingTreeIterator.getEntryContentLength(WorkingTreeIterator.java:559) at org.eclipse.jgit.api.AddCommand.call(AddCommand.java:226) ... 21 more Migration took [19] s

WtfJoke commented 6 years ago

Which version of eclipse did you use? Looks like a jgit issue.

himmakam commented 6 years ago

Hi, it was because of a different user access issue. Thanks for helping me out. I am closing this issue.

sarathkrishna2018 commented 6 years ago

@himmakam I guess I got the same issue. How did you solve it?

sushil2github commented 6 years ago

@himmakam - Could you please let me know that how did you resolve this issue, I am also getting the similar kind of issue. Please let me know if anyone here knows the resolution. Thank you.

sarathkrishna2018 commented 6 years ago

@sushil2github - When you run the configuration in eclipse, you need to pass parameters. In addition to that, you also need to give the sandbox location below that. By default it is C://System/Win32 as far as I remember. Change that to some location in C drive. And before you run it, also make sure you load your target workspace in that location ( You will get a "location is not shared - exception if you don't load ). After that you can run it.

sushil2github commented 6 years ago

Hi @sarathkrishna2018 , First of all, I am running the command in Command console i.e. cmd window, because, I was getting error 'Unknown subcommand' while running it in Eclipse configuration. I guess, passing parameters you mean, putting values for migration.properties, source and destination workspaces, etc in that command, is it correct ? Now if I am running the command from cmd, then where and how to give the sandbox location, which you are talking about ?

Before running the "scm migrate-to-git" command, I have run the "scm load" command which is mentioned in the link 'https://github.com/rtcTo/rtc2gitcli#usage'. This command has loaded the target workspace to my sandbox(I had given D:/ drive location at that time.) So are you talking about the same sandbox location ?

sarathkrishna2018 commented 6 years ago

@sushil2github - From what I understood, you've successfully loaded your target workspace to your D drive location. Now there is a piece of code in the tool which sets your sandbox to ( xxxxx.getUserDir()), which is NOT your D drive. There is where it's going wrong. The sandbox the code considers and the places where u loaded your target workspace should be same. I made it sure by changing the 'lanch configuration' the tool comes with. I don't know how it can be done through CMD. In the launch config, you can give the arguments in argument box. But the sandbox location can also be set. It basically asked u to browse to the location ( where u loaded the workspace ). Contact me on Facebook ( Sharath Madrox ) if you cannot understand what I said. I'll be happy to send you few screenshots which can explain what I'm trying to tell.

sushil2github commented 6 years ago

@sarathkrishna2018 - Got your point however I don't know how to achieve it using command prompt. Thank you for giving your facebook details, will connect with you. Please let me know the time you are available at.

sarathkrishna2018 commented 6 years ago

@sushil2github I'm available today.. You can ping me up at anytime.. :)

sushil2github commented 6 years ago

@sarathkrishna2018 - Sorry, couldn't connect with you that day. Will try to connect with you tomorrow in the evening. Let me know if you are available.

sushil2github commented 6 years ago

@sarathkrishna2018 , Could you please let me know one thing about the actual migration command below -

"scm migrate-to-git -r -u -P -m "

What would be the values for - uri - ? SOURCE_WORKSPACE - ? TARGET_WORKSPACE - ?

uri is for local git repository ? SOURCE_WORKSPACE which I loaded to my local sandbox ? TARGET_WORKSPACE is final git repository where I have to migrate the target workspace ?

Thank you.

sushil2github commented 6 years ago

@sarathkrishna2018 , Got values for my above question.

sarathkrishna2018 commented 6 years ago

Is it fine now? Because I think you've got the entire concept wrong.. it doesn't actually push to github.. it only converts the RTC Repository ( SOURCE_WORKSPACE) to a git repository which u can push later.. TARGET_WORKSPACE is used by the tool to capture history.. it's not related to github... And the URI is the URL of your RTC..

sushil2github commented 6 years ago

I know this, however as you know I got stuck at the actual migration command and facing exceptions, which is mentioned by himmakam in his first comment. Right now I am looking for its solution. I know that at the end once actual migration is successfull, then I have to push to Git repository. Himmakam has resolved this issue however, has not mentioned the resolution. He has just mentioned that it was a 'different user access issue', do you know what does it mean ?

sarathkrishna2018 commented 6 years ago

I literally got the same exception. The only thing I did to make it work was, setting sandbox to the folder where you loaded the TARGET_WORKSPACE. This solved the issue. But I did it through eclipse. May be, try running the tool in the folder where you loaded the TARGET_WORKSPACE itself??

sushil2github commented 6 years ago

Ok, will try to run. One question, do we have to make any changes in the 'migration.properties' file or we have to give its path as it is without any changes while running the actual command ?

sarathkrishna2018 commented 6 years ago

I don't remember exactly.. i guess I didn't change anything except giving it rtc username n password ( not sure ) and I uncommented one line to convert baselines into tags ( sure )... Except these, no changes were made.. one thing is for sure, this issue IS NOT RELATED to migration.properties

sushil2github commented 6 years ago

Ok. As you said, I ran the actual command in the sandbox location and Got the below output. [2018-07-26 23:46:20] ** BASELINE INFOS ** [2018-07-26 23:46:20] Start migration of tags. [2018-07-26 23:46:29] Start migration of Tag [HEAD] [1/1] [2018-07-26 23:46:29] Migration of tag [HEAD] [1/1] took [0] s [2018-07-26 23:46:29] Migration took [28] s

I don't know what happened at this point ?

sushil2github commented 6 years ago

1 .git folder is created at the sandbox location after running the actual migration command.

sarathkrishna2018 commented 6 years ago

I don't think it worked. It just ran, but I don't think it created the files required. I think. Just check for git log

sushil2github commented 6 years ago

This structure is created under .git folder image

sushil2github commented 6 years ago

and I don't see anything important under this Logs folder

sarathkrishna2018 commented 6 years ago

Yeah that's how .girl looks anyway inside.. go to the sandbox folder and do a 'git log' and see if you find any logs.. because I don't think it captured anything, it simply ran without error I guess

sushil2github commented 6 years ago

I ran the log, and it printed as below - D:\Migration>git log commit 0e4a91a03cdfa2ed51223832394706e69fdfe90a Author: RTC 2 git rtc2git@rtc.to Date: Thu Jul 26 18:16:21 2018 +0000

Initial commit
sarathkrishna2018 commented 6 years ago

It didn't work. Tomorrow, may be I'll try working this thing out with CMD.. meanwhile may be you can try using eclipse unless it cant be used for some reasons

sarathkrishna2018 commented 6 years ago

If you can use eclipse, may be contact me on Facebook or WhatsApp, so that I can help easily.

sushil2github commented 6 years ago

Okk, sure and will let you know the output. Is it because of RTC version ? I am using 5.0.2 RTC version.

sushil2github commented 6 years ago

Sure, will contact you tomorrow. Thank you.