Uploaded image for project: 'Bitbucket Server'
  1. Bitbucket Server
  2. BSERV-7908

Backup Client (2.0.0) Fails With Symlinked Directories

    XMLWordPrintable

    Details

      Description

      Summary

      In Bitbucket Server Backup Client version 2.0.0 and later, if a directory in the home directory being backed up is a symbolic link, the backup will fail with the following error:

      ERROR [main] c.a.b.i.b.c.extensions.TarExtensions Error writing tar file entry: XXXXX (Is a directory)
      java.io.FileNotFoundException: XXXXX (Is a directory)
              at java.io.FileInputStream.open0(Native Method) ~[na:1.8.0_51]
              at java.io.FileInputStream.open(FileInputStream.java:195) ~[na:1.8.0_51]
              at java.io.FileInputStream.<init>(FileInputStream.java:138) ~[na:1.8.0_51]
              at com.atlassian.bitbucket.internal.backup.client.extensions.TarExtensions.withEntry(TarExtensions.groovy:24) ~[bitbucket-backup-core-2.0.0.jar:na]
              at com.atlassian.bitbucket.internal.backup.client.util.Profiler.measure(Profiler.groovy:20) [bitbucket-backup-core-2.0.0.jar:na]
              at com.atlassian.bitbucket.internal.backup.client.layout.DefaultApplicationHome.addFileEntries(DefaultApplicationHome.groovy:119) [bitbucket-backup-core-2.0.0.jar:na]
              at com.atlassian.bitbucket.internal.backup.client.layout.DefaultApplicationHome.archive(DefaultApplicationHome.groovy:103) [bitbucket-backup-core-2.0.0.jar:na]
              at com.atlassian.bitbucket.internal.backup.client.DefaultBackupClient.archiveHome(DefaultBackupClient.groovy:73) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.FixedRateProgressPublisher.publishWhileExecuting(FixedRateProgressPublisher.groovy:34) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.RestBitbucketService.backup(RestBitbucketService.groovy:67) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.RestBitbucketService.lock(RestBitbucketService.groovy:175) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.DefaultBackupClient.doBackup(DefaultBackupClient.groovy:52) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.extensions.StopwatchExtension.time(StopwatchExtension.groovy:11) [bitbucket-backup-core-2.0.0.jar:na]
              at com.atlassian.bitbucket.internal.backup.client.DefaultBackupClient.backup(DefaultBackupClient.groovy:39) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.spring.SpringMain.run(SpringMain.groovy:28) [bitbucket-backup-core-2.0.0.jar:na]
              at com.atlassian.bitbucket.internal.backup.client.spring.SpringMain.run(SpringMain.groovy) [bitbucket-backup-core-2.0.0.jar:na]
              at com.atlassian.bitbucket.internal.backup.client.BackupMain.main(BackupMain.groovy:39) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.JavaVersionCheckingShim.invokeClientClassMain(JavaVersionCheckingShim.java:71) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.JavaVersionCheckingShim.run(JavaVersionCheckingShim.java:85) [bitbucket-backup-client.jar:2.0.0]
              ... 203 frames suppressed
      

      Steps to Reproduce

      1. Move the data directory in <BITBUCKET_HOME>/shared/data to a symbolic link pointing to a different directory.
      2. Perform the backup.

      Expected Results

      The backup completes successfully.

      Actual Results

      The below error is thrown:

      ERROR [main] c.a.b.i.b.c.extensions.TarExtensions Error writing tar file entry: XXXXX (Is a directory)
      java.io.FileNotFoundException: XXXXX (Is a directory)
              at java.io.FileInputStream.open0(Native Method) ~[na:1.8.0_51]
              at java.io.FileInputStream.open(FileInputStream.java:195) ~[na:1.8.0_51]
              at java.io.FileInputStream.<init>(FileInputStream.java:138) ~[na:1.8.0_51]
              at com.atlassian.bitbucket.internal.backup.client.extensions.TarExtensions.withEntry(TarExtensions.groovy:24) ~[bitbucket-backup-core-2.0.0.jar:na]
              at com.atlassian.bitbucket.internal.backup.client.util.Profiler.measure(Profiler.groovy:20) [bitbucket-backup-core-2.0.0.jar:na]
              at com.atlassian.bitbucket.internal.backup.client.layout.DefaultApplicationHome.addFileEntries(DefaultApplicationHome.groovy:119) [bitbucket-backup-core-2.0.0.jar:na]
              at com.atlassian.bitbucket.internal.backup.client.layout.DefaultApplicationHome.archive(DefaultApplicationHome.groovy:103) [bitbucket-backup-core-2.0.0.jar:na]
              at com.atlassian.bitbucket.internal.backup.client.DefaultBackupClient.archiveHome(DefaultBackupClient.groovy:73) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.FixedRateProgressPublisher.publishWhileExecuting(FixedRateProgressPublisher.groovy:34) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.RestBitbucketService.backup(RestBitbucketService.groovy:67) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.RestBitbucketService.lock(RestBitbucketService.groovy:175) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.DefaultBackupClient.doBackup(DefaultBackupClient.groovy:52) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.extensions.StopwatchExtension.time(StopwatchExtension.groovy:11) [bitbucket-backup-core-2.0.0.jar:na]
              at com.atlassian.bitbucket.internal.backup.client.DefaultBackupClient.backup(DefaultBackupClient.groovy:39) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.spring.SpringMain.run(SpringMain.groovy:28) [bitbucket-backup-core-2.0.0.jar:na]
              at com.atlassian.bitbucket.internal.backup.client.spring.SpringMain.run(SpringMain.groovy) [bitbucket-backup-core-2.0.0.jar:na]
              at com.atlassian.bitbucket.internal.backup.client.BackupMain.main(BackupMain.groovy:39) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.JavaVersionCheckingShim.invokeClientClassMain(JavaVersionCheckingShim.java:71) [bitbucket-backup-client.jar:2.0.0]
              at com.atlassian.bitbucket.internal.backup.client.JavaVersionCheckingShim.run(JavaVersionCheckingShim.java:85) [bitbucket-backup-client.jar:2.0.0]
              ... 203 frames suppressed
      

      Workaround

      Remove the symbolic link and have the folder in the shared directory.

        Attachments

          Activity

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: