christianspecht / scm-backup

Makes offline backups of your cloud hosted source code repositories
https://scm-backup.org/
GNU General Public License v3.0
61 stars 20 forks source link

Fetch error after 256 repos #66

Open si-hb opened 2 years ago

si-hb commented 2 years ago

Running SCM backup on our bitbucket cloud instance fails before getting halfway through. Interestingly I noted that the number of successfully fetched repos is exactly 256.

Here's the error:

2022-03-28 15:32:19.7931|ERROR|ScmBackup|fatal: protocol error: unexpected 'Error running git: fork/exec /usr/bin/git-upload-pack: no such file or directory'

2022-03-28 15:32:19.7931|ERROR|ScmBackup|Backup failed! 
2022-03-28 15:32:19.7931|ERROR|ScmBackup|The application will close in 5 seconds! 
christianspecht commented 2 years ago

Hmm...this exact error message was already reported multiple times (#57, #58), and one user even had something similar where the error always occured after 250 repos: #33

Always with Bitbucket, but unfortunately I wasn't able to reproduce or fix it yet.

si-hb commented 2 years ago

Solved...

SCM fails when it hits a completely empty repo. Deleted the repo in Bitbucket and haved backed up all repos now, thank you.

If I may recommend, perhaps clearer context in the log entries would help pinpoint the suspect repo causing the failure. The log entry where it fails does not indicate the repo that caused the failure, and I had assumed that prior log entries were representative of only a successful clone. Ideally, 'Cloning...' and 'Cloned/success' entries would provide better debug tracing imo.

christianspecht commented 2 years ago

Do you remember how exactly you created that empty repo?
I'm still not able to reproduce this.

I create a new empty repo in one of my workspaces and select the options NOT to create a readme/.gitignore:

create

The result does look empty:

empty

But the backup works without errors:

2022-04-28 19:45:22.4233|INFO|ScmBackup|SCM Backup 0.0.0-DEV 2022-04-28 19:45:22.4695|INFO|ScmBackup|https://scm-backup.org/ 2022-04-28 19:45:22.4695|INFO|ScmBackup|Operating system: Microsoft Windows 10.0.19043 2022-04-28 19:45:22.6483|INFO|ScmBackup|Backing up config files 2022-04-28 19:45:22.6483|INFO|ScmBackup|Getting repositories for source 'emptytest' from hoster 'bitbucket' 2022-04-28 19:45:23.7068|INFO|ScmBackup|Trying to find SCMs on this machine... 2022-04-28 19:45:23.8562|INFO|ScmBackup|Found Git 2.31.1.windows.1
2022-04-28 19:45:23.8562|INFO|ScmBackup|Backing up source: emptytest 2022-04-28 19:45:27.4320|INFO|ScmBackup| Git: https://bitbucket.org/MYWORKSPACE/empty-test.git 2022-04-28 19:45:28.8071|INFO|ScmBackup| Git: https://bitbucket.org/MYWORKSPACE/testrepo1.git 2022-04-28 19:45:30.5103|INFO|ScmBackup|Backup finished! 2022-04-28 19:45:30.5103|INFO|ScmBackup|The backups are in this directory: c:\scm-backup

si-hb commented 2 years ago

Unfortunately no. The empty repo was likely created unintentionally by one of our staff many years ago.