AkashRajpurohit / git-sync

🔄 A simple tool to backup and sync your git repositories
https://github.com/AkashRajpurohit/git-sync/wiki
MIT License
113 stars 5 forks source link

Error while cloning repositories #29

Open aeonSolutions opened 3 weeks ago

aeonSolutions commented 3 weeks ago

Describe the Bug

see log below

Steps to reproduce

executed the exe file

Relevant log output

{"level":"fatal","time":"2024-08-22T09:05:22.567+0100","message":"Error cloning repo aeonSolutions/AeonLabs-AeonLabs-HomeAutomation-Distributed-power_storage-Selectable-USB-DC-power-outlet: exit status 128\n","stacktrace":"github.com/AkashRajpurohit/git-sync/pkg/logger.Fatalf\n\t/home/runner/work/git-sync/git-sync/pkg/logger/logger.go:96\ngithub.com/AkashRajpurohit/git-sync/pkg/sync.CloneOrUpdateRepo\n\t/home/runner/work/git-sync/git-sync/pkg/sync/sync.go:28\ngithub.com/AkashRajpurohit/git-sync/pkg/github.GitHubClient.Sync.func1\n\t/home/runner/work/git-sync/git-sync/pkg/github/github.go:51"}

Which browser are you using? (if relevant)

no relevant

AkashRajpurohit commented 3 weeks ago

Seems like it is not able to clone the repository, can you check for few things

  1. Is this a private repository?
  2. Are you able to clone the repository directly using the git command?
  3. Does the access token have correct permissions?
aeonSolutions commented 3 weeks ago

Is this a private repository? No. Are you able to clone the repository directly using the git command? Yes. Does the access token have correct permissions? Yes

AkashRajpurohit commented 3 weeks ago

The current set of debug logs won't be helpful, can you download the v0.8.2 version and run the git-sync command again with log level set to debug --log-level=debug

aeonSolutions commented 3 weeks ago

ok. so i did what you asked. here's output where the errors occur:

{"level":"info","time":"2024-08-23T07:55:10.831+0100","message":"Updating repo: aeonSolutions/-openScienceResearch-12bit-LCD-1.69-TFT-Smart-DAQ-Device-with-unique-data-fingerprint"}
{"level":"debug","time":"2024-08-23T07:55:11.014+0100","message":"Output: fatal: not a git repository: '\\aeonSolutions\\WebCoder-Multi-Platform-Framework\\WebCoder-Multi-Platform-Framework.git'\n\n"}
{"level":"fatal","time":"2024-08-23T07:55:11.017+0100","message":"Error updating repo aeonSolutions/WebCoder-Multi-Platform-Framework: exit status 128\n","stacktrace":"github.com/AkashRajpurohit/git-sync/pkg/logger.Fatalf\n\t/home/runner/work/git-sync/git-sync/pkg/logger/logger.go:96\ngithub.com/AkashRajpurohit/git-sync/pkg/sync.CloneOrUpdateRepo\n\t/home/runner/work/git-sync/git-sync/pkg/sync/sync.go:39\ngithub.com/AkashRajpurohit/git-sync/pkg/github.GitHubClient.Sync.func1\n\t/home/runner/work/git-sync/git-sync/pkg/github/github.go:51"}
AkashRajpurohit commented 3 weeks ago

This is a Windows system, right? I never tested git-sync on Windows, so I might have to do it if I get a chance. Meanwhile, can you share your config file (excluding the access token details)?

aeonSolutions commented 3 weeks ago

Yes. I'm running windows 11. My config file :

backup_dir: \
cron: ""
exclude_orgs: []
exclude_repos: []
include_forks: false
include_orgs: []
include_repos: []
include_wiki: true
platform: github
server:
    domain: github.com
    protocol: https
token: ""
username: ""
workspace: ""
AkashRajpurohit commented 3 weeks ago

Can you update the backup_dir to be a valid path on your file system and re-run the program once?

aeonSolutions commented 3 weeks ago

the backup path is not the issue. As it created folders and subfolder in the root of the disk drive

AkashRajpurohit commented 3 weeks ago

Can you navigate to this path \\aeonSolutions\\WebCoder-Multi-Platform-Framework\\WebCoder-Multi-Platform-Framework.git and do git status or git log to see what the output is? Strange that from the logs it shows that it is not a git repository.

aeonSolutions commented 3 weeks ago

that repository is located here: https://github.com/aeonSolutions/WebCoder-Multi-Platform-Framework

here's the output image

AkashRajpurohit commented 2 weeks ago

