llewelld / harbour-contrac

An implementation of the Apple/Google Exposure Notification specification for Sailfish OS.
GNU General Public License v2.0
28 stars 5 forks source link

errors when saving keys are ignored #61

Closed schmittlauch closed 3 years ago

schmittlauch commented 3 years ago

After rebooting my phone, I discovered that all of my sent keys appeared to be gone, as well as the downloaded infection keys.

Bildschirmfoto_20201021_001

After deleting (actually moving) ~/.config/contracd, ~/.config/harbour-contrac and ~/.local/share/harbour-contrac the keys seem to survive reboots.

As I have been using contrac since the Alpha releases, I suspect that at some point data structures or file permissions changed in a way preventing the keys to be persisted successfully. While this is unfortunate – it keys of more than a week for me – the real issue is that these write errors are ignored. Instead they should cause error messages/ notifications, at least indicating that something is wrong.

As I still have the old directories around I can provide details about their files and permissions if desired.

device: FxTec Pro1 Sailfish OS: 3.3.0.18

llewelld commented 3 years ago

Thanks for this info, I'll need to check this out, because you're correct that there ought to be (but almost certainly aren't) clear warnings displayed if the files can't be saved correctly.

Just for info, the following are the different configuration locations.

  1. ~/.config/contracd/contracd.conf contains the info needed if you ever get a positive diagnosis (all of the keys you transmit are derived from the tracingKey in there).
  2. ~/.config/contracd/contracd/contacts/ contains files which hold the 14-days'-worth of keys from other people you've been in contact with.
  3. ~/.local/share/harbour-contrac caches the keys downloaded from the server. They'll be downloaded again if they get deleted.
  4. ~/.config/harbour-contrac/harbour-contrac.conf are mostly configuration values which also come from the server. It's best if this doesn't get deleted, but too serious if it does.

So 1 and 2 are the really important things to keep. It's also true that the early alpha versions used different directories, and these could well be left over on your device I'm afraid.

schmittlauch commented 3 years ago

FYI: directory listing of the problematic data

```console $ ls -lR ~/.config/contracd.old/ /home/nemo/.config/contracd.old/: total 24 drwxrwxrwx 2 nemo privileg 4096 Sep 2 12:12 contacts drwxrwxrwx 3 nemo privileg 4096 Aug 24 18:37 contracd -rw-rw-rw- 1 nemo privileg 244 Oct 21 16:13 contracd.conf -rw-rw-rw- 1 nemo privileg 249 Oct 21 16:11 contracd.conf.Lh6986 -rw-rw-rw- 1 nemo privileg 197 Sep 2 18:06 contracd.conf.XM6776 -rw-rw-rw- 1 nemo privileg 32 Jul 31 03:12 tk.dat /home/nemo/.config/contracd.old/contacts: total 0 -rw-rw-rw- 1 nemo privileg 0 Sep 2 12:12 0000484b.dat /home/nemo/.config/contracd.old/contracd: total 4 drwxrwxrwx 2 nemo privileg 4096 Oct 21 16:13 contacts /home/nemo/.config/contracd.old/contracd/contacts: total 224 -rw-rw-rw- 1 nemo privileg 4104 Oct 9 02:00 0000486f.bloom -rw-rw-rw- 1 nemo privileg 11784 Oct 9 02:00 0000486f.dat -rw-rw-rw- 1 nemo privileg 4104 Oct 10 02:00 00004870.bloom -rw-rw-rw- 1 nemo privileg 15312 Oct 10 02:00 00004870.dat -rw-rw-rw- 1 nemo privileg 4104 Oct 11 02:00 00004871.bloom -rw-rw-rw- 1 nemo privileg 4752 Oct 11 02:00 00004871.dat -rw-rw-rw- 1 nemo privileg 0 Oct 11 02:00 00004872.dat -rw-rw-rw- 1 nemo privileg 0 Oct 12 02:00 00004873.dat -rw-rw-rw- 1 nemo privileg 4104 Oct 14 02:00 00004874.bloom -rw-rw-rw- 1 nemo privileg 1752 Oct 14 02:00 00004874.dat -rw-rw-rw- 1 nemo privileg 4104 Oct 15 02:00 00004875.bloom -rw-rw-rw- 1 nemo privileg 12384 Oct 15 02:00 00004875.dat -rw-rw-rw- 1 nemo privileg 4104 Oct 16 02:00 00004876.bloom -rw-rw-rw- 1 nemo privileg 12024 Oct 16 02:00 00004876.dat -rw-rw-rw- 1 nemo privileg 4104 Oct 17 02:00 00004877.bloom -rw-rw-rw- 1 nemo privileg 10824 Oct 17 02:00 00004877.dat -rw-rw-rw- 1 nemo privileg 4104 Oct 18 02:00 00004878.bloom -rw-rw-rw- 1 nemo privileg 13464 Oct 18 02:00 00004878.dat -rw-rw-rw- 1 nemo privileg 4104 Oct 19 02:03 00004879.bloom -rw-rw-rw- 1 nemo privileg 11136 Oct 19 02:03 00004879.dat -rw-rw-rw- 1 nemo privileg 4104 Oct 20 02:00 0000487a.bloom -rw-rw-rw- 1 nemo privileg 15192 Oct 20 02:00 0000487a.dat -rw-rw-rw- 1 nemo privileg 4104 Oct 21 02:00 0000487b.bloom -rw-rw-rw- 1 nemo privileg 12096 Oct 21 02:00 0000487b.dat -rw-rw-rw- 1 nemo privileg 0 Oct 21 02:00 0000487c.dat $ ls -lR ~/.config/harbour-contrac.old/ /home/nemo/.config/harbour-contrac.old/: total 4 -rw-rw-rw- 1 nemo nemo 770 Oct 21 17:43 harbour-contrac.conf [nemo@Pro1 ~]$ ls -lR ~/.local/share/harbour-contrac harbour-contrac/ harbour-contrac.old/ [nemo@Pro1 ~]$ ls -lR ~/.local/share/harbour-contrac.old/ /home/nemo/.local/share/harbour-contrac.old/: total 4 drwxrwxrwx 3 nemo nemo 4096 Aug 11 00:20 harbour-contrac /home/nemo/.local/share/harbour-contrac.old/harbour-contrac: total 4 drwxrwxrwx 16 nemo nemo 4096 Oct 21 04:28 download /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download: total 60 drwxrwxrwx 2 nemo nemo 4096 Oct 8 10:31 2020-10-07 drwxrwxrwx 2 nemo nemo 4096 Oct 9 02:31 2020-10-08 drwxrwxrwx 2 nemo nemo 4096 Oct 10 04:43 2020-10-09 drwxrwxrwx 2 nemo nemo 4096 Oct 11 03:12 2020-10-10 drwxrwxrwx 2 nemo nemo 4096 Oct 12 01:41 2020-10-11 drwxrwxrwx 2 nemo nemo 4096 Oct 13 03:04 2020-10-12 drwxrwxrwx 2 nemo nemo 4096 Oct 14 02:24 2020-10-13 drwxrwxrwx 2 nemo nemo 4096 Oct 15 02:32 2020-10-14 drwxrwxrwx 2 nemo nemo 4096 Oct 16 03:01 2020-10-15 drwxrwxrwx 2 nemo nemo 4096 Oct 17 03:11 2020-10-16 drwxrwxrwx 2 nemo nemo 4096 Oct 18 01:49 2020-10-17 drwxrwxr-x 2 nemo nemo 4096 Oct 19 03:03 2020-10-18 drwxrwxr-x 2 nemo nemo 4096 Oct 20 03:29 2020-10-19 drwxrwxr-x 2 nemo nemo 4096 Oct 21 04:28 2020-10-20 -rw-rw-rw- 1 nemo nemo 592 Oct 21 17:35 file.config /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download/2020-10-07: total 452 -rw-rw-rw- 1 nemo nemo 475 Oct 8 10:31 0 -rw-rw-rw- 1 nemo nemo 476 Oct 8 10:31 1 -rw-rw-rw- 1 nemo nemo 39706 Oct 8 10:31 10 -rw-rw-rw- 1 nemo nemo 30257 Oct 8 10:31 11 -rw-rw-rw- 1 nemo nemo 28918 Oct 8 10:31 12 -rw-rw-rw- 1 nemo nemo 29379 Oct 8 10:31 13 -rw-rw-rw- 1 nemo nemo 30853 Oct 8 10:31 14 -rw-rw-rw- 1 nemo nemo 27218 Oct 8 10:31 15 -rw-rw-rw- 1 nemo nemo 26016 Oct 8 10:31 16 -rw-rw-rw- 1 nemo nemo 26296 Oct 8 10:31 17 -rw-rw-rw- 1 nemo nemo 23874 Oct 8 10:31 18 -rw-rw-rw- 1 nemo nemo 13339 Oct 8 10:31 19 -rw-rw-rw- 1 nemo nemo 476 Oct 8 10:31 2 -rw-rw-rw- 1 nemo nemo 9579 Oct 8 10:31 20 -rw-rw-rw- 1 nemo nemo 5295 Oct 8 10:31 21 -rw-rw-rw- 1 nemo nemo 475 Oct 8 10:31 22 -rw-rw-rw- 1 nemo nemo 474 Oct 8 10:31 23 -rw-rw-rw- 1 nemo nemo 19017 Oct 8 10:31 3 -rw-rw-rw- 1 nemo nemo 476 Oct 8 10:31 4 -rw-rw-rw- 1 nemo nemo 5855 Oct 8 10:31 5 -rw-rw-rw- 1 nemo nemo 6612 Oct 8 10:31 6 -rw-rw-rw- 1 nemo nemo 28598 Oct 8 10:31 7 -rw-rw-rw- 1 nemo nemo 25750 Oct 8 10:31 8 -rw-rw-rw- 1 nemo nemo 23184 Oct 8 10:31 9 /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download/2020-10-08: total 484 -rw-rw-rw- 1 nemo nemo 475 Oct 9 02:31 0 -rw-rw-rw- 1 nemo nemo 3506 Oct 9 02:31 1 -rw-rw-rw- 1 nemo nemo 33930 Oct 9 02:31 10 -rw-rw-rw- 1 nemo nemo 31907 Oct 9 02:31 11 -rw-rw-rw- 1 nemo nemo 33363 Oct 9 02:31 12 -rw-rw-rw- 1 nemo nemo 30177 Oct 9 02:31 13 -rw-rw-rw- 1 nemo nemo 20417 Oct 9 02:31 14 -rw-rw-rw- 1 nemo nemo 27451 Oct 9 02:31 15 -rw-rw-rw- 1 nemo nemo 27291 Oct 9 02:31 16 -rw-rw-rw- 1 nemo nemo 30865 Oct 9 02:31 17 -rw-rw-rw- 1 nemo nemo 19824 Oct 9 02:31 18 -rw-rw-rw- 1 nemo nemo 13793 Oct 9 02:31 19 -rw-rw-rw- 1 nemo nemo 476 Oct 9 02:31 2 -rw-rw-rw- 1 nemo nemo 16216 Oct 9 02:31 20 -rw-rw-rw- 1 nemo nemo 6479 Oct 9 02:31 21 -rw-rw-rw- 1 nemo nemo 476 Oct 9 02:31 22 -rw-rw-rw- 1 nemo nemo 477 Oct 9 02:31 23 -rw-rw-rw- 1 nemo nemo 476 Oct 9 02:31 3 -rw-rw-rw- 1 nemo nemo 476 Oct 9 02:31 4 -rw-rw-rw- 1 nemo nemo 7297 Oct 9 02:31 5 -rw-rw-rw- 1 nemo nemo 21130 Oct 9 02:31 6 -rw-rw-rw- 1 nemo nemo 34043 Oct 9 02:31 7 -rw-rw-rw- 1 nemo nemo 46200 Oct 9 02:31 8 -rw-rw-rw- 1 nemo nemo 34097 Oct 9 02:31 9 /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download/2020-10-09: total 532 -rw-rw-rw- 1 nemo nemo 476 Oct 10 04:43 0 -rw-rw-rw- 1 nemo nemo 476 Oct 10 04:43 1 -rw-rw-rw- 1 nemo nemo 52284 Oct 10 04:43 10 -rw-rw-rw- 1 nemo nemo 40289 Oct 10 04:43 11 -rw-rw-rw- 1 nemo nemo 40563 Oct 10 04:43 12 -rw-rw-rw- 1 nemo nemo 32154 Oct 10 04:43 13 -rw-rw-rw- 1 nemo nemo 37521 Oct 10 04:43 14 -rw-rw-rw- 1 nemo nemo 26198 Oct 10 04:43 15 -rw-rw-rw- 1 nemo nemo 27979 Oct 10 04:43 16 -rw-rw-rw- 1 nemo nemo 26693 Oct 10 04:43 17 -rw-rw-rw- 1 nemo nemo 25134 Oct 10 04:43 18 -rw-rw-rw- 1 nemo nemo 25969 Oct 10 04:43 19 -rw-rw-rw- 1 nemo nemo 475 Oct 10 04:43 2 -rw-rw-rw- 1 nemo nemo 19912 Oct 10 04:43 20 -rw-rw-rw- 1 nemo nemo 7463 Oct 10 04:43 21 -rw-rw-rw- 1 nemo nemo 475 Oct 10 04:43 22 -rw-rw-rw- 1 nemo nemo 4124 Oct 10 04:43 23 -rw-rw-rw- 1 nemo nemo 476 Oct 10 04:43 3 -rw-rw-rw- 1 nemo nemo 5418 Oct 10 04:43 4 -rw-rw-rw- 1 nemo nemo 4667 Oct 10 04:43 5 -rw-rw-rw- 1 nemo nemo 16883 Oct 10 04:43 6 -rw-rw-rw- 1 nemo nemo 41307 Oct 10 04:43 7 -rw-rw-rw- 1 nemo nemo 19365 Oct 10 04:43 8 -rw-rw-rw- 1 nemo nemo 32520 Oct 10 04:43 9 /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download/2020-10-10: total 476 -rw-rw-rw- 1 nemo nemo 478 Oct 11 03:12 0 -rw-rw-rw- 1 nemo nemo 476 Oct 11 03:12 1 -rw-rw-rw- 1 nemo nemo 48003 Oct 11 03:12 10 -rw-rw-rw- 1 nemo nemo 26932 Oct 11 03:12 11 -rw-rw-rw- 1 nemo nemo 39944 Oct 11 03:12 12 -rw-rw-rw- 1 nemo nemo 31964 Oct 11 03:12 13 -rw-rw-rw- 1 nemo nemo 26533 Oct 11 03:12 14 -rw-rw-rw- 1 nemo nemo 28220 Oct 11 03:12 15 -rw-rw-rw- 1 nemo nemo 21400 Oct 11 03:12 16 -rw-rw-rw- 1 nemo nemo 23077 Oct 11 03:12 17 -rw-rw-rw- 1 nemo nemo 18790 Oct 11 03:12 18 -rw-rw-rw- 1 nemo nemo 25843 Oct 11 03:12 19 -rw-rw-rw- 1 nemo nemo 476 Oct 11 03:12 2 -rw-rw-rw- 1 nemo nemo 10720 Oct 11 03:12 20 -rw-rw-rw- 1 nemo nemo 6857 Oct 11 03:12 21 -rw-rw-rw- 1 nemo nemo 3940 Oct 11 03:12 22 -rw-rw-rw- 1 nemo nemo 477 Oct 11 03:12 23 -rw-rw-rw- 1 nemo nemo 3224 Oct 11 03:12 3 -rw-rw-rw- 1 nemo nemo 477 Oct 11 03:12 4 -rw-rw-rw- 1 nemo nemo 7280 Oct 11 03:12 5 -rw-rw-rw- 1 nemo nemo 12416 Oct 11 03:12 6 -rw-rw-rw- 1 nemo nemo 23382 Oct 11 03:12 7 -rw-rw-rw- 1 nemo nemo 35607 Oct 11 03:12 8 -rw-rw-rw- 1 nemo nemo 44716 Oct 11 03:12 9 /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download/2020-10-11: total 328 -rw-rw-rw- 1 nemo nemo 476 Oct 12 01:41 0 -rw-rw-rw- 1 nemo nemo 475 Oct 12 01:41 1 -rw-rw-rw- 1 nemo nemo 30783 Oct 12 01:41 10 -rw-rw-rw- 1 nemo nemo 23316 Oct 12 01:41 11 -rw-rw-rw- 1 nemo nemo 20630 Oct 12 01:41 12 -rw-rw-rw- 1 nemo nemo 21832 Oct 12 01:41 13 -rw-rw-rw- 1 nemo nemo 20427 Oct 12 01:41 14 -rw-rw-rw- 1 nemo nemo 21228 Oct 12 01:41 15 -rw-rw-rw- 1 nemo nemo 13751 Oct 12 01:41 16 -rw-rw-rw- 1 nemo nemo 18381 Oct 12 01:41 17 -rw-rw-rw- 1 nemo nemo 10255 Oct 12 01:41 18 -rw-rw-rw- 1 nemo nemo 12035 Oct 12 01:41 19 -rw-rw-rw- 1 nemo nemo 475 Oct 12 01:41 2 -rw-rw-rw- 1 nemo nemo 4306 Oct 12 01:41 20 -rw-rw-rw- 1 nemo nemo 4397 Oct 12 01:41 21 -rw-rw-rw- 1 nemo nemo 475 Oct 12 01:41 22 -rw-rw-rw- 1 nemo nemo 3250 Oct 12 01:41 3 -rw-rw-rw- 1 nemo nemo 476 Oct 12 01:41 4 -rw-rw-rw- 1 nemo nemo 3223 Oct 12 01:41 5 -rw-rw-rw- 1 nemo nemo 5383 Oct 12 01:41 6 -rw-rw-rw- 1 nemo nemo 22870 Oct 12 01:41 7 -rw-rw-rw- 1 nemo nemo 17496 Oct 12 01:41 8 -rw-rw-rw- 1 nemo nemo 22476 Oct 12 01:41 9 /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download/2020-10-12: total 392 -rw-rw-rw- 1 nemo nemo 475 Oct 13 03:04 0 -rw-rw-rw- 1 nemo nemo 475 Oct 13 03:04 1 -rw-rw-rw- 1 nemo nemo 31190 Oct 13 03:04 10 -rw-rw-rw- 1 nemo nemo 13169 Oct 13 03:04 11 -rw-rw-rw- 1 nemo nemo 22583 Oct 13 03:04 12 -rw-rw-rw- 1 nemo nemo 21531 Oct 13 03:04 13 -rw-rw-rw- 1 nemo nemo 27900 Oct 13 03:04 14 -rw-rw-rw- 1 nemo nemo 27988 Oct 13 03:04 15 -rw-rw-rw- 1 nemo nemo 23618 Oct 13 03:04 16 -rw-rw-rw- 1 nemo nemo 17696 Oct 13 03:04 17 -rw-rw-rw- 1 nemo nemo 17240 Oct 13 03:04 18 -rw-rw-rw- 1 nemo nemo 23868 Oct 13 03:04 19 -rw-rw-rw- 1 nemo nemo 476 Oct 13 03:04 2 -rw-rw-rw- 1 nemo nemo 12598 Oct 13 03:04 20 -rw-rw-rw- 1 nemo nemo 4753 Oct 13 03:04 21 -rw-rw-rw- 1 nemo nemo 6387 Oct 13 03:04 22 -rw-rw-rw- 1 nemo nemo 476 Oct 13 03:04 23 -rw-rw-rw- 1 nemo nemo 477 Oct 13 03:04 3 -rw-rw-rw- 1 nemo nemo 476 Oct 13 03:04 4 -rw-rw-rw- 1 nemo nemo 475 Oct 13 03:04 5 -rw-rw-rw- 1 nemo nemo 19835 Oct 13 03:04 6 -rw-rw-rw- 1 nemo nemo 21434 Oct 13 03:04 7 -rw-rw-rw- 1 nemo nemo 18739 Oct 13 03:04 8 -rw-rw-rw- 1 nemo nemo 28019 Oct 13 03:04 9 /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download/2020-10-13: total 556 -rw-rw-rw- 1 nemo nemo 477 Oct 14 02:24 0 -rw-rw-rw- 1 nemo nemo 476 Oct 14 02:24 1 -rw-rw-rw- 1 nemo nemo 37152 Oct 14 02:24 10 -rw-rw-rw- 1 nemo nemo 35892 Oct 14 02:24 11 -rw-rw-rw- 1 nemo nemo 43121 Oct 14 02:24 12 -rw-rw-rw- 1 nemo nemo 39014 Oct 14 02:24 13 -rw-rw-rw- 1 nemo nemo 34734 Oct 14 02:24 14 -rw-rw-rw- 1 nemo nemo 34360 Oct 14 02:24 15 -rw-rw-rw- 1 nemo nemo 40892 Oct 14 02:24 16 -rw-rw-rw- 1 nemo nemo 40392 Oct 14 02:24 17 -rw-rw-rw- 1 nemo nemo 44454 Oct 14 02:24 18 -rw-rw-rw- 1 nemo nemo 18296 Oct 14 02:24 19 -rw-rw-rw- 1 nemo nemo 3240 Oct 14 02:24 2 -rw-rw-rw- 1 nemo nemo 11432 Oct 14 02:24 20 -rw-rw-rw- 1 nemo nemo 10083 Oct 14 02:24 21 -rw-rw-rw- 1 nemo nemo 3587 Oct 14 02:24 22 -rw-rw-rw- 1 nemo nemo 476 Oct 14 02:24 23 -rw-rw-rw- 1 nemo nemo 475 Oct 14 02:24 3 -rw-rw-rw- 1 nemo nemo 3132 Oct 14 02:24 4 -rw-rw-rw- 1 nemo nemo 7827 Oct 14 02:24 5 -rw-rw-rw- 1 nemo nemo 19285 Oct 14 02:24 6 -rw-rw-rw- 1 nemo nemo 30311 Oct 14 02:24 7 -rw-rw-rw- 1 nemo nemo 37870 Oct 14 02:24 8 -rw-rw-rw- 1 nemo nemo 26774 Oct 14 02:24 9 /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download/2020-10-14: total 668 -rw-rw-rw- 1 nemo nemo 477 Oct 15 02:32 0 -rw-rw-rw- 1 nemo nemo 3963 Oct 15 02:32 1 -rw-rw-rw- 1 nemo nemo 47779 Oct 15 02:32 10 -rw-rw-rw- 1 nemo nemo 60459 Oct 15 02:32 11 -rw-rw-rw- 1 nemo nemo 37875 Oct 15 02:32 12 -rw-rw-rw- 1 nemo nemo 43444 Oct 15 02:32 13 -rw-rw-rw- 1 nemo nemo 53255 Oct 15 02:32 14 -rw-rw-rw- 1 nemo nemo 38026 Oct 15 02:32 15 -rw-rw-rw- 1 nemo nemo 29224 Oct 15 02:32 16 -rw-rw-rw- 1 nemo nemo 40389 Oct 15 02:32 17 -rw-rw-rw- 1 nemo nemo 20493 Oct 15 02:32 18 -rw-rw-rw- 1 nemo nemo 32415 Oct 15 02:32 19 -rw-rw-rw- 1 nemo nemo 477 Oct 15 02:32 2 -rw-rw-rw- 1 nemo nemo 23801 Oct 15 02:32 20 -rw-rw-rw- 1 nemo nemo 12179 Oct 15 02:32 21 -rw-rw-rw- 1 nemo nemo 476 Oct 15 02:32 22 -rw-rw-rw- 1 nemo nemo 476 Oct 15 02:32 23 -rw-rw-rw- 1 nemo nemo 476 Oct 15 02:32 3 -rw-rw-rw- 1 nemo nemo 4577 Oct 15 02:32 4 -rw-rw-rw- 1 nemo nemo 3313 Oct 15 02:32 5 -rw-rw-rw- 1 nemo nemo 25317 Oct 15 02:32 6 -rw-rw-rw- 1 nemo nemo 38906 Oct 15 02:32 7 -rw-rw-rw- 1 nemo nemo 51704 Oct 15 02:32 8 -rw-rw-rw- 1 nemo nemo 59899 Oct 15 02:32 9 /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download/2020-10-15: total 796 -rw-rw-rw- 1 nemo nemo 475 Oct 16 03:01 0 -rw-rw-rw- 1 nemo nemo 4053 Oct 16 03:01 1 -rw-rw-rw- 1 nemo nemo 89796 Oct 16 03:01 10 -rw-rw-rw- 1 nemo nemo 50275 Oct 16 03:01 11 -rw-rw-rw- 1 nemo nemo 48574 Oct 16 03:01 12 -rw-rw-rw- 1 nemo nemo 40811 Oct 16 03:01 13 -rw-rw-rw- 1 nemo nemo 49871 Oct 16 03:01 14 -rw-rw-rw- 1 nemo nemo 59815 Oct 16 03:01 15 -rw-rw-rw- 1 nemo nemo 38919 Oct 16 03:01 16 -rw-rw-rw- 1 nemo nemo 40778 Oct 16 03:01 17 -rw-rw-rw- 1 nemo nemo 27275 Oct 16 03:01 18 -rw-rw-rw- 1 nemo nemo 36936 Oct 16 03:01 19 -rw-rw-rw- 1 nemo nemo 475 Oct 16 03:01 2 -rw-rw-rw- 1 nemo nemo 34783 Oct 16 03:01 20 -rw-rw-rw- 1 nemo nemo 15430 Oct 16 03:01 21 -rw-rw-rw- 1 nemo nemo 4252 Oct 16 03:01 22 -rw-rw-rw- 1 nemo nemo 475 Oct 16 03:01 23 -rw-rw-rw- 1 nemo nemo 477 Oct 16 03:01 3 -rw-rw-rw- 1 nemo nemo 9097 Oct 16 03:01 4 -rw-rw-rw- 1 nemo nemo 13865 Oct 16 03:01 5 -rw-rw-rw- 1 nemo nemo 23504 Oct 16 03:01 6 -rw-rw-rw- 1 nemo nemo 30430 Oct 16 03:01 7 -rw-rw-rw- 1 nemo nemo 73545 Oct 16 03:01 8 -rw-rw-rw- 1 nemo nemo 70211 Oct 16 03:01 9 /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download/2020-10-16: total 828 -rw-rw-rw- 1 nemo nemo 475 Oct 17 03:11 0 -rw-rw-rw- 1 nemo nemo 476 Oct 17 03:11 1 -rw-rw-rw- 1 nemo nemo 66893 Oct 17 03:11 10 -rw-rw-rw- 1 nemo nemo 73341 Oct 17 03:11 11 -rw-rw-rw- 1 nemo nemo 52239 Oct 17 03:11 12 -rw-rw-rw- 1 nemo nemo 55216 Oct 17 03:11 13 -rw-rw-rw- 1 nemo nemo 47864 Oct 17 03:11 14 -rw-rw-rw- 1 nemo nemo 40475 Oct 17 03:11 15 -rw-rw-rw- 1 nemo nemo 42673 Oct 17 03:11 16 -rw-rw-rw- 1 nemo nemo 41449 Oct 17 03:11 17 -rw-rw-rw- 1 nemo nemo 42467 Oct 17 03:11 18 -rw-rw-rw- 1 nemo nemo 35070 Oct 17 03:11 19 -rw-rw-rw- 1 nemo nemo 478 Oct 17 03:11 2 -rw-rw-rw- 1 nemo nemo 32735 Oct 17 03:11 20 -rw-rw-rw- 1 nemo nemo 10729 Oct 17 03:11 21 -rw-rw-rw- 1 nemo nemo 7193 Oct 17 03:11 22 -rw-rw-rw- 1 nemo nemo 6387 Oct 17 03:11 23 -rw-rw-rw- 1 nemo nemo 8040 Oct 17 03:11 3 -rw-rw-rw- 1 nemo nemo 6021 Oct 17 03:11 4 -rw-rw-rw- 1 nemo nemo 12078 Oct 17 03:11 5 -rw-rw-rw- 1 nemo nemo 30592 Oct 17 03:11 6 -rw-rw-rw- 1 nemo nemo 55796 Oct 17 03:11 7 -rw-rw-rw- 1 nemo nemo 76897 Oct 17 03:11 8 -rw-rw-rw- 1 nemo nemo 60220 Oct 17 03:11 9 /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download/2020-10-17: total 360 -rw-rw-rw- 1 nemo nemo 476 Oct 18 01:49 0 -rw-rw-rw- 1 nemo nemo 476 Oct 18 01:49 1 -rw-rw-rw- 1 nemo nemo 16573 Oct 18 01:49 10 -rw-rw-rw- 1 nemo nemo 11527 Oct 18 01:49 11 -rw-rw-rw- 1 nemo nemo 13269 Oct 18 01:49 12 -rw-rw-rw- 1 nemo nemo 11691 Oct 18 01:49 13 -rw-rw-rw- 1 nemo nemo 11445 Oct 18 01:49 14 -rw-rw-rw- 1 nemo nemo 7672 Oct 18 01:49 15 -rw-rw-rw- 1 nemo nemo 8483 Oct 18 01:49 16 -rw-rw-rw- 1 nemo nemo 6477 Oct 18 01:49 17 -rw-rw-rw- 1 nemo nemo 6204 Oct 18 01:49 18 -rw-rw-rw- 1 nemo nemo 7597 Oct 18 01:49 19 -rw-rw-rw- 1 nemo nemo 476 Oct 18 01:49 2 -rw-rw-rw- 1 nemo nemo 4817 Oct 18 01:49 20 -rw-rw-rw- 1 nemo nemo 3307 Oct 18 01:49 21 -rw-rw-rw- 1 nemo nemo 475 Oct 18 01:49 22 -rw-rw-rw- 1 nemo nemo 475 Oct 18 01:49 3 -rw-rw-rw- 1 nemo nemo 9918 Oct 18 01:49 4 -rw-rw-rw- 1 nemo nemo 15381 Oct 18 01:49 5 -rw-rw-rw- 1 nemo nemo 32854 Oct 18 01:49 6 -rw-rw-rw- 1 nemo nemo 48879 Oct 18 01:49 7 -rw-rw-rw- 1 nemo nemo 51011 Oct 18 01:49 8 -rw-rw-rw- 1 nemo nemo 45585 Oct 18 01:49 9 /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download/2020-10-18: total 164 -rw-rw-r-- 1 nemo nemo 476 Oct 19 03:03 0 -rw-rw-r-- 1 nemo nemo 476 Oct 19 03:03 1 -rw-rw-r-- 1 nemo nemo 5819 Oct 19 03:03 10 -rw-rw-r-- 1 nemo nemo 10404 Oct 19 03:03 11 -rw-rw-r-- 1 nemo nemo 8681 Oct 19 03:03 12 -rw-rw-r-- 1 nemo nemo 9772 Oct 19 03:03 13 -rw-rw-r-- 1 nemo nemo 7115 Oct 19 03:03 14 -rw-rw-r-- 1 nemo nemo 6557 Oct 19 03:03 15 -rw-rw-r-- 1 nemo nemo 5468 Oct 19 03:03 16 -rw-rw-r-- 1 nemo nemo 5447 Oct 19 03:03 17 -rw-rw-r-- 1 nemo nemo 3622 Oct 19 03:03 18 -rw-rw-r-- 1 nemo nemo 477 Oct 19 03:03 19 -rw-rw-r-- 1 nemo nemo 475 Oct 19 03:03 2 -rw-rw-r-- 1 nemo nemo 5534 Oct 19 03:03 20 -rw-rw-r-- 1 nemo nemo 477 Oct 19 03:03 21 -rw-rw-r-- 1 nemo nemo 475 Oct 19 03:03 22 -rw-rw-r-- 1 nemo nemo 476 Oct 19 03:03 23 -rw-rw-r-- 1 nemo nemo 476 Oct 19 03:03 3 -rw-rw-r-- 1 nemo nemo 477 Oct 19 03:03 4 -rw-rw-r-- 1 nemo nemo 3545 Oct 19 03:03 5 -rw-rw-r-- 1 nemo nemo 477 Oct 19 03:03 6 -rw-rw-r-- 1 nemo nemo 8621 Oct 19 03:03 7 -rw-rw-r-- 1 nemo nemo 8270 Oct 19 03:03 8 -rw-rw-r-- 1 nemo nemo 7176 Oct 19 03:03 9 /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download/2020-10-19: total 180 -rw-rw-r-- 1 nemo nemo 477 Oct 20 03:29 0 -rw-rw-r-- 1 nemo nemo 476 Oct 20 03:29 1 -rw-rw-r-- 1 nemo nemo 9450 Oct 20 03:29 10 -rw-rw-r-- 1 nemo nemo 8881 Oct 20 03:29 11 -rw-rw-r-- 1 nemo nemo 9940 Oct 20 03:29 12 -rw-rw-r-- 1 nemo nemo 7820 Oct 20 03:29 13 -rw-rw-r-- 1 nemo nemo 9262 Oct 20 03:29 14 -rw-rw-r-- 1 nemo nemo 7576 Oct 20 03:29 15 -rw-rw-r-- 1 nemo nemo 8062 Oct 20 03:29 16 -rw-rw-r-- 1 nemo nemo 7693 Oct 20 03:29 17 -rw-rw-r-- 1 nemo nemo 6830 Oct 20 03:29 18 -rw-rw-r-- 1 nemo nemo 7028 Oct 20 03:29 19 -rw-rw-r-- 1 nemo nemo 476 Oct 20 03:29 2 -rw-rw-r-- 1 nemo nemo 3460 Oct 20 03:29 20 -rw-rw-r-- 1 nemo nemo 477 Oct 20 03:29 21 -rw-rw-r-- 1 nemo nemo 475 Oct 20 03:29 22 -rw-rw-r-- 1 nemo nemo 474 Oct 20 03:29 23 -rw-rw-r-- 1 nemo nemo 3577 Oct 20 03:29 3 -rw-rw-r-- 1 nemo nemo 475 Oct 20 03:29 4 -rw-rw-r-- 1 nemo nemo 5168 Oct 20 03:29 5 -rw-rw-r-- 1 nemo nemo 6103 Oct 20 03:29 6 -rw-rw-r-- 1 nemo nemo 10104 Oct 20 03:29 7 -rw-rw-r-- 1 nemo nemo 8460 Oct 20 03:29 8 -rw-rw-r-- 1 nemo nemo 7327 Oct 20 03:29 9 /home/nemo/.local/share/harbour-contrac.old/harbour-contrac/download/2020-10-20: total 268 -rw-rw-r-- 1 nemo nemo 477 Oct 21 04:28 0 -rw-rw-r-- 1 nemo nemo 476 Oct 21 04:28 1 -rw-rw-r-- 1 nemo nemo 15446 Oct 21 04:28 10 -rw-rw-r-- 1 nemo nemo 15864 Oct 21 04:28 11 -rw-rw-r-- 1 nemo nemo 14163 Oct 21 04:28 12 -rw-rw-r-- 1 nemo nemo 13593 Oct 21 04:28 13 -rw-rw-r-- 1 nemo nemo 12902 Oct 21 04:28 14 -rw-rw-r-- 1 nemo nemo 13412 Oct 21 04:28 15 -rw-rw-r-- 1 nemo nemo 15812 Oct 21 04:28 16 -rw-rw-r-- 1 nemo nemo 13894 Oct 21 04:28 17 -rw-rw-r-- 1 nemo nemo 10511 Oct 21 04:28 18 -rw-rw-r-- 1 nemo nemo 9900 Oct 21 04:28 19 -rw-rw-r-- 1 nemo nemo 476 Oct 21 04:28 2 -rw-rw-r-- 1 nemo nemo 6637 Oct 21 04:28 20 -rw-rw-r-- 1 nemo nemo 5110 Oct 21 04:28 21 -rw-rw-r-- 1 nemo nemo 477 Oct 21 04:28 22 -rw-rw-r-- 1 nemo nemo 477 Oct 21 04:28 23 -rw-rw-r-- 1 nemo nemo 3391 Oct 21 04:28 3 -rw-rw-r-- 1 nemo nemo 476 Oct 21 04:28 4 -rw-rw-r-- 1 nemo nemo 4412 Oct 21 04:28 5 -rw-rw-r-- 1 nemo nemo 9372 Oct 21 04:28 6 -rw-rw-r-- 1 nemo nemo 18140 Oct 21 04:28 7 -rw-rw-r-- 1 nemo nemo 15035 Oct 21 04:28 8 -rw-rw-r-- 1 nemo nemo 14791 Oct 21 04:28 9 ```
llewelld commented 3 years ago

Thanks for the info, that's helpful, but confusing. I'm not sure why your values reset as it looks like the three important configuration files were all saved recently: Oct 21 16:13 contracd.conf Oct 21 02:00 0000487b.dat Oct 21 17:43 harbour-contrac.conf

schmittlauch commented 3 years ago

Honestly you probably shouldn't care about what exactly happened (although that'd be useful for narrowing down the code paths) but just check the error handling in the relevant code paths.

