XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Affects Version/s: 7.15.5
    • Fix Version/s: 7.27.3
    • Component/s: Artifactory
    • Labels:
      None
    • Environment:

      Windows

    • Location:
      External

      Description

      Problem description: The Cargo repository is broken after performing a re-indexing of the repository, e.g., fails to publish.

      What is the expected behavior? Recalculates the Cargo packages and release metadata for this repository.

      Steps to reproduce: (OS - Windows)

      • Experiment 1:
      1. Create a new repository “cargo-sandbox-local”
      2. Publish a Cargo crate in version 0.1.0
      3. Pull the above 0.1.0 Crate
      4. Click on Recalculate Index in Artifactory
      5. Publish a Crate → Fails
           2021-06-15T08:54:54.831Z [jfrt ] [INFO ] [4503829e31c50530] [o.a.a.g.GitServiceImpl:542    ] [art-exec-4          ] - Deleting git repository for: cargo-sandbox-local
         2021-06-15T08:54:54.864Z [jfrt ] [WARN ] [4503829e31c50530] [o.a.a.g.GitServiceImpl:602    ] [art-exec-4          ] - Couldn't delete folder C:\jfrog\artifactory\var\data\artifactory\git\cargo-sandbox-local.git
         org.apache.commons.io.IOExceptionList: 1 exceptions: [java.io.IOException: Unable to delete file: C:\jfrog\artifactory\var\data\artifactory\git\cargo-sandbox-local.git\.git]
             at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:345)
             at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1206 
      cargo publish --dry-run --token Bearer ****
               Updating `https://<artifactory-url>/artifactory/git/cargo-sandbox-local.git` index
         error: failed to update registry `https://<artifactory-url>/artifactory/git/cargo-sandbox-local.git`
        
         Caused by:
        
           failed to fetch `https://<artifactory-url>/artifactory/git/cargo-sandbox-local.git`
        
         Caused by:
        
           process didn't exit successfully: `git fetch --force --update-head-ok 'https://<artifactory-url>/artifactory/git/cargo-sandbox-local.git' 'refs/heads/master:refs/remotes/origin/master' 'HEAD:refs/remotes/origin/HEAD'` (exit code: 128)
        
           --- stderr
           fatal: Couldn't find remote ref refs/heads/master
         script returned exit code 101
      • Experiment 2:
      1. Create a new Cargo repository
      2. Click on Recalculate Index in Artifactory
      2021-06-15T08:17:14.886Z [jfrt ] [INFO ] [d637c385743f43f3] [o.a.a.c.CargoAddonImpl:70 ] [art-exec-6 ] - Reindexing repository cargo-sandbox-local
      2021-06-15T08:17:14.886Z [jfrt ] [INFO ] [e52030fe0bda5d8 ] [t.a.RecalculateIndexService:63] [7.0.0.1-8040-exec-20] - Recalculating index for repository cargo-sandbox-local scheduled to run
      2021-06-15T08:17:14.899Z [jfrt ] [INFO ] [d637c385743f43f3] [o.a.a.g.GitServiceImpl:542 ] [art-exec-6 ] - Deleting git repository for: cargo-sandbox-local
      2021-06-15T08:17:14.927Z [jfrt ] [WARN ] [d637c385743f43f3] [o.a.a.g.GitServiceImpl:602 ] [art-exec-6 ] - Couldn't delete folder C:\jfrog\artifactory\var\data\artifactory\git\cargo-sandbox-local.git
      org.apache.commons.io.IOExceptionList: 1 exceptions: [java.io.IOException: Unable to delete file: C:\jfrog\artifactory\var\data\artifactory\git\cargo-sandbox-local.git\.git]
      at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:345)
      at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1206)
      at org.artifactory.addon.git.GitServiceImpl.deleteDirectoryQuietly(GitServiceImpl.java:600)
      at org.artifactory.addon.git.GitServiceImpl.deleteRepository(GitServiceImpl.java:551)
      at org.artifactory.addon.git.GitServiceImpl.deleteRepositorySync(GitServiceImpl.java:561)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      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.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:205)
      at com.sun.proxy.$Proxy275.deleteRepositorySync(Unknown Source)
      at org.artifactory.addon.git.GitAddonImpl.deleteGitRepository(GitAddonImpl.java:52)
      at org.artifactory.addon.cargo.CargoAddonImpl.reindex(CargoAddonImpl.java:77)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      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.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      at org.artifactory.schedule.aop.TraceableMethodInvocation.proceed(TraceableMethodInvocation.java:72)
      at org.artifactory.schedule.aop.AsyncAdvice.doInvoke(AsyncAdvice.java:334)
      at org.artifactory.schedule.aop.AsyncAdvice.lambda$submit$2(AsyncAdvice.java:285)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at org.artifactory.opentracing.TraceableRunnableDecorator.run(TraceableRunnableDecorator.java:32)
      at org.artifactory.concurrent.ArtifactoryRunnable.run(ArtifactoryRunnable.java:53)
      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)
      Caused by: java.io.IOException: Unable to delete file: C:\jfrog\artifactory\var\data\artifactory\git\cargo-sandbox-local.git\.git
      at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1425)
      at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:338)
      ... 29 common frames omitted
      Caused by: java.nio.file.AccessDeniedException: C:\jfrog\artifactory\var\data\artifactory\git\cargo-sandbox-local.git\.git\objects\06\ffd198a220cee03b6ff1a3fb67991ee86c7c03
      at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
      at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
      at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
      at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:274)
      at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110)
      at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181)
      at org.apache.commons.io.file.DeletingPathVisitor.visitFile(DeletingPathVisitor.java:142)
      at org.apache.commons.io.file.DeletingPathVisitor.visitFile(DeletingPathVisitor.java:36)
      at java.base/java.nio.file.Files.walkFileTree(Files.java:2725)
      at java.base/java.nio.file.Files.walkFileTree(Files.java:2797)
      at org.apache.commons.io.file.PathUtils.visitFileTree(PathUtils.java:687)
      at org.apache.commons.io.file.PathUtils.deleteDirectory(PathUtils.java:328)
      at org.apache.commons.io.file.PathUtils.delete(PathUtils.java:303)
      at org.apache.commons.io.file.PathUtils.delete(PathUtils.java:280)
      at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:1423)
      ... 30 common frames omitted
      2021-06-15T08:17:14.944Z [jfrt ] [INFO ] [d637c385743f43f3] [o.a.a.g.GitServiceImpl:553 ] [art-exec-6 ] - Git repository deletion successful for:cargo-sandbox-local
      2021-06-15T08:17:15.088Z [jfrt ] [INFO ] [d637c385743f43f3] [o.a.a.g.GitServiceImpl:132 ] [art-exec-6 ] - Initializing git repository for: cargo-sandbox-local
      2021-06-15T08:17:15.148Z [jfrt ] [INFO ] [d637c385743f43f3] [o.a.a.g.GitServiceImpl:140 ] [art-exec-6 ] - Git repository initialization successful for: cargo-sandbox-local
      2021-06-15T08:17:15.151Z [jfrt ] [INFO ] [d637c385743f43f3] [o.a.a.c.CargoAddonImpl:86 ] [art-exec-6 ] - Finished reindexing repository cargo-sandbox-local * 

       

      Possible workaround: Deleting the .git folder that exists for each Cargo repository manually

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              fadir Fadi Rouhana
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Sync Status

                  Connection: RTFACT Sync
                  RTMID-26101 -
                  SYNCHRONIZED
                  • Last Sync Date: