Borg: cygwin: cannot recognize remote repository

Created on 6 Jun 2017  Â·  18Comments  Â·  Source: borgbackup/borg

$ borg -V
borg 1.0.10

$ borg check ${BORG_REPO} --debug
using builtin fallback logging configuration
SSH command line: ['ssh', '-p', '9443', '[email protected]', 'borg', 'serve', '--umask=077', '--debug']
Local Exception.
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/borg/archiver.py", line 2089, in main
    exit_code = archiver.run(args)
  File "/usr/lib/python3.6/site-packages/borg/archiver.py", line 2025, in run
    return func(args)
  File "/usr/lib/python3.6/site-packages/borg/archiver.py", line 78, in wrapper
    lock_wait=self.lock_wait, lock=lock, append_only=append_only, args=args)
  File "/usr/lib/python3.6/site-packages/borg/remote.py", line 233, in __init__
    version = self.call('negotiate', RPC_PROTOCOL_VERSION)
  File "/usr/lib/python3.6/site-packages/borg/remote.py", line 321, in call
    for resp in self.call_many(cmd, [args], **kw):
  File "/usr/lib/python3.6/site-packages/borg/remote.py", line 373, in call_many
    raise Exception('FD exception occurred')
Exception: FD exception occurred

Platform: CYGWIN_NT-6.1 2.8.0(0.309/5/3) 2017-04-01 20:47 x86_64
Borg: 1.0.10  Python: CPython 3.6.1
PID: 1512  CWD: /home/user
sys.argv: ['/usr/bin/borg', 'check', 'ssh://[email protected]:9443/home/col/borg_backup_repo', '--debug']
SSH_ORIGINAL_COMMAND: None
invalid windows question

Most helpful comment

I get the same _Exception: FD exception occurred_ error and it seems that I my case it is a PATH issue on my nas. Adding a remote path parameter fixes it.

I noticed it only because in WSL (Windows Subsystem for Linux) I get this (correct) warning:

Remote: sh: borg: command not found
Connection closed by remote host. Is borg working on the server?

So try using borg like:
borg list --remote-path /usr/local/bin/borg ssh://user@synology:22/volume1/Backups/BackupBorg

Maybe this Info is helpfull for others

All 18 comments

No ssh installed?

@enkore @infectormp I'm running the borg in Cygwin with latest stable build 1.0.10. It works perfect for local repositories (I had successfully managed to tame the windows backup specific issue like shadowing) use but fails at the beginning for remote repositories.

The passwordless ssh already setup for Cygwin to remote Debian borg server (1.0.9 not 1.0.10). I already successfully perform backup with Virtualbox guest debian host by the same PC as Cygwin.

I know currently every few people on Cygwin use borg. I want to take full advantage of this amazing tool, it's pity to see developers set lower priority for windows support. Losing windows users base / lacking cross platform support could let borg be out of main stream user's choice.

@moralrebuild borg was long time broken for remote repos on cygwin, due to a bug in cygwin. Make sure you have latest cygwin release (if not even dev snapshot) - they fixed it a few months ago.

Update: Hmm, we have also added a workaround in borg, so fix in cygwin should not be required.

Here is the failed logs occurred at the initialization step:

$ borg init ${BORG_REPO} --debug
using builtin fallback logging configuration
SSH command line: ['ssh', '-p', '9443', '[email protected]', 'borg', 'serve', '--umask=077', '--debug']
Local Exception.
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/borg/archiver.py", line 2089, in main
exit_code = archiver.run(args)
File "/usr/lib/python3.6/site-packages/borg/archiver.py", line 2025, in run
return func(args)
File "/usr/lib/python3.6/site-packages/borg/archiver.py", line 78, in wrapper
lock_wait=self.lock_wait, lock=lock, append_only=append_only, args=args)
File "/usr/lib/python3.6/site-packages/borg/remote.py", line 233, in __init__
version = self.call('negotiate', RPC_PROTOCOL_VERSION)
File "/usr/lib/python3.6/site-packages/borg/remote.py", line 321, in call
for resp in self.call_many(cmd, [args], **kw):
File "/usr/lib/python3.6/site-packages/borg/remote.py", line 373, in call_many
raise Exception('FD exception occurred')
Exception: FD exception occurred

Platform: CYGWIN_NT-6.1 2.8.0(0.309/5/3) 2017-04-01 20:47 x86_64
Borg: 1.0.10 Python: CPython 3.6.1
PID: 3840 CWD: /home/user
sys.argv: ['/usr/bin/borg', 'init', 'ssh://[email protected]:9443/home/col/borg_backup_repo', '--debug']
SSH_ORIGINAL_COMMAND: None