llewelld commented 3 years ago

Sure, point taken.

schmittlauch commented 3 years ago

Uhm… After updating to 0.7.4 the issue appears again. For example I just downloaded the new keys before rebooting, but after reboot harbour-contrac told me that the daily key update is required.

Matzt commented 3 years ago

I do have the same problem on Sony XA2, SFOS 3.4.0.24 and Contrac 0.7.4. If I can provide any useful Information please let me know.

Matzt commented 3 years ago

I had a closer look into this. My impression is, that ~/.config/contracd/contracd.conf isn't stored correctly. I didn't verify in detail but all the other data seems to be there (various files with correct date in /contacts/ and in share/harbour-contrac and harbour-contrac.conf has multiple keys) but contracd.conf has only the group [application] with the two key value pairs settingsVersion=0 and version=0.7.4. The tracingKey you mentioned above isn't in there, so I assume there is something missing.

Matzt commented 3 years ago

For some reason my contracd.conf was saved correctly once yesterday (and never before and never after so far). I have no Idea under which conditions this happened, sorry. But it brought a thought to my mind: The problem might also be a race condition when shutting down the daemon, e.g. shut down doesn't wait for the data to be written. It's just an idea since I didn't have a look at the code at all and don't even know when contracd.conf is supposed to be saved. BTW: Wouldn't it be more reliable to get the number of sent and received keys from the saved key data for example whenever starting up the app?

