anarcat / bup-cron

mirror of the bup-cron repository, may be out of date while i figure out github mirror things
https://gitlab.com/anarcat/bup-cron
GNU Affero General Public License v3.0
22 stars 4 forks source link

bup-cron: cannot save stats note on remote backups #4

Closed Crazyguy closed 9 years ago

Crazyguy commented 9 years ago

Looks like bup-cron can't save stats when using option: -r REMOTE, --remote REMOTE a SSH address to save the backup remotely (example: bup@example.com:repos/repo.bup)

Currently this results in errors to stderr. I'm not sure if this should be supported or not?

In case it's not easy to get it working I would simply say something like "stats is not supported on remote backups" to stdout instead.

anarcat commented 9 years ago

please copy the output of the error will full verbosity and debug.

thanks!

Crazyguy commented 9 years ago

Hmm... Looks like the relevant part in the output is following:

calling command `['ssh', '-T', 'nitrogen@sodium.crazyguy.info', "git --git-dir='bup' notes add -F - 'nitrogen-_home'"]`
output: `
*** Please tell me who you are.

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for <nitrogen@sodium.crazyguy.info>) not allowed
` (128)
cannot save stats note
anarcat commented 9 years ago

which version of git on the remote server?

anarcat commented 9 years ago

also, consider running the recommended commands on the remote server, it may just be a sufficient workaround.

Crazyguy commented 9 years ago

Debian package: ii git 1:2.1.3-1 amd64 fast, scalable, distributed revision control system

git --version: git version 2.1.3

The workaround sounds like it might work. I'll try that later.

anarcat commented 9 years ago

after reading the documentation, i think i'll close this bug - it's a problem in git, or more precisely, the problem is that your remote account doesn't have a fullname in the password field, which is not supported by git:

https://git.wiki.kernel.org/index.php/Git_FAQ#Git_commit_is_dying_telling_me_.22fatal:_empty_ident_.3Cuser.40myhost.3E_not_allowed.22.2C_what.27s_wrong.3F

i don't think it's fair to expect bup-cron to work around that. i assume that the backup is otherwise successful, so to remove the warning, just do not use --stats. you can also correctly configure the user account, use the git config --global user.name "Your Name" command or file a bug upstream with git to get that behavior fixed. :)

the solution for bup-cron would be to detect such a situation and send a custom environment variable, but I don't think it's worth adding extra complexity for something that can be easily configured on the remote end.

maybe it would be worth a documentation entry in the README... what do you think?

sorry for the trouble!

Crazyguy commented 9 years ago

Yeah, looks like the workaround is to run the commands: git config --global user.email "you@example.com" git config --global user.name "Your Name"

This might be added in the documentation in a troubleshooting section for example

anarcat commented 9 years ago

alright - i just did a 1.3 but forgot to ship this documentation update. oh well, now it's in the README at least, and will be in post 1.3 releases!

thanks for the bug report.