xfpanel-switch is failing to save panel settings

Bug #1765565 reported by Leonardo Müller
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Xfce4 Panel Profiles
Fix Released
Undecided
Alistair Buxton
xfpanel-switch (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When I try to save the actual xfce4-panel settings the save fails. When opening xfpanel-switch terminal, the following message appears when clicking to save:

Traceback (most recent call last):
  File "/usr/share/xfpanel-switch/xfpanel-switch/xfpanel-switch.py", line 221, in on_save_clicked
    self.save_configuration(name)
  File "/usr/share/xfpanel-switch/xfpanel-switch/xfpanel-switch.py", line 209, in save_configuration
    PanelConfig.from_xfconf(self.xfconf).to_file(filename)
  File "/usr/share/xfpanel-switch/xfpanel-switch/panelconfig.py", line 64, in from_xfconf
    pc.find_desktops()
  File "/usr/share/xfpanel-switch/xfpanel-switch/panelconfig.py", line 114, in find_desktops
    if self.check_desktop(desktop_path):
  File "/usr/share/xfpanel-switch/xfpanel-switch/panelconfig.py", line 88, in check_desktop
    bytes = self.get_desktop_source_file(path).read()
  File "/usr/share/xfpanel-switch/xfpanel-switch/panelconfig.py", line 129, in get_desktop_source_file
    return open(path, 'rb')
FileNotFoundError: [Errno 2] Arquivo ou diretório inexistente: '/home/usuario/.config/xfce4/panel/launcher-21/14294989537.desktop'

And the panel setting is not saved. When this happens, the buttons to save and close have no action when clicked.

Here is a image with the panel: https://i.imgur.com/7kuhAr5.png

Here is the output from ls -lR ~/.config/xfce4/panel
/home/usuario/.config/xfce4/panel:
total 24
-rw-rw-r-- 1 usuario usuario 145 abr 19 21:26 genmon-10.rc
-rw-rw-r-- 1 usuario usuario 99 fev 9 2017 genmon-16.rc
drwx------ 2 usuario usuario 4096 abr 19 20:08 launcher-1
drwx------ 2 usuario usuario 4096 abr 19 20:08 launcher-8
-rw-rw-r-- 1 usuario usuario 1739 ago 27 2017 whiskermenu-1.rc
-rw-rw-r-- 1 usuario usuario 1959 abr 19 20:40 whiskermenu-2.rc

/home/usuario/.config/xfce4/panel/launcher-1:
total 4
-rw-rw-r-- 1 usuario usuario 708 abr 19 20:08 15241793011.desktop

/home/usuario/.config/xfce4/panel/launcher-8:
total 4
-rw-rw-r-- 1 usuario usuario 532 abr 19 20:08 15241793122.desktop

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: xfpanel-switch 1.0.7-0ubuntu1
Uname: Linux 4.16.3-041603-generic x86_64
ApportVersion: 2.20.9-0ubuntu5
Architecture: amd64
CurrentDesktop: XFCE
Date: Thu Apr 19 21:35:10 2018
InstallationDate: Installed on 2017-06-13 (310 days ago)
InstallationMedia: Xubuntu 17.04 "Zesty Zapus" - Release amd64 (20170412)
PackageArchitecture: all
SourcePackage: xfpanel-switch
UpgradeStatus: Upgraded to bionic on 2017-10-20 (182 days ago)

Related branches

Revision history for this message
Leonardo Müller (leozinho29-eu) wrote :
Revision history for this message
Leonardo Müller (leozinho29-eu) wrote :
Revision history for this message
Alistair Buxton (a-j-buxton) wrote :

First a quick description of the panel configuration: Every plugin on every panel is stored in a series of properties. Then, each panel has a list of plugins on that panel, which references the central list.

What has happened here is that somehow a panel has been deleted (panel-0), but the plugin settings associated with it have been left behind. However, the .desktop files for the launchers have been deleted. Launchers are not the only type of plugin which has been orphaned in this way, there are a few others. Every plugin with ID > 11 in the xml is an orphan.

I'm not sure how this happened. It doesn't seem to happen with the panel in 18.04 if you delete a panel.

In order to fix this I think panel-switch will have to check where every plugin exists somewhere on a panel, and if not ignore it (ie don't save it).

Revision history for this message
Alistair Buxton (a-j-buxton) wrote :

Oh and one other thing: the missing .desktops are dated from 2015 and this is an upgrade. Looks like the default panel configuration? Maybe this is a bug in an old xfce4-panel which is now fixed, but leaves behind broken config artifacts?

Sean Davis (bluesabre)
Changed in xfpanel-switch:
status: New → Fix Committed
assignee: nobody → Alistair Buxton (a-j-buxton)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xfpanel-switch - 1.0.7-0ubuntu2

---------------
xfpanel-switch (1.0.7-0ubuntu2) bionic; urgency=medium

  * d/patches/lp1765565.patch:
    - Fix: Fails to save panel settings (LP: #1765565)

 -- Sean Davis <email address hidden> Mon, 23 Apr 2018 21:22:48 -0400

Changed in xfpanel-switch (Ubuntu):
status: New → Fix Released
Sean Davis (bluesabre)
Changed in xfpanel-switch:
status: Fix Committed → Fix Released
Revision history for this message
C. Jeffery Small (loyhz2ay-jeff-h670zbts) wrote :
Download full text (4.8 KiB)

I'm on Xubuntu 19.04, fully patched with xfpanel-switch version 1.0.7-ubuntu2 and I'm having the same or similar problem as noted by the original reporter. When I start xfpanel-switch manually, here are the errors reported upon startup, when the first save configuration is pressed, and finally when Save Configuration is selected from the pop-up menu. This may have existed in 18.10 (I don't know) but I upgraded to 19.04 recently. The last saved config is labeled Xubuntu Disco from 08-21-19. I cannot remember if I made this manually or if it was done automatically as part of the upgrade.

234-> xfpanel-switch
/usr/share/xfpanel-switch/xfpanel-switch/xfpanel-switch.py:132: DeprecationWarning: Gtk.Widget.override_background_color is deprecated
  self.xfce_header.override_background_color(0, base_color[1])
/usr/share/xfpanel-switch/xfpanel-switch/xfpanel-switch.py:134: DeprecationWarning: Gtk.Widget.override_color is deprecated
  self.xfce_header.override_color(0, fg_color[1])

[press save configuration button]

/usr/share/xfpanel-switch/xfpanel-switch/xfpanel-switch.py:309: PyGTKDeprecationWarning: The keyword(s) "message_format" have been deprecated in favor of "text" respectively. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  _("Save Configuration"), Gtk.ResponseType.ACCEPT))
/usr/share/xfpanel-switch/xfpanel-switch/xfpanel-switch.py:309: PyGTKDeprecationWarning: The "buttons" argument must be a Gtk.ButtonsType enum value. Please use the "add_buttons" method for adding buttons. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  _("Save Configuration"), Gtk.ResponseType.ACCEPT))

