Cherrytree fails to open, with Python throwing the following stack trace:
Traceback (most recent call last):
File "/usr/bin/cherrytree", line 78, in <module>
f_main(args)
File "/usr/bin/cherrytree", line 50, in f_main
main.main(args)
File "/usr/share/cherrytree/modules/main.py", line 235, in main
CherryTreeHandler(args, lang_str)
File "/usr/share/cherrytree/modules/main.py", line 74, in __init__
self.window_open_new(args.filepath, args.node, True, True if args.filepath else False)
File "/usr/share/cherrytree/modules/main.py", line 79, in window_open_new
window = core.CherryTree(self.lang_str, filepath, node_name, self, is_startup, is_arg, False)
File "/usr/share/cherrytree/modules/core.py", line 249, in __init__
self.file_startup_load(open_with_file, node_name)
File "/usr/share/cherrytree/modules/core.py", line 1504, in file_startup_load
self.file_load(os.path.join(self.file_dir, self.file_name))
File "/usr/share/cherrytree/modules/core.py", line 1999, in file_load
if self.xml_handler.dom_to_treestore(cherrytree_string, discard_ids=None):
File "/usr/share/cherrytree/modules/machines.py", line 108, in dom_to_treestore
dom = xml.dom.minidom.parseString(ctd)
File "/usr/lib/python2.7/xml/dom/minidom.py", line 1928, in parseString
return expatbuilder.parseString(string)
File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 940, in parseString
return builder.parseString(string)
File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 223, in parseString
parser.Parse(string, True)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 15305, column 1
Running latest Kali Linux with Python 2.7.14+ and Python 3.6.4rc1
Can you open with a proper text editor such as geany.org, go to line 15305 the message complains about an xml syntax error maybe you can spot and fix, if you send it to me I can have a look
I can't tell what file that line is in. None of the files listed have anything close to 15305 lines. Any ideas?
Can you try to open the document on another operating system and/or try a backup and/or open with an xml editor to try and fix the syntax error
Hi, I'm a regular user of CherryTree.
After update to CherryTree 0.38.4 I can't open MyCherrytree.ctx file.
I'm using Ubuntu 16.04.3 LTS.
Hope this information will help to fix this issue.
How can I downgrade to 0.38.3 version?
I see only cherrytree_0.37.6-1_all.deb before 0.38.4 version on https://www.giuspen.com/cherrytree/#downl
Please try and extract the ctx file with 7zip, you should get a ctb
@giuspen thx for answer.
I've tried it, and I could extract it, so I get MyCherrytree.ctb (.ctx is 737.2 KB, .ctb is 1.2 MB).
But unfortunately CheryTree doesn't open it too :(
In the same time it can open CherryTreeManual.ctb
What else can I do to recover MyCherrytree notebook?
I have 10 backup files (that have been saved automatically by program with "~" signs), but none of them I can open with current version of CherryTree.
And is it possible to install previous version of CherryTree?
Hi Diana, yes you can install older versions but I would leave it as last resort I would try to remove the config.cfg first before running cherrytree, can you locate it?
@giuspen
yep, I found it in /home/[username]/.config/cherrytree/config.cfg and removed it, but sadly, it did not help too :(
I took previous versions from github.com/giuspen/cherrytree/releases
I tried all of them from 0.38.3 up to 0.37.6. And in none of them I can open MyCherrytree.ctx (or .ctb) file :((
Looks, that problem is in smth else. Is it possible that with regular update of my system some libraries (that CherryTree uses) have been updated too, and that cause this problem? Or is it more likely that my file have been corrupted by some strange reason, and it's impossible to recover?
I really hope that there is an option to recover it... Cause this file is like everything for me -- most of my notes are there...
If you run cherrytree from a terminal and open the.ctb, what do you see printed when it fails to open?
Traceback (most recent call last):
File "/home/diasi/Apps/cherrytree-0.38.3/modules/core.py", line 1730, in file_open
self.filepath_open(filepath)
File "/home/diasi/Apps/cherrytree-0.38.3/modules/core.py", line 1780, in filepath_open
self.file_load(filepath)
File "/home/diasi/Apps/cherrytree-0.38.3/modules/core.py", line 1988, in file_load
self.ctdb_handler.read_db_full(self.db, discard_ids=None)
File "/home/diasi/Apps/cherrytree-0.38.3/modules/ctdb.py", line 660, in read_db_full
node_sequence)
File "/home/diasi/Apps/cherrytree-0.38.3/modules/ctdb.py", line 595, in read_db_node_n_children
cherry = self.dad.get_node_icon(node_level, syntax_highlighting, custom_icon_id)
File "/home/diasi/Apps/cherrytree-0.38.3/modules/core.py", line 298, in get_node_icon
stock_id = cons.NODES_STOCKS[custom_icon_id]
KeyError: 50
I just pushed a fix to git. Please checkout the git version and run that, report here how it goes
@giuspen Thanks a lot! It does work now! I can open MyCherrytree.ctx|ctb files
Great. One of you nodes was pointing to a custom icon id that was not existing, I will investigate how that could happen, in the meanwhile in this case a node with no icon is displayed
Oh, gosh!
I've just remembered that ones (several months ago) I've tried to add some extra nodes... So, it should be my fault that it was added smth extra in cons module, and after used in my cherrytree file, so that's why it got be broken for normal version of cherrytree after automatic update... And I completely forget about it.
I'm so sorry to disturb you with this! And thanks a lot for your quick help!
// Btw, is it possible to make isons for nodes bigger? I have 4k screen resolution, and with default icon size it's very hard to see icons. I suppose it was the reason why I tried to do smth with nodes...)
And is possible to add normally new icons for nodes?)
I'm a learner for Python language so if you can guide me then maybe I can try make those fixes by myself :)
The app is being ported to C++ actually and at that point I will support higher resolution icons. Currently the only way to add new icons is editing the code as you made already.
@giuspen Oh, I see, thx for answer.
Btw, why did you decide to port it to C++?
_(Sorry for off-top. As I said I learn Python and also I'm trying to understand where it is useful except Data Science field. And also curios what technology stack to choose for myself to be in-demand developer)_
Python is a very good choice as a language. I'm steering away in cherrytree because I need to stick with GTK libraries to give continuity to some key features but the Python bindings are unreliable and support is poor. GTK is native in C and consequently C++.
@giuspen Oh, I understand! Thx for explaining :)
I am having the same issue. I have the latest version 38.4 and cannot open my existing notes. Can you push a fix if you already know the issue?
I am using it on windows.
@giuspen everytime I open cherry tree it shows it trying to open the last file and application never opens. I believe its the same node issue you fixed earlier in the thread. Can you please update the fix for windows?
That was not a real issue, the code was changed from the user to add new custom icons not supported, if you didn't do the same it's a different issue. Can you try to run cherrytree from Python code aa described in the development section?
Thanks for your response. I was able to solve the issue by adding config.cfg file to bin.
I was looking for config file and realised it wasent there so created one. Cherry tree works fine after that.
Have a wonderful day!
I use CherryTree on a windows 10 machine. However, since today the application is not opening. It open and then immediately goes to the task bar. Later it does not appear on the screen. I have tried reinstalling it and using the portable version but to no affect.
Can you please advise the best course of action.

@ahsaniftikharqureshi after being sure that cherrytree is not running (kill it if needed) edit your config.cfg and change to systray = False
@ahsaniftikharqureshi after being sure that cherrytree is not running (kill it if needed) edit your config.cfg and change to
systray = False
Thanks for the reply. Can you please advise the location of config.cfg file. I can't seem to find in the C:Program Files (x86)CherryTree folder.
Thanks in advance.
Look in %appdata%cherrytree
Look in %appdata%cherrytree
Thanks a lot for your kind guidance. It was resolved and I was able to open the file.
Hello everybody!
I have a similar problem with a *.ctb file that I copied to an external unit and it's failing to open in the new cherrytree instance.
I'm running 38.8 in Kali, and I'm getting this error form terminal:
_root@leokali:~/Downloads# cherrytree Blue40.ctb
Traceback (most recent call last):
File "/usr/bin/cherrytree", line 78, in
f_main(args)
File "/usr/bin/cherrytree", line 50, in f_main
main.main(args)
File "/usr/share/cherrytree/modules/main.py", line 248, in main
CherryTreeHandler(args, lang_str)
File "/usr/share/cherrytree/modules/main.py", line 83, in __init__
self.window_open_new(args.filepath, args.node, True, True if args.filepath else False)
File "/usr/share/cherrytree/modules/main.py", line 88, in window_open_new
window = core.CherryTree(self.lang_str, filepath, node_name, self, is_startup, is_arg, False)
File "/usr/share/cherrytree/modules/core.py", line 252, in __init__
self.file_startup_load(open_with_file, node_name)
File "/usr/share/cherrytree/modules/core.py", line 1500, in file_startup_load
self.file_load(os.path.join(self.file_dir, self.file_name))
File "/usr/share/cherrytree/modules/core.py", line 2002, in file_load
self.ctdb_handler.read_db_full(self.db, discard_ids=None)
File "/usr/share/cherrytree/modules/ctdb.py", line 644, in read_db_full
bookmarks_rows = db.execute('SELECT * FROM bookmark ORDER BY sequence ASC').fetchall()
sqlite3.DatabaseError: database disk image is malformed_
The thing is frightening me the most is the last line: "database disk image malformed", because I'm trying at this point to recover from a crash in my Kali and I'm actually trying to open cherrytree from a previous snapshot (VMware Fusion).
So at this point, I don't know if the Linux is the issue or the file.
Any pointers?
UPDATE: I tried to run the same file in another Linux (with 38.8) and I have the same result as above.
do you have the three time based backups in the same directory of the .ctb document but with extensions .ctb~ .ctb~~ .ctb~~~ (you need to enable show hidden files in your file manager, usually Ctrl+H) - try copying those in another dir and remove the trailing tildes then open with cherrytree
Giuseppe ti amo!
Grazie per il suggerimento
The one with the double tilde (~~) was the one that actually had the backup at 100%.
@ahsaniftikharqureshi after being sure that cherrytree is not running (kill it if needed) edit your config.cfg and change to
systray = False
Hi, giuspen
I found that I checked the 'miscellaneous'>'System Tray'> 'Enable system tray docking'. CherryTree cannot display any data. When I seen this post, I try to disable it, it worked! thank you!
P.S. My OS is WIN10
Most helpful comment
@ahsaniftikharqureshi after being sure that cherrytree is not running (kill it if needed) edit your config.cfg and change to
systray = False