egara / buttermanager

ButterManager is a BTRFS tool for managing snapshots, balancing filesystems and upgrading the system safetly.
GNU General Public License v3.0
129 stars 6 forks source link

Fatal error when starting up: `ValueError: invalid literal for int() with base 10: ''` #52

Closed wheelerlaw closed 10 months ago

wheelerlaw commented 11 months ago

Installed on Fedora 38 using dnf, buttermanager package version buttermanager-2.4.2-6.fc38.noarch.

Starting it from Gnome, a notification appears saying the app crashed. When I start it up on the command line, I get this error:

$ buttermanager 
QSocketNotifier: Can only be used with threads started with QThread
qt.qpa.qgnomeplatform.theme: The desktop style for QtQuick Controls 2 applications is not available on the system (qqc2-desktop-style). The application may look broken.
Traceback (most recent call last):
  File "/usr/bin/buttermanager", line 33, in <module>
    sys.exit(load_entry_point('buttermanager==2.4.2', 'console_scripts', 'buttermanager')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/buttermanager/bm_main.py", line 17, in main
    PasswordWindow(None)
  File "/usr/lib/python3.11/site-packages/buttermanager/buttermanager/buttermanager.py", line 60, in __init__
    self.__buttermanager_configurator.configure()
  File "/usr/lib/python3.11/site-packages/buttermanager/buttermanager/util/utils.py", line 140, in configure
    self.migrate_properties()
  File "/usr/lib/python3.11/site-packages/buttermanager/buttermanager/util/utils.py", line 184, in migrate_properties
    snapshots_to_keep = int(settings.properties_manager.get_property('snapshots_to_keep'))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
wheelerlaw commented 11 months ago

Cloning the latest version from Git, the issue is still there:

/usr/bin/python3.11 /home/wheeler/Repositories/Other/buttermanager/buttermanager/main.py 
Traceback (most recent call last):
  File "/home/wheeler/Repositories/Other/buttermanager/buttermanager/main.py", line 19, in <module>
    main()
  File "/home/wheeler/Repositories/Other/buttermanager/buttermanager/main.py", line 13, in main
    PasswordWindow(None)
  File "/home/wheeler/Repositories/Other/buttermanager/buttermanager/buttermanager/buttermanager.py", line 62, in __init__
    self.__buttermanager_configurator.configure()
  File "/home/wheeler/Repositories/Other/buttermanager/buttermanager/buttermanager/util/utils.py", line 142, in configure
    self.migrate_properties()
  File "/home/wheeler/Repositories/Other/buttermanager/buttermanager/buttermanager/util/utils.py", line 192, in migrate_properties
    snapshots_to_keep = int(settings.properties_manager.get_property('snapshots_to_keep'))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
egara commented 11 months ago

Hi @wheelerlaw and thank you very much for your report.

This is a known issue on Fedora because the package has not been updated from version 2.4.2. I would suggest:

1- Remove completely buttermanager from your system 2- Remove .buttermanager folder from home in which is all the configuration stored 3- You can install version 2.4.2 again from the repo 4- Locate the source file buttermanager/buttermanager/util/utils.py (this file is located at /usr/lib/python3.11/site-packages/buttermanager/buttermanager/util/utils.py on Arch for example). You can find it using sudo find / -iname utils.py | grep buttermanager 5- Apply the patch I suggested on this issue which I think is similar to yours https://github.com/egara/buttermanager/issues/32#issuecomment-1432963023

Tell me if you can fix it with this "temporal solution". Sorry, but the Fedora package is not maintained by me and I think the person who created it is quite busy right now and he doesn't have enough time.

wheelerlaw commented 10 months ago

The issue is present in the latest version cloned from Git.

egara commented 6 months ago

Hi @wheelerlaw

I know it's been a while but finally I could have time to see more deeply this issue and I think it is solved now. If you want, you can try to install this latest version 2.5.1 and it should work. I've tested it on Fedora 39 via venv installation (the proper script venv_install.sh is inside the install directory). Please, be aware of the additional packages required.

Thanks!