[press Save Configuration to make backup from pop-up menu]

Traceback (most recent call last):
  File "/usr/share/xfpanel-switch/xfpanel-switch/xfpanel-switch.py", line 221, in on_save_clicked
    self.save_configuration(name)
  File "/usr/share/xfpanel-switch/xfpanel-switch/xfpanel-switch.py", line 209, in save_configuration
    PanelConfig.from_xfconf(self.xfconf).to_file(filename)
  File "/usr/share/xfpanel-switch/xfpanel-switch/panelconfig.py", line 65, in from_xfconf
    pc.find_desktops()
  File "/usr/share/xfpanel-switch/xfpanel-switch/panelconfig.py", line 148, in find_desktops
    self.remove_keys(rem_keys)
  File "/usr/share/xfpanel-switch/xfpanel-switch/panelconfig.py", line 155, in remove_keys
    del self.properties[param]
KeyError: '/plugins/plugin-48'

Nothing happens and nothing is saved. An attempt to export the configuration fails as follows:

[press the export button]

/usr/share/xfpanel-switch/xfpanel-switch/xfpanel-switch.py:99: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "title, parent, action, buttons" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  button, Gtk.ResponseType.ACCEPT))
/usr/share/xfpanel-switch/xfpanel-switch/xfpanel-switch.py:99: PyGTKDeprecationWarning: The "buttons" argument must be a Gtk.ButtonsType enum value. Please use the "add_buttons" method for adding buttons. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  button, Gtk.ResponseTyp...

Read more...

Revision history for this message
Alistair Buxton (a-j-buxton) wrote :

Can you please open a new bug for that? It is different from the original issue.

Revision history for this message
enebre (enebre) wrote :

I also have the problem of not being able to make backups of the panel.
I also see that the bug is revealed, but I don't see how to fix it, I reinstalled the package, but it had no effect.
Have you a solution to offer ?

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.