Backintime crashes when trying to free space

Bug #1308930 reported by Andreas Hohenegger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Back In Time
Fix Released
Undecided
Unassigned

Bug Description

Backintime, ran with

sudo backintime-kde4 --config /root/.config/backintime/config --profile-id 1 -b

quits with

INFO: Keep min free disk space: 1024 Mb
Traceback (most recent call last):
  File "/usr/share/backintime/common/backintime.py", line 405, in <module>
    start_app()
  File "/usr/share/backintime/common/backintime.py", line 183, in start_app
    take_snapshot( cfg, True )
  File "/usr/share/backintime/common/backintime.py", line 56, in take_snapshot
    snapshots.Snapshots( cfg ).take_snapshot( force )
  File "/usr/share/backintime/common/snapshots.py", line 949, in take_snapshot
    self._free_space( now )
  File "/usr/share/backintime/common/snapshots.py", line 1603, in _free_space
    info = os.statvfs( self.config.get_snapshots_path() )
OSError: [Errno 95] Operation not supported: '/tmp/backintime/root/1_11200'

It is apparent that there is no error handling after os.statvfs. I tried to reproduce the bug in a short python script after running backintime (using the mounted path):

import os
import statvfs

os.stat("/tmp/backintime/root/1_11200")

info = os.statvfs("/tmp/backintime/root/1_11200")
free_space = info[ statvfs.F_FRSIZE ] * info[ statvfs.F_BAVAIL ] / ( 1024 * 1024 )

Surprisingly this does not produce any errors.

My backintime is from ubuntu packages, version: 1.0.34 .

Revision history for this message
Germar (germar) wrote :

I guess this is because you're starting with sudo.
kdesudo and sudo behave a bit different. That's also why BIT didn't find your config automatically because with sudo $HOME is /home/USER and with kdesudo it is /root.
Please try again with 'kdesudo "backintime -b" '.

Regards,
Germar

Revision history for this message
Andreas Hohenegger (hohenegger) wrote :

The command
kdesudo "backintime -b"
never seems to finish (it does not print any output either). I am not sure if it reads the correct configuration.

The command
kdesudo 'backintime--config /root/.config/backintime/config --profile-id 1 -b'

prints

Could not open a connection to your authentication agent.
Could not open a connection to your authentication agent.
ERROR: Could not unlock ssh private key. Wrong password or password not available for cron.

and some more errors.

Am I doing something wrong?

Please note that I was running the python code quoted above with sudo as well.

Using kdesudo would also mean that I would need a graphical login to run it, wouldn't it?

Revision history for this message
Andreas Hohenegger (hohenegger) wrote :

By trial and error I found the following workaround which I am now using to run backintime-kde4 on ubuntu 14.04 (root user must be enabled and backintime might tell you that you have to add root to fuse group; your ssh-keys might need to be in your /root/.ssh directory)

sudo su
ssh-agent bash
ssh-add
backintime-kde4 --config /root/.config/backintime/config --profile-id 1

backintime without gui will also work with regular sudo.

Revision history for this message
Germar (germar) wrote :

Sorry for the long delay. I've somehow overseen your last both comments.

Normally 'kdesudo backintime...' should work just fine. It could be that you messed up dependencies while running with sudo in one of these folders:

~/.config/backintime
~/.local/share/backintime
/root/.config/backintime
/root/.local/share/backintime

To fix the keyring warnings please patch your installation with 'sudo patch /usr/share/backintime/common/tools.py < tools.py.patch'

Revision history for this message
Andreas Hohenegger (hohenegger) wrote :

Works for me.

Changed in backintime:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.