Tilde (~) does not work in macOS #30

Closed
opened 2018-01-05 05:34:07 +00:00 by import_bot · 17 comments
Collaborator

OS: macOS 10.12.5
Borg version: 1.0.10
borgmatic version: 1.0.3

You will be told that the repository cannot be found: ~/My Directory/repo

Whereas this will work fine: /Users/myusername/My Directory/repo


Imported from Taiga issue 29 (done). Created on 2017-07-03T12:47:52+0000 by Sam A. Horvath-Hunt.

OS: macOS 10.12.5 Borg version: 1.0.10 borgmatic version: 1.0.3 You will be told that the repository cannot be found: ~/My Directory/repo Whereas this will work fine: /Users/myusername/My Directory/repo --- Imported from Taiga issue 29 (done). Created on 2017-07-03T12:47:52+0000 by Sam A. Horvath-Hunt.
Author
Collaborator

Confirmed that this repros on Linux as well. Converting to an enhancement, as this is just not something that Borg does. Should be pretty easy for borgmatic to provide that feature though.


Comment on 2017-07-26T04:35:56+0000 by Dan Helfman.

Confirmed that this repros on Linux as well. Converting to an enhancement, as this is just not something that Borg does. Should be pretty easy for borgmatic to provide that feature though. --- Comment on 2017-07-26T04:35:56+0000 by Dan Helfman.
Author
Collaborator

This has been implemented in borgmatic 1.1.9, just released!


Comment on 2017-10-30T03:37:11+0000 by Dan Helfman.

This has been implemented in borgmatic 1.1.9, just released! --- Comment on 2017-10-30T03:37:11+0000 by Dan Helfman.
Author
Collaborator

Hey. I just upgraded to 1.1.9 and this still isn't working as expected.

Config file is identical to this bar the obfuscation: https://github.com/SamHH/dotfiles/blob/master/etc/borgmatic/config.yaml

repositories:
    - ~/example/

Results in error: Repository /Users/<username>/~/example does not exist.


Comment on 2017-10-30T10:52:30+0000 by Sam A. Horvath-Hunt.

Hey. I just upgraded to 1.1.9 and this still isn't working as expected. Config file is identical to this bar the obfuscation: https://github.com/SamHH/dotfiles/blob/master/etc/borgmatic/config.yaml ```yaml repositories:     - ~/example/ ``` Results in error: `Repository /Users/<username>/~/example does not exist.` --- Comment on 2017-10-30T10:52:30+0000 by Sam A. Horvath-Hunt.
Author
Collaborator

Yikes, okay. I'll take a look when I get a chance.


Comment on 2017-10-30T17:31:07+0000 by Dan Helfman.

Yikes, okay. I'll take a look when I get a chance. --- Comment on 2017-10-30T17:31:07+0000 by Dan Helfman.
Author
Collaborator

Ah, looks like I (intentionally) only implemented tilde expansion for the source_directories option, but not for repositories. I don't recall exactly why I didn't do it for repositories.. It might have been because a repository can sometimes be local and can sometimes be remote, and it's not trivial to expand a remote tilde. But there may be a "good enough" solution here that solves the local case.


Comment on 2017-10-31T03:06:41+0000 by Dan Helfman.

Ah, looks like I (intentionally) only implemented tilde expansion for the `source_directories` option, but not for `repositories`. I don't recall exactly why I didn't do it for `repositories`.. It might have been because a repository can sometimes be local and can sometimes be remote, and it's not trivial to expand a remote tilde. But there may be a "good enough" solution here that solves the local case. --- Comment on 2017-10-31T03:06:41+0000 by Dan Helfman.
Author
Collaborator

Okay, this should be fixed for real now for repositories (just released). Take it for a spin and let me know whether it works for you.


Comment on 2017-11-03T05:38:13+0000 by Dan Helfman.

Okay, this should be fixed for real now for `repositories` (just released). Take it for a spin and let me know whether it works for you. --- Comment on 2017-11-03T05:38:13+0000 by Dan Helfman.
Author
Collaborator

Thanks, it's no longer erroring on the config! :-)

I am now however getting a different error, hopefully something silly on my part: [Errno 2] No such file or directory: '/etc/borgmatic.d'


Comment on 2017-11-03T14:31:16+0000 by Sam A. Horvath-Hunt.

Thanks, it's no longer erroring on the config! :-) I am now however getting a different error, hopefully something silly on my part: `[Errno 2] No such file or directory: '/etc/borgmatic.d'` --- Comment on 2017-11-03T14:31:16+0000 by Sam A. Horvath-Hunt.
Author
Collaborator