cintema commented 3 years ago

For me as well all my keys got lost after my phone shut down due to low battery yesterday. I had it running for a while and had collected like 10000 keys. Now I'm back to 350. That's a bit sad.

llewelld commented 3 years ago

The problem might also be a race condition when shutting down the daemon, e.g. shut down doesn't wait for the data to be written. It's just an idea since I didn't have a look at the code at all and don't even know when contracd.conf is supposed to be saved.

Thanks for the feedback @Matzt. I think you're correct about it being a race condition, and the info + analysis you provided is really helpful. I'll look into this and try to solve it.

As you noticed and mentioned in your earlier comment, it's just the config file which is failing to save. This means that it may affect whether the RSSI calibration data is stored correctly, but it wouldn't be affecting storage of the keys that have been captured. The captured keys are saved on an continual basis.

BTW: Wouldn't it be more reliable to get the number of sent and received keys from the saved key data for example whenever starting up the app?

To be honest, the sent/received values were only ever intended as a way to check that keys were being received and sent correctly. It represents the number of keys since you started using the app, whereas the data files only store the last 14 days worth. There's also no equivalent for keys sent, since these aren't stored anyway.

Either way, this issue of storing the config file needs to be addressed and I'll look into it. Thanks for the useful input.

llewelld commented 3 years ago

