Skip to content

"Permission denied" for source with many paths (including spaces) #1122

Closed

Description

@NatureHog

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.

Thanks in advance!

Activity

  1. added
    S-triageStatus: Waiting for a maintainer to triage this issue/PR
    on Apr 17, 2024
  2. aawsome commented on Apr 17, 2024

    @aawsome
    Member

    @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?

  3. added
    C-questionCategory: Further information is requested
    and removed
    S-triageStatus: Waiting for a maintainer to triage this issue/PR
    on Apr 17, 2024
  4. NatureHog commented on Apr 17, 2024

    @NatureHog
    Author

    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?

  5. aawsome commented on Apr 17, 2024

    @aawsome
    Member

    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.

  6. NatureHog commented on Apr 17, 2024

    @NatureHog
    Author

    Here is the complete output on version rustic v0.7.0-28-gb6e9c1b-nightly, using --log-level debug

    It seems to me that, it is using the config, but it can't access the source folders?

  7. aawsome commented on Apr 18, 2024

    @aawsome
    Member

    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.

  8. NatureHog commented on Apr 18, 2024

    @NatureHog
    Author

    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...

  9. aawsome commented on Apr 18, 2024

    @aawsome
    Member

    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.

  10. changed the title [-]"Permission denied" error only when using config file[/-] [+]"Permission denied" for source with many paths (including spaces)[/+] on Apr 18, 2024
  11. added
    C-bugCategory: Something isn't working as expected
    A-configArea: Related to the config file functionality and format
    and removed
    C-questionCategory: Further information is requested
    on Apr 18, 2024
  12. added a commit that references this issue on Apr 18, 2024
    9980a36
  13. NatureHog commented on Apr 18, 2024

    @NatureHog
    Author

    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.

  14. aawsome commented on Apr 18, 2024

    @aawsome
    Member

    @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!

  15. NatureHog commented on Apr 18, 2024

    @NatureHog
    Author

    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?

  16. NatureHog commented on May 1, 2024

    @NatureHog
    Author

    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.

  17. aawsome commented on May 1, 2024

    @aawsome
    Member

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configArea: Related to the config file functionality and formatC-bugCategory: Something isn't working as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions