CherryTree Issue after moving to usb

Home Forums cherrytree CherryTree Issue after moving to usb

Tagged: 

This topic contains 9 replies, has 2 voices, and was last updated by  acry 1 month ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #125096

    Hello all,

    I copied the .ctb file from my laptop (4.18.0-kali2-amd64 #1 SMP Debian 4.18.10-2kali1 (2018-10-09) x86_64 GNU/Linux) to usb. From the usb I then transferred the files back to my laptop. Even though the file still shows that has contents of 25MB running the cherrytree from my terminal shows the following errors:
    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 247, 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

    I tried to convert the file to .sql and then back to sqlite3 but no luck.
    Any ideas?

    #125107

    acry
    Member

    Hi, CTB is an sqlite3 file, just with the extension .ctb. Can you open the file with sqlitebrowser?

    file C-KDB.ctb
    C-KDB.ctb: SQLite 3.x database, last written using SQLite version 3025002

    Do have have a backup by any chance?

    Cheers,
    Acry aka Cass

    #125108

    acry
    Member

    Oh and you can check the integrity with:
    sqlite3 C-KDB.ctb "PRAGMA integrity_check"
    ok should be the right output

    #125109

    acry
    Member

    You can also try fixing a malformed db with:
    echo '.dump'|sqlite3 your_ctb.ctb|sqlite3 your_ctb_dumped.ctb
    And then try to open the dumped.ctb.

    #125110

    I opened the file with sqlite3 browser and displays the following error.:
    “*** in database main ***
    Main freelist: invalid page number -1
    Page 9: btreeInitPage() returns error code 11
    Page 10: btreeInitPage() returns error code 11
    Page 7: btreeInitPage() returns error code 11
    Page 8: btreeInitPage() returns error code 11
    Page 6: btreeInitPage() returns error code 11
    Page 5: btreeInitPage() returns error code 11
    Page 4: btreeInitPage() returns error code 11
    Page 2: btreeInitPage() returns error code 11
    Page 3: btreeInitPage() returns error code 11
    Page 11 is never used
    Page 12 is never used
    Page 13 is never used
    Page 14 is never used
    Page 15 is never used
    Page 16 is never used
    Page 17 is never used
    Page 18 is never used
    Page 19 is never used
    Page 20 is never used
    Page 21 is never used
    Page 22 is never used
    Page 23 is never used
    Page 24 is never used
    Page 25 is never used
    Page 26 is never used
    Page 27 is never used
    Page 28 is never used
    Page 29 is never used
    Page 30 is never used
    Page 31 is never used
    Page 32 is never used
    Page 33 is never used
    Page 34 is never used
    Page 35 is never used
    Page 36 is never used
    Page 37 is never used
    Page 38 is never used
    Page 39 is never used
    Page 40 is never used
    Page 41 is never used
    Page 42 is never used
    Page 43 is never used
    Page 44 is never used
    Page 45 is never used
    Page 46 is never used
    Page 47 is never used
    Page 48 is never used
    Page 49 is never used
    Page 50 is never used
    Page 51 is never used
    Page 52 is never used
    Page 53 is never used
    Page 54 is never used
    Page 55 is never used
    Page 56 is never used
    Page 57 is never used
    Page 58 is never used
    Page 59 is never used
    Page 60 is never used
    Page 61 is never used
    Page 62 is never used
    Page 63 is never used
    Page 64 is never used
    Page 65 is never used
    Page 66 is never used
    Page 67 is never used
    Page 68 is never used
    Page 69 is never used
    Page 70 is never used
    Page 71 is never used
    Page 72 is never used
    Page 73 is never used
    Page 74 is never used
    Page 75 is never used
    Page 76 is never used
    Page 77 is never used
    Page 78 is never used
    Page 79 is never used
    Page 80 is never used
    Page 81 is never used
    Page 82 is never used
    Page 83 is never used
    Page 84 is never used
    Page 85 is never used
    Page 86 is never used
    Page 87 is never used
    Page 88 is never used
    Page 89 is never used
    Page 90 is never used
    Page 91 is never used
    Page 92 is never used
    Page 93 is never used
    Page 94 is never used
    Page 95 is never used
    Page 96 is never used
    Page 97 is never used
    Page 98 is never used
    Page 99 is never used
    Page 100 is never used”

    after that I exported the files as .sql and then imported the new file.
    Same Issue.

    After running the .dump command the results are:
    PRAGMA foreign_keys=OFF;
    BEGIN TRANSACTION;
    COMMIT;

    It seems like the database is empty. But the size shown is 23.5MB.

    Thanks. (no backups unfortunately)

    #125111

    Unless if you mean the backup files .ctb~ , .ctb~~, .ctb~~. All of them are corrupted as well

    #125112

    acry
    Member

    I am sorry.
    Looks like your notes are lost.
    And the CT files are the only one that are corrupt?
    My first guess would be a defect USB-Stick.

    You can check it like here:
    https://superuser.com/a/376278

    #125113

    acry
    Member

    did you unmount your stick after cp/mv?

    #125114

    My thought as well. Yes, I ejected the usb after the transfer was done.

    Thank you for your reply I will check the usb

    #125115

    acry
    Member

    No worries, I feel your pain. I am using CT for a long time really intense.
    I have my whole C knowledge data base with more than 3.3k nodes in a ctb.
    Think I should work on a cloud auto save. Currently I work paid on CT features. And personally I think CT is pretty good compared to similar software.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.