For me as well all my keys got lost after my phone shut down due to low battery yesterday. I had it running for a while and had collected like 10000 keys. Now I'm back to 350. That's a bit sad.

Yes, I can appreciate it's disappointing, but if it's an consolation, this won't represent the number of keys lost in reality. The keys are saved as they're received, so the amount of data you've lost is less than the big drop from 10000 to 350 might appear.

Matzt commented 3 years ago

To be honest, the sent/received values were only ever intended as a way to check that keys were being received and sent correctly.

Which definitely was useful to find the saving issue of the config file ;-) Maybe it makes more sense to save the config file when ever necessary and not only on shut down of the daemon. Would be more robust if the phone crashes without warning.

llewelld commented 3 years ago

With the merging of #86, this has now been fixed thanks to @bionade24's good work. They settings file is now saved on periodically to ensure changes are maintained even if contracd crashes for some reason.

Matzt commented 3 years ago

I'm sorry to have to inform you, that the problem still persists on my Xperia XA2 running SFOS 4.0.1.48 and contrac 0.7.7.

bionade24 commented 3 years ago

I'm sorry to have to inform you, that the problem still persists on my Xperia XA2 running SFOS 4.0.1.48 and contrac 0.7.7.

@Matzt How much do your values vary? Small difference woud be ok and there is no good solution to that. Again, key are saved anyway.

