yodamad / svn2git

Tool to help and automate migration from SVN to GitLab
Apache License 2.0
38 stars 12 forks source link

Exception in step LIST_REMOVED_FILES: Unexpected "(" #133

Closed vdebosse closed 3 years ago

vdebosse commented 3 years ago

During a migration from SVN to GITLAB I got this exception for one project (default settings, full history): `2021-07-06 21:45:08.483 ERROR 10197 --- [-git-Executor-1] f.y.svn2git.service.MigrationManager : Failed step : LIST_REMOVED_FILES

java.lang.RuntimeException: sh: 1: Syntax error: "(" unexpected

    at fr.yodamad.svn2git.io.Shell.execCommand(Shell.kt:94)
    at fr.yodamad.svn2git.io.Shell.execCommand$default(Shell.kt:69)
    at fr.yodamad.svn2git.service.Cleaner$listCleanedFiles$2.accept(Cleaner.kt:101)
    at fr.yodamad.svn2git.service.Cleaner$listCleanedFiles$2.accept(Cleaner.kt:44)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    at fr.yodamad.svn2git.service.Cleaner.listCleanedFiles(Cleaner.kt:96)
    at fr.yodamad.svn2git.service.Cleaner$$FastClassBySpringCGLIB$$6ac8d807.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
    at fr.yodamad.svn2git.aop.logging.LoggingAspect.logAround(LoggingAspect.java:85)
    at jdk.internal.reflect.GeneratedMethodAccessor311.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
    at fr.yodamad.svn2git.service.Cleaner$$EnhancerBySpringCGLIB$$8278cc1f.listCleanedFiles(<generated>)
    at fr.yodamad.svn2git.service.MigrationManager.startMigration(MigrationManager.kt:137)
    at fr.yodamad.svn2git.service.MigrationManager$$FastClassBySpringCGLIB$$7876d7ce.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor.lambda$createWrappedRunnable$1(ExceptionHandlingAsyncTaskExecutor.java:68)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

2021-07-06 21:45:08.485 INFO 10197 --- [-git-Executor-1] f.y.svn2git.service.HistoryManager : Finish step LIST_REMOVED_FILES with status FAILED in N/A`

If that matters, I got this warning in the previous step: 2021-07-06 21:44:11.945 INFO 10197 --- [-git-Executor-1] f.y.svn2git.service.HistoryManager : Start step BRANCH_CLEAN 2021-07-06 21:44:13.017 ERROR 10197 --- [-git-Executor-1] fr.yodamad.svn2git.service.Cleaner : Cannot remove : 20140903%20-%20Before%20merge%20with%20AH%20SVN%20(SOPRA_TMP) 2021-07-06 21:44:13.400 INFO 10197 --- [-git-Executor-1] f.y.svn2git.service.HistoryManager : Finish step BRANCH_CLEAN with status DONE_WITH_WARNINGS in 1s 455ms

Not sure what to investigate, I still have the temp folders in case.

yodamad commented 3 years ago

Hi @vdebosse

Thank for reporting. In fact, the problem is due to the '(' in the branch name.

I'll try to see if I can handle this use case, but in the meantime, if you can, rename the branch without the ( and it should work

vdebosse commented 3 years ago

Indeed it was a tag name with parenthesis that gave that warning (SOPRA_TMP), I have renamed it on SVN and it's better now. Thanks

vdebosse commented 3 years ago

Actually, removing the branch did not help, it still finds the old branch and fails when trying to clean it.

yodamad commented 3 years ago

Hi @vdebosse : should be fixed in 2.3.0