Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vorta 0.7.5 crashes when adding a directory like /home wherein some directories are owned by (example) root. #968

Closed
Wikinaut opened this issue May 3, 2021 · 9 comments
Assignees
Labels
type:bug Something doesn't work as intended

Comments

@Wikinaut
Copy link

Wikinaut commented May 3, 2021

Describe the bug
Vorta 0.7.5 fully crashes while running as user when adding a directory like /home wherein some directories are owned by (example) root.

After a restart, the directory appears to be added in the source list.

Expected
Either ignore such directory or files or show a info message/warning in such cases, but do not crash.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Sources
  2. Click on Add directory
  3. Select /home
  4. Counting files begins … then suddenly vorta crashes while trying to access the directory owned by root.

Environment (please complete the following information):

  • OS: LinuxMint 20.1
  • Vorta version: 0.7.5
  • Installed via pip install --no-cache-dir -U vorta

Additional context

021-05-03 17:25:37,532 - root - CRITICAL - Uncaught exception,
file a report at https://github.com/borgbase/vorta/issues/new

Traceback (most recent call last):
  File "/home/benutzer/.local/lib/python3.8/site-packages/vorta/utils.py", line 46, in run
    self.size, self.files_count = get_path_datasize(self.path)
  File "/home/benutzer/.local/lib/python3.8/site-packages/vorta/utils.py", line 90, in get_path_datasize
    data_size, files_count = get_directory_size(file_info.absoluteFilePath())
  File "/home/benutzer/.local/lib/python3.8/site-packages/vorta/utils.py", line 65, in get_directory_size
    stat = os.stat(file_path)
PermissionError: [Errno 13] Keine Berechtigung: '/home/benutzer/xyz/'
@m3nu m3nu added the type:bug Something doesn't work as intended label May 3, 2021
@m3nu m3nu self-assigned this May 3, 2021
m3nu added a commit to m3nu/vorta that referenced this issue May 4, 2021
@m3nu
Copy link
Contributor

m3nu commented May 4, 2021

Thanks for reporting. A similar case was already addressed, but it didn't cover permission errors in subfolders.

@m3nu
Copy link
Contributor

m3nu commented May 4, 2021

If you can, please verify the fix in the current master branch. See here for how to install the latest version from the master branch.

@m3nu m3nu closed this as completed in be6a39b May 4, 2021
@Wikinaut
Copy link
Author

Wikinaut commented May 4, 2021

Looks fine to me (I patched that single line manually). Go on! Please release a new version.

@m3nu
Copy link
Contributor

m3nu commented May 4, 2021

Still a lot to do for the next minor release. Hoping to make time for a sprint in 2-3 weeks.

https://github.com/borgbase/vorta/issues?q=is%3Aopen+is%3Aissue+milestone%3A%22v0.7.6+%28Next+minor+release%29%22

@mwmcode
Copy link

mwmcode commented Oct 4, 2021

Hi @m3nu I'm seeing warnings like this
WARNING - /private/etc/aliases.db: open: [Errno 13] Permission denied: '/private/etc/aliases.db'

Is this the same issue?

Vorta 0.7.8
Borg 1.1.17

@m3nu
Copy link
Contributor

m3nu commented Oct 4, 2021

This looks like a warning from Borg. We currently return a warning when some files are inaccessible. You shouldn't see any crash for sure.

@Wikinaut
Copy link
Author

Wikinaut commented Oct 4, 2021

Eh, I think the crash issue was fixed since a while, thanks.

@mwmcode
Copy link

mwmcode commented Oct 4, 2021

Don't mean to bug you on a closed issue but any workaround for this?

Borg docs say

Using root likely will be required if you want to backup files of other users or the operating system.

Can I instruct Vorta to run borg as root?

@m3nu
Copy link
Contributor

m3nu commented Oct 5, 2021

Can I instruct Vorta to run borg as root?

It's not tested or supported, but you could try adding a sticky user bit to Borg, which would run it with root perms, no matter who starts it. Obviously this isn't secure.

Or a wrapper script the runs it with sudo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something doesn't work as intended
Projects
None yet
Development

No branches or pull requests

3 participants