bionade24 commented 3 years ago

If you think you lost the keys of multiple hours, then we should reopen this issue.

Matzt commented 3 years ago

I lost the keys of days and also the settings I changed in the config. It might be a different problem though. Here is what happened in detail:

Maybe it's just a permission issue with the old config? Should it have been deleted during the uninstall? Should I try deleting it?

bionade24 commented 3 years ago
  • After uninstalling and restarting the phone the update screen still prompted me to uninstall contrac but I proceeded nevertheless.

No, you shouldn't delete the old config and contrac should just work along with it. @llewelld Do you have any idea what could have gone wrong ?

llewelld commented 3 years ago

What @bionade24 says is correct, and I'm a bit confused by this too to be honest. @Matzt, would you mind please running these commands and sharing the results with us?

ls -l ~/.config/harbour-contrac/
ls -l ~/.config/contracd/
ls -l ~/.config/contracd/contracd/contacts/

For info, the first relates to the server settings, the second relates to your private key and the sent/received counts, while the third contains the keys that have been collected by your phone. If we can see the permissions and last modified times of those, that might shed some light on things.

Matzt commented 3 years ago

Here you go: Bildschirmfoto_20210223_001

Matzt commented 3 years ago

I'm sorry the problem seems to be something different. The number of keys received is stored correctly but the settings ain't. I'll open a new bug report.

Matzt commented 3 years ago

I'm still sorry. Behavior is rather weird and I can't really find a pattern in it. Sometimes it works sometimes it doesn't and everything seems to be better since i ran above ls commands, which is rather weird. As soon as I find something new I'll file a new bug report.