Many journal pages disappear. Nested Directory structure

Hi,
I have been having sync problems see here and am now having viewing problems possibly as a result of this. On my linux computer not all journal entries are shown in Logseq.
My logseq folder has become strangely nested. At the first level are four directories:

  • journals
  • Logseq
  • pages
  • file:

Not all of my journal entries are saved in the journals directory on this level. If I click on the “Logseq” directory I see this structure:

  • journals
  • logseq
  • pages
  • file:

Note the lower case “logseq” this time. If I click here, I get this:

  • bak
  • journals
  • Logseq
  • assets

At each level there is a journals folder containing some of my journal entries. It goes as deep as this:

/home/anthony/Sync/Logseq/logseq/Logseq/Logseq 2/journals/

I would not mind this, but it is causing a problem. On my Android phone, everything displays correctly in Logseq version 0.8.8
However, on my linux PC, where the folder is synced, only one of the journal levels (the second level!) appears in Logseq version 0.8.8

Firstly, my questions. Is it normal for Logseq to nest folders like this? How can I get everything to appear again on both devices? Can and should I just cut and paste all journal entries into the top?? level?

Secondly, some possible causes. I used to have an iPhone and synced the folders created there with my linux computer. I believe that iPhones make strange directory structures so this may have been a cause.
I have also had strange error messages from a previous Logseq Android version.

DB version is not compatible, please clear cache then re-add your graph back.
Cache löschen

This required refreshing and or re-indexing the Logseq graph to get things going again (see link above for more info). Could this have messed up the folder hierarchy?
Finally, I have used syncthing to sync the folder between my android phone and linux computer. I do not think this can be a cause of my issues, but am adding it here for completeness.

This has ended up being a long and complicated post for what may be a simple problem to fix. Thanks for your patience and please help me out if you can.

Thanks in advance.

Anthony

2 Likes

While investigating this issue I opened the graph view on my phone. Only a white page appears.
On the computer I see seven nodes.
When I click on ‘All pages’ I see that I have twenty three on the phone, yet twenty six on the computer.
Can these discrepancies assist anyone in helping me?

I have tried something new. I found and deleted some .config files in my home directory and in my .config directory.
It did not help. I opened logseq and had to rechoose my graph folder, but newer entries still do not appear. ie. the problem is still there :cry: :cry: :sob:
This is really annoying me. It seems like it should be such a simple thing to solve.
Can anyone please help me? If anything I have written is unclear, or you need more info, please say so.
If I should RTFM, then please point me in the right direction.

1 Like

Keep pushing. Your situation and the way you’re gonna solve it soon, will help others and it’s gonna be a valuable contribution to the community. Don’t give up, please. The right tipe of help is sure to come !

Thanks for the inspiration @Didac.

My next try:

I made a copy of my logseq directory and shamelessly cut and pasted all the files from the lower nested level journal and pages folders to the top level ones with the same name. Sometimes there were files with the same name so I wrote over these when asked.
Then I deleted the lower level folders. A lot was deleted that I did not know what it was, but now I have a tidier folder structure.
Then I removed logseq from my system and deleted all the config files that I could find.
Then I reinstalled logseq and selected my tidied up folder as my graph folder. I am left with exactly the same situation.
In other words, nothing I have done has helped. There are still journals and pages that logseq does not display.

I do notice that many of the files in my journals folder have exactly the same “modified date”.
The file names are different though.
Could this be where my problems arise from? Maybe syncing somehow gave different files the same modified date and logseq can not process them?

Hope I fully understand your case based on the info provided:

Why the Logseq folders are nested?
The mechanism on creating new graph is to create the built-in folders like logseq, journals, pages inside the selected folders (You may find out the description about this on the UI to choose a directory). Sounds like in your case it choosed the logseq folder inside an existing graph folder.

Why page numbers are different?
The pages in nested folders are counted into the pages in the parent folders.

How to recover?
You may restore all the files by “flatten” all the pages in EVERY nesting graphs. NOT ONLY the lower level, but ALL levels!
Also, remember to check on each of your device. Sounds some of your devices are selecting different level of your nesting graph directory.
Remember to re-index after you get your final graph directory. Or you may move the “tidy graph folder” to another place, and add it.

I can’t give further advice as it’s about personal data management.

2 Likes

Do I understand you correctly: You reinstalled on your desktop, and the reinstalled logseq created a new triple-nested directory inside your graph folder?

Did anything occur between the re-install and the re-creation? I wonder if Syncthing was “remembering” these excess folders and putting them back after deletion. Or did you confirm the deletion in Syncthing beforehand?

My initial recommendation was to backup just journals, pages, and assets (looking over them to confirm they’re not corrupted), then reinstall, then link to a completely new folder. That you reinstalled and it still failed makes me doubt this approach; however, you still used a “cleaned up” folder rather than a clean one.

None of the directories looked okay; I’m thinking the file: folder is supposed to be an actual file given that, for example, my config.edn’s path starts with file:///private/var/mobile… — the slashes must have been misread.

Is your graph named logseq? If so, perhaps this is causing confusion? The usual structure on the phone is Logseq/graphname/logseq, with Logseq being the container (at least on iOS, the graph has to be stored in the designated app folder), and logseq being where config.edn, etc are stored.

That it works on your phone but not desktop is strange, but if I understand you, the graph was originally created on the phone and then synced to desktop?

I’m realizing if I let myself, I can ask dozens more questions, so I’ll let you respond to the above if you wish and lightly suggest rescuing only the markdown files and creating a new empty folder, then reinstalling (or at least link it as a new graph) and seeing what default paths are created. Disable syncing as you do this. If nothing strange happens, turn on syncing for your empty graph and see if the need structure reoccurs. If it doesn’t happen at that point, then I would try to paste the .md files from journals and pages into their new locations.

My suggestion is based on the fact that you said you deleted config files, but never confirmed deleting .bak files (which contain backups afaik), meaning that could why the error was restored. Deleting .bak might work on its own, but starting over cleanly seems like a better idea when we’re not sure of any single reason.

2 Likes

Thanks for the help guys. The problem seems to have gone away for now. I resynced my phone and computer with syncthing and then opened Logseq, added a new graph and chose my sync folder. It worked. I guess my deleting of configs (and .bak files, everything in all .directories related to logseq) helped.
My guess is that I had a dodgy sync that confused Logseq and it configured itself to not work with the folder anymore. Maybe I once had Logseq open on both devices at the same time and this is what messed things up. I do not know.
There is not really much to mark as “Solved” here. Although the replies from @Junyi_Du and @blork were useful (I am really grateful to aou both), I do not think they are really a solution.
What worked for me was

  1. deleting all .config files and folders
  2. reinstalling Logseq and setting it up with a dummy directory
  3. syncing again with syncthing
  4. changing the logseq graph to the synced folder

I am sure that not all of these steps in that order were necessary, nor do I know what worked or how or why. This is also not a solution to my problems, just the things I did until it worked again.

I hope it might help someone else in the future

Your semi-solution sounds similar, but more clarified than what I was suggesting (I was seriously rambling :sweat_smile:) so I’m glad you got it working.

I would suggest, even if you prefer to keep syncing between devices with Syncthing, setting up Git on desktop so you have backups and can revert to a working version if it happens again. Look up charlie’s “logseq git sync 101” for a step-by-step guide.

Thanks for logging your struggle; I definitely felt your pain and I am genuinely relieved you’re over the hump.

1 Like

Thanks for the support, advice, sympathy and suggestion.
Much appreciated.

2 Likes