Huh, that's super odd, because there's code to explicitly support /etc/borgmatic.d not existing. What config paths are you specifying on the borgmatic command-line, if any (it'd be with -c or --config)? Also, if you add -v 2 to the borgmatic run, then what log output comes immediately before that error?

And here's one additional thing you can try if you'd like to debug: Open a Python shell (run python), and then type:

import os
os.path.realpath('/etc/borgmatic.d')

That should output '/etc/borgmatic.d'. If it doesn't, then something's really wacky.


Comment on 2017-11-04T03:14:32+0000 by Dan Helfman.

Huh, that's super odd, because there's code to explicitly support `/etc/borgmatic.d` not existing. What config paths are you specifying on the borgmatic command-line, if any (it'd be with `-c` or `--config`)? Also, if you add `-v 2` to the borgmatic run, then what log output comes immediately before that error? And here's one additional thing you can try if you'd like to debug: Open a Python shell (run `python`), and then type: ``` import os os.path.realpath('/etc/borgmatic.d') ``` That should output `'/etc/borgmatic.d'`. If it doesn't, then something's really wacky. --- Comment on 2017-11-04T03:14:32+0000 by Dan Helfman.
Author
Collaborator

Curiously, adding the -c parameter and the config path makes it work, but I don't think that was necessary before. Any idea why?


Comment on 2017-11-05T10:48:58+0000 by Sam A. Horvath-Hunt.

Curiously, adding the `-c` parameter and the config path makes it work, but I don't think that was necessary before. Any idea why? --- Comment on 2017-11-05T10:48:58+0000 by Sam A. Horvath-Hunt.
Author
Collaborator

It shouldn't be necessary.. Can you try some of the debugging steps outlined above and report back? That should help narrow down what might be going wrong. Thanks!


Comment on 2017-11-05T17:50:19+0000 by Dan Helfman.

It shouldn't be necessary.. Can you try some of the debugging steps outlined above and report back? That should help narrow down what might be going wrong. Thanks! --- Comment on 2017-11-05T17:50:19+0000 by Dan Helfman.
Author
Collaborator

These are the logs directly preceding the error:

Archive consistency check complete, no problems found.
/etc/borgmatic/config.yaml: No commands to run for post-backup hook
/etc/borgmatic.d: Parsing configuration file
[Errno 2] No such file or directory: '/etc/borgmatic.d'

Comment on 2017-11-07T10:49:48+0000 by Sam A. Horvath-Hunt.

These are the logs directly preceding the error: ``` Archive consistency check complete, no problems found. /etc/borgmatic/config.yaml: No commands to run for post-backup hook /etc/borgmatic.d: Parsing configuration file [Errno 2] No such file or directory: '/etc/borgmatic.d' ``` --- Comment on 2017-11-07T10:49:48+0000 by Sam A. Horvath-Hunt.
Author
Collaborator

Interesting. So it's collecting config paths without error, but then blowing up on trying to parse that (non-existent) configuration file. What is the output of that os.path.realpath('/etc/borgmatic.d') Python code from above? That will help narrow down how the collection code is failing to skip /etc/borgmatic.d. Thanks for your patience here.


Comment on 2017-11-09T05:39:45+0000 by Dan Helfman.

Interesting. So it's collecting config paths without error, but then blowing up on trying to parse that (non-existent) configuration file. What is the output of that `os.path.realpath('/etc/borgmatic.d')` Python code from above? That will help narrow down how the collection code is failing to skip `/etc/borgmatic.d`. Thanks for your patience here. --- Comment on 2017-11-09T05:39:45+0000 by Dan Helfman.
Author
Collaborator

It gives this back: '/private/etc/borgmatic.d'

No worries, appreciate the support. :-)


Comment on 2017-11-10T14:08:57+0000 by Sam A. Horvath-Hunt.

It gives this back: `'/private/etc/borgmatic.d'` No worries, appreciate the support. :-) --- Comment on 2017-11-10T14:08:57+0000 by Sam A. Horvath-Hunt.
Author
Collaborator

Aha! So that's the cause of this issue you're seeing: The paths aren't matching up and so /etc/borgmatic.d isn't excluded from the config paths to load. I'll see if I can cook up a work-around.


Comment on 2017-11-11T05:05:48+0000 by Dan Helfman.

Aha! So that's the cause of this issue you're seeing: The paths aren't matching up and so `/etc/borgmatic.d` isn't excluded from the config paths to load. I'll see if I can cook up a work-around. --- Comment on 2017-11-11T05:05:48+0000 by Dan Helfman.
Author
Collaborator

Okay, I just put out a release with a potential fix: borgmatic 1.1.11. Give it a shot and let me know how it goes!


Comment on 2017-11-11T05:31:46+0000 by Dan Helfman.

Okay, I just put out a release with a potential fix: borgmatic 1.1.11. Give it a shot and let me know how it goes! --- Comment on 2017-11-11T05:31:46+0000 by Dan Helfman.
Author
Collaborator

Works a charm, thanks!


Comment on 2017-11-14T09:41:07+0000 by Sam A. Horvath-Hunt.

Works a charm, thanks! --- Comment on 2017-11-14T09:41:07+0000 by Sam A. Horvath-Hunt.
Author
Collaborator

Glad to hear it!


Comment on 2017-11-15T06:17:21+0000 by Dan Helfman.

Glad to hear it! --- Comment on 2017-11-15T06:17:21+0000 by Dan Helfman.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#30
No description provided.