Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Push doesn't work after stash-backup-client failure

Thomas Bores August 17, 2014

Hello,

I tried to used the stash-backup-client as described in the official documentation to backup my stash instance running on a Windows Server 2008.

Unfortunately the tool doens't work and now all the git repositories are affected by the same error: push failure:

git push origin feature/CompanyStruct
remote: "c:/Program Files (x86)/Git/bin/env.exe": hooks/pre-receive: No such file or directory
To http://stash:7990/scm/cc/fleetmanager.git
 ! [remote rejected] feature/CompanyStruct -> feature/CompanyStruct (pre-receive hook declined)
error: failed to push some refs to 'http://stash:7990/scm/cc/fleetmanager.git'

And as the backup-client failed I have no backups...

What should I do?! 50 developers are affected by this issue.

Here the log of the stash-backup-client:

2014-08-15 10:04:49,495 INFO  [main] c.a.s.i.b.client.spring.SpringMain Initializing
2014-08-15 10:04:50,920 INFO  [main] c.a.s.i.b.client.DefaultBackupClient Contacting Stash
2014-08-15 10:04:54,574 INFO  [main] c.a.s.i.b.client.RestStashService Using Stash 3.2.0
2014-08-15 10:04:54,890 INFO  [main] c.a.s.i.b.client.RestStashService Stash has been locked for maintenance. It may be unlocked with token: 8c9becced40b0a5b5f20a910c31af06e33207757
2014-08-15 10:04:55,131 INFO  [main] c.a.s.i.b.client.RestStashService Starting database backup on Stash. It may be cancelled with token: 873c2e10864064fcc4966b865af7fcfaf76e9b46
2014-08-15 10:04:56,886 INFO  [main] c.a.s.i.b.c.layout.DefaultStashHome Verifying Stash home
2014-08-15 10:04:59,107 INFO  [main] c.a.s.i.b.c.layout.DefaultStashHome Verifying Stash home
2014-08-15 10:05:01,330 INFO  [main] c.a.s.i.b.c.layout.DefaultStashHome Verifying Stash home
2014-08-15 10:05:05,827 INFO  [main] c.a.s.i.b.c.layout.DefaultStashHome Backing up Stash home
2014-08-15 10:05:05,894 ERROR [main] c.a.s.i.b.c.extensions.TarExtensions Error writing tar file entry: The process cannot access the file because another process has locked a portion of the file
java.io.IOException: The process cannot access the file because another process has locked a portion of the file
	at java.io.FileInputStream.readBytes(Native Method) ~[na:1.7.0_45]
	at java.io.FileInputStream.read(FileInputStream.java:272) ~[na:1.7.0_45]
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) ~[na:1.7.0_45]
	at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) ~[na:1.7.0_45]
	at java.io.BufferedInputStream.read(BufferedInputStream.java:334) ~[na:1.7.0_45]
	at com.atlassian.stash.internal.backup.client.extensions.TarExtensions.withEntry(TarExtensions.groovy:24) ~[stash-backup-core-1.3.0.jar:na]
	at com.atlassian.stash.internal.backup.client.layout.DefaultStashHome.archive(DefaultStashHome.groovy:93) [stash-backup-core-1.3.0.jar:na]
	at com.atlassian.stash.internal.backup.client.DefaultBackupClient.archiveHome(DefaultBackupClient.groovy:82) [stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.FixedRateProgressPublisher.publishWhileExecuting(FixedRateProgressPublisher.groovy:34) [stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.RestStashService.backup(RestStashService.groovy:66) [stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.RestStashService.lock(RestStashService.groovy:174) [stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.DefaultBackupClient.backup(DefaultBackupClient.groovy:50) [stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.spring.SpringMain.run(SpringMain.groovy:28) [stash-backup-core-1.3.0.jar:na]
	at com.atlassian.stash.internal.backup.client.spring.SpringMain.run(SpringMain.groovy) [stash-backup-core-1.3.0.jar:na]
	at com.atlassian.stash.internal.backup.client.BackupMain.main(BackupMain.groovy:38) [stash-backup-client.jar:1.3.0]
	... 156 frames suppressed
2014-08-15 10:05:06,072 ERROR [main] c.a.s.i.b.c.extensions.TarExtensions Failed to close tar file entry: entry 'shared/.lock' closed at '0' before the '17' bytes specified in the header were written
java.io.IOException: entry 'shared/.lock' closed at '0' before the '17' bytes specified in the header were written
	at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.closeArchiveEntry(TarArchiveOutputStream.java:363) ~[commons-compress-1.5.jar:1.5]
	at com.atlassian.stash.internal.backup.client.extensions.TarExtensions.withEntry(TarExtensions.groovy:31) ~[stash-backup-core-1.3.0.jar:na]
	at com.atlassian.stash.internal.backup.client.layout.DefaultStashHome.archive(DefaultStashHome.groovy:93) [stash-backup-core-1.3.0.jar:na]
	at com.atlassian.stash.internal.backup.client.DefaultBackupClient.archiveHome(DefaultBackupClient.groovy:82) [stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.FixedRateProgressPublisher.publishWhileExecuting(FixedRateProgressPublisher.groovy:34) [stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.RestStashService.backup(RestStashService.groovy:66) [stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.RestStashService.lock(RestStashService.groovy:174) [stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.DefaultBackupClient.backup(DefaultBackupClient.groovy:50) [stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.spring.SpringMain.run(SpringMain.groovy:28) [stash-backup-core-1.3.0.jar:na]
	at com.atlassian.stash.internal.backup.client.spring.SpringMain.run(SpringMain.groovy) [stash-backup-core-1.3.0.jar:na]
	at com.atlassian.stash.internal.backup.client.BackupMain.main(BackupMain.groovy:38) [stash-backup-client.jar:1.3.0]
	... 129 frames suppressed
2014-08-15 10:05:06,076 ERROR [main] c.a.s.i.b.c.layout.DefaultStashHome c:\opt\stash\home\shared\.lock could not be read
2014-08-15 10:05:06,100 INFO  [main] c.a.s.i.b.client.RestStashService Cancelling database backup with code: 873c2e10864064fcc4966b865af7fcfaf76e9b46
2014-08-15 10:05:06,169 INFO  [main] c.a.s.i.b.client.RestStashService Unlocking Stash using token: 8c9becced40b0a5b5f20a910c31af06e33207757
2014-08-15 10:05:06,200 ERROR [main] c.a.s.i.backup.client.BackupMain A backup could not be created. Reason: The process cannot access the file because another process has locked a portion of the file
java.io.IOException: The process cannot access the file because another process has locked a portion of the file
	at java.io.FileInputStream.readBytes(Native Method) ~[na:1.7.0_45]
	at java.io.FileInputStream.read(FileInputStream.java:272) ~[na:1.7.0_45]
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) ~[na:1.7.0_45]
	at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) ~[na:1.7.0_45]
	at java.io.BufferedInputStream.read(BufferedInputStream.java:334) ~[na:1.7.0_45]
	at com.atlassian.stash.internal.backup.client.extensions.TarExtensions.withEntry(TarExtensions.groovy:24) ~[stash-backup-core-1.3.0.jar:na]
	at com.atlassian.stash.internal.backup.client.layout.DefaultStashHome.archive(DefaultStashHome.groovy:93) ~[stash-backup-core-1.3.0.jar:na]
	at com.atlassian.stash.internal.backup.client.DefaultBackupClient.archiveHome(DefaultBackupClient.groovy:82) ~[stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.FixedRateProgressPublisher.publishWhileExecuting(FixedRateProgressPublisher.groovy:34) ~[stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.RestStashService.backup(RestStashService.groovy:66) ~[stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.RestStashService.lock(RestStashService.groovy:174) ~[stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.DefaultBackupClient.backup(DefaultBackupClient.groovy:50) ~[stash-backup-client.jar:1.3.0]
	at com.atlassian.stash.internal.backup.client.spring.SpringMain.run(SpringMain.groovy:28) [stash-backup-core-1.3.0.jar:na]
	at com.atlassian.stash.internal.backup.client.spring.SpringMain.run(SpringMain.groovy) [stash-backup-core-1.3.0.jar:na]
	at com.atlassian.stash.internal.backup.client.BackupMain.main(BackupMain.groovy:38) [stash-backup-client.jar:1.3.0]
	... 156 frames suppressed

2 answers

1 accepted

0 votes
Answer accepted
Thomas Bores August 24, 2014

Ok. I get support from Atlassian. A restart of the server made Stash working correctly.

I had the following properties:

stash.home.excludes=**/.lock

to the backup-config.properties of the stash-backup-client to make it work.

0 votes
Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 17, 2014

Hi Thomas,

Please open a support request on https://support.atlassian.comso our support engineers can help you resolve the problem.

Cheers,

Michael

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events