Not this, the path specified in the log shows \\aeonSolutions\\WebCoder-Multi-Platform-Framework\\WebCoder-Multi-Platform-Framework.git, can you cd into this path and then type git status command.

aeonSolutions commented 2 weeks ago

here it is

image

AkashRajpurohit commented 2 weeks ago

Yeah so git-sync is throwing back the same error seen here, what are the contents of this folder, if you do ls -al you can see the contents, is it a bare repository?

aeonSolutions commented 2 weeks ago

i did a git-sync again and now the error is on another repository image

aeonSolutions commented 2 weeks ago

Here's the output of "dir /s"

D:\aeonSolutions\WebCoder-Multi-Platform-Framework>dir /s
 Volume in drive D is New Volume
 Volume Serial Number is D8FA-B0D9

 Directory of D:\aeonSolutions\WebCoder-Multi-Platform-Framework

08/23/2024  03:10 PM    <DIR>          .
08/23/2024  03:10 PM    <DIR>          ..
08/23/2024  03:10 PM    <DIR>          WebCoder-Multi-Platform-Framework.git
               0 File(s)              0 bytes

 Directory of D:\aeonSolutions\WebCoder-Multi-Platform-Framework\WebCoder-Multi-Platform-Framework.git

08/23/2024  03:10 PM    <DIR>          .
08/23/2024  03:10 PM    <DIR>          ..
08/23/2024  03:10 PM               260 config
08/23/2024  03:10 PM                73 description
08/23/2024  03:10 PM    <DIR>          hooks
08/23/2024  03:10 PM    <DIR>          info
08/23/2024  03:10 PM    <DIR>          objects
               2 File(s)            333 bytes

 Directory of D:\aeonSolutions\WebCoder-Multi-Platform-Framework\WebCoder-Multi-Platform-Framework.git\hooks

08/23/2024  03:10 PM    <DIR>          .
08/23/2024  03:10 PM    <DIR>          ..
08/23/2024  03:10 PM               478 applypatch-msg.sample
08/23/2024  03:10 PM               896 commit-msg.sample
08/23/2024  03:10 PM             4,726 fsmonitor-watchman.sample
08/23/2024  03:10 PM               189 post-update.sample
08/23/2024  03:10 PM               424 pre-applypatch.sample
08/23/2024  03:10 PM             1,649 pre-commit.sample
08/23/2024  03:10 PM               416 pre-merge-commit.sample
08/23/2024  03:10 PM             1,374 pre-push.sample
08/23/2024  03:10 PM             4,898 pre-rebase.sample
08/23/2024  03:10 PM               544 pre-receive.sample
08/23/2024  03:10 PM             1,492 prepare-commit-msg.sample
08/23/2024  03:10 PM             2,783 push-to-checkout.sample
08/23/2024  03:10 PM             2,308 sendemail-validate.sample
08/23/2024  03:10 PM             3,650 update.sample
              14 File(s)         25,827 bytes

 Directory of D:\aeonSolutions\WebCoder-Multi-Platform-Framework\WebCoder-Multi-Platform-Framework.git\info

08/23/2024  03:10 PM    <DIR>          .
08/23/2024  03:10 PM    <DIR>          ..
08/23/2024  03:10 PM               240 exclude
               1 File(s)            240 bytes

 Directory of D:\aeonSolutions\WebCoder-Multi-Platform-Framework\WebCoder-Multi-Platform-Framework.git\objects

08/23/2024  03:10 PM    <DIR>          .
08/23/2024  03:10 PM    <DIR>          ..
08/23/2024  03:10 PM    <DIR>          info
08/23/2024  03:10 PM    <DIR>          pack
               0 File(s)              0 bytes

 Directory of D:\aeonSolutions\WebCoder-Multi-Platform-Framework\WebCoder-Multi-Platform-Framework.git\objects\info

08/23/2024  03:10 PM    <DIR>          .
08/23/2024  03:10 PM    <DIR>          ..
               0 File(s)              0 bytes

 Directory of D:\aeonSolutions\WebCoder-Multi-Platform-Framework\WebCoder-Multi-Platform-Framework.git\objects\pack

08/23/2024  03:10 PM    <DIR>          .
08/23/2024  03:10 PM    <DIR>          ..
               0 File(s)              0 bytes

     Total Files Listed:
              17 File(s)         26,400 bytes
              20 Dir(s)  429,329,657,856 bytes free

D:\aeonSolutions\WebCoder-Multi-Platform-Framework>
AkashRajpurohit commented 2 weeks ago

i did a git-sync again and now the error is on another repository image

Can you run this with --log-level=debug so we can get some additional logs about the error output.