gtg
gtg copied to clipboard
Issue starting flatpak on Fedora 36
Hey, was just opening program and saw this happen:
Context: Startup
Traceback (most recent call last):
File "/app/lib/python3.9/site-packages/GTG/gtk/application.py", line 110, in do_startup
for backend_dic in BackendFactory().get_saved_backends_list():
File "/app/lib/python3.9/site-packages/GTG/backends/__init__.py", line 143, in get_saved_backends_list
module = self.get_backend(settings.get('module'))
File "/app/lib/python3.9/site-packages/GTG/core/config.py", line 164, in get
raise ValueError(
ValueError: No valid configuration value or default value was found for %s in %s
Software versions:
- Getting Things GNOME! v0.6
- CPython 3.9.9 (main, Nov 10 2011, 15:00:00) [GCC 11.3.0]
- GTK 3.24.33, GLib 2.72.1
- PyGLib 3.42.1, PyGObject 3.42.1
- Linux-5.17.6-300.fc36.x86_64-x86_64-with-glibc2.33
Is flatpak:
$ flatpak info org.gnome.GTG
Getting Things GNOME! - Personal tasks and TODO-list items organizer
ID: org.gnome.GTG
Ref: app/org.gnome.GTG/x86_64/stable
Arch: x86_64
Branch: stable
Version: 0.6
License: GPL-3.0
Origin: flathub
Collection: org.flathub.Stable
Installation: system
Installed: 8.7 MB
Runtime: org.gnome.Platform/x86_64/42
Sdk: org.gnome.Sdk/x86_64/42
Commit: a2669e5e6c32eb5f7392619c03580b6646f50d39778576ac03de05385440fef2
Parent: a48d70f74f2df27215f365840a928e714193ee9779a65b93bb4669f9d02f74ee
Subject: Update runtime to GNOME 42 (0f43a023)
Date: 2022-05-03 02:47:24 +0000
Fedora release info:
$ \cat /etc/os-release && \cat /etc/redhat-release && uname -a && lsb_release -a
NAME="Fedora Linux"
VERSION="36 (Workstation Edition)"
ID=fedora
VERSION_ID=36
VERSION_CODENAME=""
PLATFORM_ID="platform:f36"
PRETTY_NAME="Fedora Linux 36 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:36"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f36/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=36
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=36
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation
Fedora release 36 (Thirty Six)
Linux treygouty 5.17.6-300.fc36.x86_64 #1 SMP PREEMPT Mon May 9 15:47:11 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: Fedora
Description: Fedora release 36 (Thirty Six)
Release: 36
Codename: ThirtySix
I just tried updating all the flatpaks, there were outdated runtimes, and ran flatpak repair, and still got the same error message.
It looks like a python 3.9 error. I notice python version incompatibilities cause errors quite frequently, might just want to stick a copy of tested python version in the flatpak going forward (?)
Hope this report helps. Thanks for everything!
Hey! Flatpak is running for me on F36. Same version. @averyfreeman are you still experiencing this issue?
BTW now that upstream is not dead but maintained, we can think about unretiring the RPM package.
@averyfreeman could your issue be #683 by any chance?
@gombosg for the Fedora RPM packaging, we'd be happy to see that happen, see also the work that some people had started in #709, maybe you can help there?
Nope, I had uninstalled it because I couldn't get through startup. I just installed it again as a user flatpak from flathub, same error:
**Context:** Startup
```python-traceback
Traceback (most recent call last):
File "/app/lib/python3.9/site-packages/GTG/gtk/application.py", line 110, in do_startup
for backend_dic in BackendFactory().get_saved_backends_list():
File "/app/lib/python3.9/site-packages/GTG/backends/__init__.py", line 143, in get_saved_backends_list
I noticed I was having an issue opening remmina flatpak, too, which I hadn't in the past. Seemed to alleviate the problem by enabling access to system libraries. I'm on a new installation of F36 and have been installing all my flatpaks as user to make migrating easier.
Another thing I noticed is the system python version is 3.10 while GTG is looking for 3.9.
As an added info, my system Python version is 3.10.4, too, and GTG is working fine.
@averyfreeman let's rule out Python version issues:
- Run GTG
- While running
flatpak enter org.gnome.GTG bash
-
python --version
For me it's 3.9.9!
If it's not Python version, then it can be some config reading isse? 🤔
Sorry for lateness of reply, haven't been on GH in a while.
I'm really not sure tbh, I have a vanilla Fedora 36 installation, so there's nothing extraordinary I've done with the system that would suggest it should respond differently than anyone else's.
org.gnome.GTG
is installed as user now, I've been moving flatpaks to user folder to prepare for cases of migration or disaster recovery, did not change issue.
I've run a general flatpak repair
at least a few times since I opened this issue. Maybe there's a cache folder I can try and clean out somewhere? Or does flatpak repair
do this? (I'm new to Fedora and flatpaks in general, so not familiar with how it works).
Hi @averyfreeman, I'm starting to suspect this might be the same issue as #845. Could you see if this has anything to do with your session keyring not being unlocked or being inaccessible somehow?
Hi @averyfreeman, I'm starting to suspect this might be the same issue as #845. Could you see if this has anything to do with your session keyring not being unlocked or being inaccessible somehow?
Hello, sorry for the late reply. I have no idea why it would be related to my keyring being inaccessible when everything else but GTG works without issue.
I don't know much about the keyring, but I did notice permissions look pretty open:
$ ls -la /run/user/1000/keyring
total 0
drwx------ 2 avery avery 120 Jul 28 01:37 .
drwx------ 22 avery avery 640 Jul 24 19:37 ..
srwxrwxr-x 1 avery avery 0 Jul 28 01:37 control
srwxrwxr-x 1 avery avery 0 Jul 28 01:37 pkcs11
srw------- 1 avery avery 0 Jul 24 18:59 .ssh
srwxrwxr-x 1 avery avery 0 Jul 28 01:37 ssh
I tried running gnome-keyring-daemon --daemonize --login
, went to another window and ran ps -A | grep gnome-keyring
, and there were two instances of gnome-keyring-daemon
running. Killed the one I started manually, and there was still one.
So, hopefully that answers your question a bit. I did some poking around inside the flatpak at the code referenced in the error, it looks to me like maybe it's related to the first-run file that's created, as I still had this file from a previous installation, but not the backends.conf
. So, I had an old gtg_data.xml
, but the backends.conf
file that looks like it was created on first run.
I tried renaming gtg_data.xml
to see if GTG would initialize a new copy, but I still get the same error.
I went through my tracks a bit before writing this synopsis. Not sure if this data is particularly relevant, but I thought I'd include it just in case:
[earlier] I will invest some time in helping, I hope it's fruitful. I thought I should start by making sure I am operating an up-to-date flatpak:
$ flatpak -v update org.gnome.GTG
F: No installations directory in /etc/flatpak/installations.d. Skipping
F: Opening system flatpak installation at path /var/lib/flatpak
F: Opening user flatpak installation at path /home/avery/.local/share/flatpak
Looking for updates…
F: Fetching summary index file for remote ‘flathub’
F: Loading https://dl.flathub.org/repo/summary.idx using libsoup
F: Received 2737 bytes
F: Loaded indexed summary file 0e6169d3ff06d8c17baf833288397747036ec3a5007634e051bc82ae09ae8d4b from cache for remote ‘flathub’
F: Transaction: update flathub:app/org.gnome.GTG/x86_64/stable[*]
F: Looking for remote metadata updates for flathub
F: marking op update:app/org.gnome.GTG/x86_64/stable resolved to 286857f5d6032c21865dd85860ca9e68434ae2473977f45588cdc99233f2326c
F: Updating dependent runtime org.gnome.Platform/x86_64/41
F: Transaction: update flathub:runtime/org.gnome.Platform/x86_64/41[$old]
F: marking op update:runtime/org.gnome.Platform/x86_64/41 resolved to 21229f01c7a6d263cb1a86d04368daf669a5d957b74436c910c83205cebf8bb0
F: Transaction: install/update flathub:runtime/org.gnome.Platform.Locale/x86_64/41[/en]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.GL.default/x86_64/21.08[*]
F: Transaction: install/update flathub:runtime/org.gtk.Gtk3theme.Adwaita-dark/x86_64/3.22[*]
F: Transaction: install/update flathub:runtime/org.gtk.Gtk3theme.adw-gtk3-dark/x86_64/3.22[*]
F: Transaction: install/update flathub:runtime/org.gtk.Gtk3theme.adw-gtk3/x86_64/3.22[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.VAAPI.Intel/x86_64/21.08[*]
F: Transaction: install/update flathub:runtime/org.freedesktop.Platform.openh264/x86_64/2.0[*]
F: Transaction: install/update flathub:runtime/org.gnome.GTG.Locale/x86_64/stable[/en]
F: marking op install/update:runtime/org.gnome.GTG.Locale/x86_64/stable resolved to 457a5ccc474b2536b56645dcdbda15c6cb22dc3f87b030f06d7d3257bde8b1e6
F: marking op install/update:runtime/org.freedesktop.Platform.openh264/x86_64/2.0 resolved to 73f998362a6fc0d57e0c7e83e928d32b0ec14d10d0d94291033976bdcecc6b6b
F: marking op install/update:runtime/org.freedesktop.Platform.VAAPI.Intel/x86_64/21.08 resolved to 220a09d5db7ea43c8dad1d3f6ab564832ebaf3201650ba03820d2848215894b3
F: marking op install/update:runtime/org.gtk.Gtk3theme.adw-gtk3/x86_64/3.22 resolved to 80ae432cb1a5928365088ce724751b0e8a7767b654608575c3cc647adce5f073
F: marking op install/update:runtime/org.gtk.Gtk3theme.adw-gtk3-dark/x86_64/3.22 resolved to 71e861fa805f26355471a89f8f8cbb56c811675f7d0cea5ca6dea245fee70957
F: marking op install/update:runtime/org.gtk.Gtk3theme.Adwaita-dark/x86_64/3.22 resolved to 7c055bbc0667524f34ca715abd67473480de93a176797a8fe4b7f7a71c4e3324
F: marking op install/update:runtime/org.freedesktop.Platform.GL.default/x86_64/21.08 resolved to c8f81b502d8a867a532896330988485f68e94a2cbb4c26ae98b1b2811b566f7e
F: marking op install/update:runtime/org.gnome.Platform.Locale/x86_64/41 resolved to 92a060a3f481f72f34efadbdfdfe8ad7336e539598a43ba33b857771767278f8
Nothing to do.
$ flatpak run org.gnome.GTG --version
GTG (Getting Things GNOME!) v0.6
Using python 3.9.9 (main, Nov 10 2011, 15:00:00)
[GCC 11.3.0]
For more information: https://wiki.gnome.org/Apps/GTG
Looks good. So then, let's just run it and see if invoking it still produces the error on this new version:
$ flatpak run org.gnome.GTG
2022-07-28 00:16:38,883 - ERROR - application:do_startup:135 - Exception during startup
Traceback (most recent call last):
File "/app/lib/python3.9/site-packages/GTG/gtk/application.py", line 110, in do_startup
for backend_dic in BackendFactory().get_saved_backends_list():
File "/app/lib/python3.9/site-packages/GTG/backends/__init__.py", line 143, in get_saved_backends_list
module = self.get_backend(settings.get('module'))
File "/app/lib/python3.9/site-packages/GTG/core/config.py", line 164, in get
raise ValueError(
ValueError: No valid configuration value or default value was found for %s in %s
I had not been aware of any manual configuration required outside of the direction of the GUI for GTG. Therefore, any changes in the config files are the result of my use of the GUI, or during installation.
Here's these configuration files for your reference:
$ pwd; ls -la; for i in *.conf; do \cat $i; done
/home/avery/.var/app/org.gnome.GTG/config/gtg
total 12
drwxr-xr-x. 1 avery avery 62 Apr 7 17:01 .
drwxr-xr-x. 1 avery avery 14 May 23 15:19 ..
-rw-r--r--. 1 avery avery 432 Apr 8 13:16 backends.conf
-rw-r--r--. 1 avery avery 339 Apr 8 13:16 gtg.conf
-rw-r--r--. 1 avery avery 864 Apr 7 17:12 tasks.conf
# backends.conf:
[backend_localfile]
first_run = True
default = True
human-friendly-name =
user =
pid = f6efc2d3-18f3-48ed-b3e4-0c202852822c
enabled = True
attached-tags = gtg-tags-all
path = gtg_data.xml
module = backend_localfile
[backend_caldav]
first_run = True
default = False
human-friendly-name =
user =
pid = c04bb4bd-233c-4f00-b29e-369da34e04ff
enabled = False
attached-tags = gtg-tags-all
period = 15
username = insert your username
# gtg.conf:
[browser]
tasklist_sort_column = 2
tasklist_sort_order = 1
width = 812
height = 513
maximized = False
x_pos = 23
y_pos = 15
opened_tasks =
view = active
tag_pane = True
collapsed_tasks = ('33d9760d-2e07-4ae4-9c02-1fcdaeb46325',)
[plugins]
disabled = dev_console,export,gamify,hamster,send_email,untouched_tasks,urgency_color
enabled =
# tasks.conf - truncated because looks irrelevant, but the entries are all like this:
[e656e527-fc45-4196-ba96-7c99f7555aa9]
position = 23,15
size = 597,400
. . .
org.gnome.GTG
did work when I first tried it, but I uninstalled and re-installed it when it started producing these errors and failing to run, so I am guessing the previous configuration didn't survive the uninstallation.
Not sure why any of the .conf
files would produce configuration error if they are from a fresh install.
Poking around inside the flatpak:
[📦 org.gnome.GTG backends]$ cat -n /app/lib/python3.9/site-packages/GTG/core/config.py
1 # -----------------------------------------------------------------------------
2 # Getting Things GNOME! - a personal organizer for the GNOME desktop
3 # Copyright (c) 2008-2015 - Lionel Dricot & Bertrand Rousseau
4 #
5 # This program is free software: you can redistribute it and/or modify it under
6 # the terms of the GNU General Public License as published by the Free Software
7 # Foundation, either version 3 of the License, or (at your option) any later
8 # version.
9 #
10 # This program is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 # details.
14 #
15 # You should have received a copy of the GNU General Public License along with
16 # this program. If not, see <http://www.gnu.org/licenses/>.
17 # -----------------------------------------------------------------------------
18
19 """
20 Classes responsible for handling user configuration
21 """
22
23 import configparser
24 import os
25 import re
26 import logging
27
28 from GTG.core.dirs import CONFIG_DIR
29
30 log = logging.getLogger(__name__)
31 DEFAULTS = {
32 'browser': {
33 "bg_color_enable": True,
34 "contents_preview_enable": False,
35 'tag_pane': False,
36 "sidebar_width": 120,
37 'collapsed_tasks': [],
38 'expanded_tags': [],
39 'view': 'default',
40 "opened_tasks": [],
41 'width': 400,
42 'height': 400,
43 'x_pos': 10,
44 'y_pos': 10,
45 'tasklist_sort_column': 5,
46 'tasklist_sort_order': 1,
47 "font_name": "",
48 'hour': "00",
49 'min': "00",
50 'autoclean': True,
51 'autoclean_days': 30,
52 'dark_mode': False,
53 'maximized': False,
54 },
55 'tag_editor': {
56 "custom_colors": [],
57 },
58 'plugins': {
59 "enabled": [],
60 "disabled": [],
61 },
62 'task': {
63 'position': [],
64 'size': [],
65 },
66 'backend': {}
67 }
68
69
70 def open_config_file(config_file):
71 """ Opens config file and makes additional checks
72
73 Creates config file if it doesn't exist and makes sure it is readable and
74 writable by user. That prevents surprise when user is not able to save
75 configuration when exiting the app.
76 """
77 dirname = os.path.dirname(config_file)
78 if not os.path.exists(dirname):
79 os.makedirs(dirname)
80 if not os.path.exists(config_file):
81 open(config_file, "w").close()
82 if not os.access(config_file, os.R_OK | os.W_OK):
83 raise Exception("File " + config_file + " is a configuration file "
84 "for gtg, but it cannot be read or written. "
85 "Please check it")
86 config = configparser.ConfigParser()
87 try:
88 config.read(config_file)
89 except configparser.Error as e:
90 log.warning("Problem with opening file %s: %s", config_file, e)
91 return config
92
93
94 class SectionConfig():
95 """ Configuration only for a section (system or a task) """
96
97 def __init__(self, section_name, section, defaults, save_function):
98 """ Initiatizes section config:
99
100 - section_name: name for writing error logs
101 - section: section of the config handled by this object
102 - defaults: dictionary of default values
103 - save_function: function to be called to save changes (this function
104 needs to save the whole config)
105 """
106 self._section_name = section_name
107 self._section = section
108 self._defaults = defaults
109 self._save_function = save_function
110
111 def _getlist(self, option):
112 """ Parses string representation of list from configuration
113
114 List can't contain an empty value as those are skipped over,
115 e.g. "a, ,b" is parsed as ['a', 'b'].
116
117 Accepted formats:
118 - "('a', 'b'),('c','d','e')" => ["('a', 'b')", "('c','d','e')"]
119 - "a, b" => ['a', 'b']
120 """
121 raw = self._section.get(option)
122 if not raw:
123 return None
124
125 # Match tuples in format "('string1', 'string2', ...)"
126 values = re.findall(r'\(.*?\)', raw)
127 if not values:
128 # It only normal list
129 values = raw.split(',')
130
131 return [item.strip() for item in values if item]
132
133 def _type_function(self, default_value):
134 """ Returns function that returns correct type of value """
135 default_type = type(default_value)
136 if default_type in (list, tuple):
137 return self._getlist
138 elif default_type == int:
139 return self._section.getint
140 elif default_type == bool:
141 return self._section.getboolean
142 else:
143 return self._section.get
144
145 def get(self, option):
146 """ Get option from configuration.
147
148 If the option is not specified in the configuration or is of invalid
149 type, return default value. If there is no default value,
150 None is returned
151 """
152 default_value = self._defaults.get(option)
153 get_function = self._type_function(default_value)
154
155 try:
156 value = get_function(option)
157 except ValueError as error:
158 value = None
159 log.warning('Invalid configuration value "%s" for %s in %s: %s',
160 self._section.get(option), option, self._section_name,
161 error)
162
163 if value is None and default_value is None:
164 raise ValueError(
165 'No valid configuration value or default value was '
166 'found for %s in %s'.format(option, self._section_name))
167 elif value is None:
168 return default_value
169 else:
170 return value
171
172 def set(self, option, value):
173 if type(value) in (list, tuple):
174 value = ','.join(str(item) for item in value)
175 else:
176 value = str(value)
177 self._section[option] = value
178 # Immediately save the configuration
179 self.save()
180
181 def save(self):
182 self._save_function()
183
184
185 class CoreConfig():
186 """ Class holding configuration to all systems and tasks """
187
188 def __init__(self):
189 self._conf_path = os.path.join(CONFIG_DIR, 'gtg.conf')
190 self._conf = open_config_file(self._conf_path)
191
192 self._task_conf_path = os.path.join(CONFIG_DIR, 'tasks.conf')
193 self._task_conf = open_config_file(self._task_conf_path)
194
195 self._backends_conf_path = os.path.join(CONFIG_DIR, 'backends.conf')
196 self._backends_conf = open_config_file(self._backends_conf_path)
197
198 def save_gtg_config(self):
199 self._conf.write(open(self._conf_path, 'w'))
200
201 def save_task_config(self):
202 self._task_conf.write(open(self._task_conf_path, 'w'))
203
204 def save_backends_config(self):
205 self._backends_conf.write(open(self._backends_conf_path, 'w'))
206
207 def get_subconfig(self, name):
208 """ Returns configuration object for special section of config """
209 if name not in self._conf:
210 self._conf.add_section(name)
211 defaults = DEFAULTS.get(name, dict())
212 return SectionConfig(
213 name, self._conf[name], defaults, self.save_gtg_config)
214
215 def get_task_config(self, task_id):
216 if task_id not in self._task_conf:
217 self._task_conf.add_section(task_id)
218 return SectionConfig(
219 f'Task {task_id}',
220 self._task_conf[task_id],
221 DEFAULTS['task'],
222 self.save_task_config)
223
224 def get_all_backends(self):
225 return self._backends_conf.sections()
226
227 def get_backend_config(self, backend):
228 if backend not in self._backends_conf:
229 self._backends_conf.add_section(backend)
230
231 return SectionConfig(
232 f'Backend {backend}',
233 self._backends_conf[backend],
234 DEFAULTS['backend'],
235 self.save_backends_config)
[📦 org.gnome.GTG backends]$
Inside the backends.conf
under the [backend_caldav]
line can you add a new line with module = backend_caldav
and try again?
Actually, it seems stuff like server and username hasn't been filled out yet, so it should be no problem to remove the entire [backend_caldav]
section in backends.conf
:
[backend_caldav]
# module = backend_caldav (if you have inserted this)
first_run = True
default = False
human-friendly-name =
user =
pid = c04bb4bd-233c-4f00-b29e-369da34e04ff
enabled = False
attached-tags = gtg-tags-all
period = 15
username = insert your username
Duplicate of #845