You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Permission denied" for source with many paths (including spaces) #1122
This config always gives a "Permission denied" error, no matter what I try. So far I've tried running as sudo, changing the backend (using rclone normally), changing the sources from "~" to "/home/USERNAME" and back.
The weird thing is, using the normal CLI works just fine, even using the same backup sources.
Using Linux Mint 21.3, rustic 0.7.0, backend rclone
I'll be happy to provide more details, if needs be.
@NatureHog Thanks for opening this issue.
Can you please provide the exact commands (of course redacting sensitive data) you are using? I mean the one with and the one without using the config.
Besides this there have been some improvements about more detailed error messages in context with config profile files. Can you please try if using the latest nightly build also reproduces your behavior?
Using config: rustic backup --init -P config
Without using config (Working flawlessly): rustic backup --init -r REPO SOURCE1 SOURCE2 SOURCE3
I forgot to mention I have multiple sources, using spaces in between for both config and CLI. Updated Gist above accordingly, for clarification.
While testing this, I also noticed the environment variable didn't "register" properly. Maybe it's just my inexperience with Linux in general, but I have to call export RUSTIC_PASSWORD every time I want to use the CLI. Idk why, it seems broken to me?
Can you please post the full output when the "permission denied" error occurs?
I'm especially interested if there is some [INFO] Using config ... coming. I think not; in this case the error come from rustic trying to access that config file. This would also explain why the problem only occurs when using it with a config file. The latest nightly build does print out a better error message in that case, IIRC.
Ok, thanks a lot for your test output. I think this is an issue about how multiple paths are treated in the config. And actually, we should change this as it makes much trouble.
Can you test if sources with just 1 single path work?
Do you have whitespaces within single paths?
I think that something like
source = '"PATH1" "PATH2" "PATH3"'
should work. But actually I'm looking how to change this so you don't get this weird behavior with future rustic versions.
I do indeed have whitespaces in one of the paths, I have in fact already tried source = "'SOURCE1' SOURCE2 SOURCE3" using single quotes on one of the paths, that didn't work, neither did your suggestion, unfortunately.
I also tried a single path, both with and without whitespaces, neither worked...
I do indeed have whitespaces in one of the paths, I have in fact already tried source = "'SOURCE1' SOURCE2 SOURCE3" using single quotes on one of the paths, that didn't work, neither did your suggestion, unfortunately.
IIRC double quotes around the paths with whitespaces should work. But yes, we'll need to fix that and make a better solution.
changed the title [-]"Permission denied" error only when using config file[/-][+]"Permission denied" for source with many paths (including spaces)[/+]on Apr 18, 2024
For some reason, building rustic from source, with the PR above in place, it still doesn't work for me, even after I changed my config to an array, kind of like this.
@NatureHog Seems there is another issue in your case. Can you please post the output of rustic backup using the current main version and both variants (with config profile and witch specifying the paths directly)? If you redact some things, please make sure that you verified that they are identical in both variants!
Here are both outputs, the working one cancelled early, because otherwise it would take too long. since the data is around 200GB, without compression of any kind.
Using version rustic 0.7.0-dev for both outputs.
Edit to add: Since one of the commands seems to be working, it can't be because of the size of the sources, can it?
I finally figured out my issue!
I basically copied the example config file, which had the following line: glob-file = ["/root/rustic-local.glob"]
Since rustic wasn't installed as root, but instead under a user account, it couldn't access the file specified.
Removing the line works, so closing this issue, at least preemptively.
@NatureHog Thanks for coming back and reporting the solution for your problem. Actually, I created rustic-rs/rustic_core#215 to add better error messages in that case - hopefully this helps other users with the same problem identify the root cause much easier.
Activity
aawsome commentedon Apr 17, 2024
@NatureHog Thanks for opening this issue.
Can you please provide the exact commands (of course redacting sensitive data) you are using? I mean the one with and the one without using the config.
Besides this there have been some improvements about more detailed error messages in context with config profile files. Can you please try if using the latest nightly build also reproduces your behavior?
NatureHog commentedon Apr 17, 2024
Using config:
rustic backup --init -P configWithout using config (Working flawlessly):
rustic backup --init -r REPO SOURCE1 SOURCE2 SOURCE3I forgot to mention I have multiple sources, using spaces in between for both config and CLI. Updated Gist above accordingly, for clarification.
While testing this, I also noticed the environment variable didn't "register" properly. Maybe it's just my inexperience with Linux in general, but I have to call
export RUSTIC_PASSWORDevery time I want to use the CLI. Idk why, it seems broken to me?aawsome commentedon Apr 17, 2024
Can you please post the full output when the "permission denied" error occurs?
I'm especially interested if there is some
[INFO] Using config ...coming. I think not; in this case the error come from rustic trying to access that config file. This would also explain why the problem only occurs when using it with a config file. The latest nightly build does print out a better error message in that case, IIRC.NatureHog commentedon Apr 17, 2024
Here is the complete output on version
rustic v0.7.0-28-gb6e9c1b-nightly, using--log-level debugIt seems to me that, it is using the config, but it can't access the source folders?
aawsome commentedon Apr 18, 2024
Ok, thanks a lot for your test output. I think this is an issue about how multiple paths are treated in the config. And actually, we should change this as it makes much trouble.
Can you test if sources with just 1 single path work?
Do you have whitespaces within single paths?
I think that something like
should work. But actually I'm looking how to change this so you don't get this weird behavior with future rustic versions.
NatureHog commentedon Apr 18, 2024
I do indeed have whitespaces in one of the paths, I have in fact already tried
source = "'SOURCE1' SOURCE2 SOURCE3"using single quotes on one of the paths, that didn't work, neither did your suggestion, unfortunately.I also tried a single path, both with and without whitespaces, neither worked...
aawsome commentedon Apr 18, 2024
IIRC double quotes around the paths with whitespaces should work. But yes, we'll need to fix that and make a better solution.
[-]"Permission denied" error only when using config file[/-][+]"Permission denied" for source with many paths (including spaces)[/+]fix(config)!: multiple paths in config profile as array (#1124)
NatureHog commentedon Apr 18, 2024
For some reason, building rustic from source, with the PR above in place, it still doesn't work for me, even after I changed my config to an array, kind of like this.
aawsome commentedon Apr 18, 2024
@NatureHog Seems there is another issue in your case. Can you please post the output of
rustic backupusing the current main version and both variants (with config profile and witch specifying the paths directly)? If you redact some things, please make sure that you verified that they are identical in both variants!NatureHog commentedon Apr 18, 2024
Here are both outputs, the working one cancelled early, because otherwise it would take too long. since the data is around 200GB, without compression of any kind.
Using version
rustic 0.7.0-devfor both outputs.Edit to add: Since one of the commands seems to be working, it can't be because of the size of the sources, can it?
NatureHog commentedon May 1, 2024
I finally figured out my issue!
I basically copied the example config file, which had the following line:
glob-file = ["/root/rustic-local.glob"]Since rustic wasn't installed as root, but instead under a user account, it couldn't access the file specified.
Removing the line works, so closing this issue, at least preemptively.
aawsome commentedon May 1, 2024
@NatureHog Thanks for coming back and reporting the solution for your problem. Actually, I created rustic-rs/rustic_core#215 to add better error messages in that case - hopefully this helps other users with the same problem identify the root cause much easier.
fix(errors): Show filenames in error message coming from ignore source (