@ThomasWaldmann Thanks for your reminding, I'll reinstall the Cygwin to see if any difference.

it's pity to see developers set lower priority for windows support. Losing windows users base / lacking cross platform support could let borg be out of main stream user's choice.

A native port exists (see windows branch) but is alpha quality and not currently pushed ahead by anyone (kudos to @Anakonda who put a lot of work into it).

None of the main developers (i.e. textshell, me and Thomas) are frequent Windows users. I'm the only one of these three people who has _any_ Windows development experience (and it's rather dated by now - Windows XP era).

If you want good Windows support, send patches, talk to Windows developers that may be interested in doing patches, or put bounties on Windows tickets (or convince someone else to put bounties on them).

If i recall correctly ssh didn't work at all before latest patch to windows branch, not sure about cygwin build.

I personally don't have a need for borg. I first got in touch with borg by a friend who said I should do windows port (he does not use windows)
I've got the impression there isn't much people intrested in proper windows port, I might be wrong.

I have reinstalled the Cygwin as well as the borg with the latest stable release, but no joy. Now I'm pretty sure the remote repositories has never been tested under Cygwin.

$ uname -a
CYGWIN_NT-6.1 SHIJIANG-CN 2.8.0(0.309/5/3) 2017-04-01 20:47 x86_64 Cygwin
$ borg -V
borg 1.0.10

It did work, at least in the past, otherwise stuff like #1268 would not have been discovered.

I justed booted my win10 VM and will check borg 1.0.10 under cygwin now...

First step is to run the unit tests...

  • python 3.4.5 cygwin, cygwin 2.6.1, borg 1.0-maint branch tip 3a5ae8
  • needed to remove requirements.d/fuse.txt from tox.ini (no fuse support under cygwin)
  • 1.0-maint tests "as is" (tox -e py34, no remote testing) work, 448 passed, 190 skipped, 0 failed
  • but there was still the py.test.skip for cygwin for the remote tests
  • repeated after removing the "skip" (with remote testing): 498 passed, 139 skipped, 0 failed

Upgrading cygwin to current version, rerunning tests...

  • python 3.6.1, cygwin 2.8.0, borg 1.0-maint branch tip
  • with remote testing: 498 passed, 139 skipped, 0 failed
  • same with borg 1.0.10 checkout + required mods (see above): 492 passed, 134 skipped, 0 failed.
  • updated: borg 1.0.10 now at 511 passed, 115 skipped, 0 failed (I have found/removed 2 more py.test.skip for cygwin from repository tests)

Practical testing:

  • server: ubuntu 16.04 borg 1.0.10, client: win 10 cygwin 2.8.0, borg 1.0.10
  • borg init, borg create, borg list, borg check, borg extract --dry-run all worked fine.

Sorry, I can't reproduce.

Hah, interesting...

I started a borg command on the client (to the borg ssh remote), it then asked for ssh password (I did not set up ssh keys for this test, just used ssh password login), but I then decided to Ctrl-C it.

And there it is: FD exception occurred (in negotiate / call_many)

So your problem is likely that your ssh somehow does not work.

Maybe try it with password first and then (after it works) switch to keys?

And there it is: FD exception occurred (in negotiate / call_many)

On *nix, Borg gets an error message out. There are no SSH error messages in this thread; perhaps that's the part that's broken.

Edit: I can't remember ever seeing the exceptfd path being triggered on *nix. Which might have something to do with these being pipes, not sockets, _which don't have exceptions_ — at least on Linux.

That last part might just be another Cygwin bug.

@ThomasWaldmann Sorry, I forgot to mention my windows is 7 64-bit professional edition.

@ThomasWaldmann Good catch! after removing the old ssh key (maybe outdated but it worked for ssh), the issue is solved! Thanks for your insights and solutions!

OK, so guess all is done (relating to 1.0.10 / 1.0-maint branch).

I get the same _Exception: FD exception occurred_ error and it seems that I my case it is a PATH issue on my nas. Adding a remote path parameter fixes it.

I noticed it only because in WSL (Windows Subsystem for Linux) I get this (correct) warning:

Remote: sh: borg: command not found
Connection closed by remote host. Is borg working on the server?

So try using borg like:
borg list --remote-path /usr/local/bin/borg ssh://user@synology:22/volume1/Backups/BackupBorg

Maybe this Info is helpfull for others

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pierreozoux picture pierreozoux  Â·  4Comments

rugk picture rugk  Â·  3Comments

tconstans picture tconstans  Â·  5Comments

qknight picture qknight  Â·  6Comments

enkore picture enkore  Â·  5Comments