Lost all pages! Sync issue?

Please help! All the content from my pages has disappeared!

Recent pages are still listed in the left pane of the desktop app but clicking on any shows that there is no content in any of them?

I’m using the Sync feature.

Any help on how to recover the information would be gratefully received!

Sorry but no idea given the limited information. Can you provide more information about your devices, operations (just edited config.edn?)

For how to recover data:

Thanks for the response.

I haven’t made any changed to the config.edn file but Logseq has asked me for the password to the remote sync files a few times over the past couple of days.

I am running V0.8.16 on Windows 11.

I’ve looked in the ‘pages’ folder but there are no files there. I can see backups of the pages in bak\pages folder but unclear how to restore the latest versions.

Both the ‘All pages’ and ‘Graph view’ options in the left pane show all the pages but clicking on any just shows a black page where there used to be text/data.

Do you have any ideas how I restore the last versions of all the pages?

Could you check out the latest Logseq App log, located in C:\Users\USER_NAME\AppData\Roaming\Logseq\logs\main.log? This can provide some clue on why files are deleted.

Are you using the graph folder with other syncing disks, like iCloud, OneDrive or so?

Thanks for your response. I do use Google Drive (Drive G:) to store Logseq files/graph.

Looking at the main.log file, it appears the issue started on 30/1:

[2023-01-30 12:09:33.747] [info] Logseq App(0.8.16) Starting…
[2023-01-30 12:09:33.788] [info] restore proxy settings {:type “system”}
[2023-01-30 12:09:33.792] [info] set proxy to {:type “system”}
[2023-01-30 12:09:33.829] [debug] [updater] checking https://update.electronjs.org/logseq/logseq/win32-x64/0.8.16
[2023-01-30 12:09:37.589] [debug] :electron.handler/watch-dir {:path “C:\Users\USER_NAME\.logseq/config”}
[2023-01-30 12:09:37.626] [debug] :electron.handler/unwatch-dir {:path “G:/My Drive/AppData/Logseq”}
[2023-01-30 12:09:37.630] [debug] :electron.handler/watch-dir {:path “G:/My Drive/AppData/Logseq”}
[2023-01-30 12:09:38.744] [info] :electron.handler/backup backup db file G:/My Drive/AppData/Logseq/pages/Online Strategy.md
[2023-01-30 14:52:25.053] [warn] :electron.fs-watcher/on-error Watch error happened: {:path #object[Error Error: UNKNOWN: unknown error, watch]}

This error then repeats 100+ times and then changes…

[2023-01-30 14:52:25.823] [warn] :electron.fs-watcher/on-unlink-dir {:path “G:\My Drive\AppData\Logseq”}
[2023-01-30 14:52:25.888] [debug] :electron.fs-watcher/on-unlink {:path “G:\My Drive\AppData\Logseq\logseq\metadata.edn”}
[2023-01-30 14:52:25.891] [debug] :electron.fs-watcher/on-unlink {:path “G:\My Drive\AppData\Logseq\logseq\config.edn”}
[2023-01-30 14:52:25.894] [debug] :electron.fs-watcher/on-unlink {:path “G:\My Drive\AppData\Logseq\logseq\custom.css”}
[2023-01-30 14:52:25.897] [debug] :electron.fs-watcher/on-unlink {:path “G:\My Drive\AppData\Logseq\logseq\pages-metadata.edn”}
[2023-01-30 14:52:25.900] [debug] :electron.fs-watcher/on-unlink {:path “G:\My Drive\AppData\Logseq\journals\2022_06_30.md”}

This last [debug] record repeats through every page in my Logseq graph until…

[2023-01-30 14:52:33.385] [error] IPC error: {:event #object[Object [object Object]], :args #js [“mkdir-recur” “G:/My Drive/AppData/Logseq/logseq”]} Error: ENOENT: no such file or directory, mkdir ‘G:/My Drive/AppData/Logseq/logseq’
at mkdirSync (node:fs:1349:3)
at e.mkdirSync (node:electron/js2c/asar_bundle:5:12607)
at C:\Users\richa\AppData\Local\Logseq\app-0.8.16\resources\app\electron.js:14970:39
at $JSCompiler_prototypeAlias$$.$cljs$core$IFn$_invoke$arity$2$ (C:\Users\richa\AppData\Local\Logseq\app-0.8.16\resources\app\electron.js:9479:178)
at C:\Users\richa\AppData\Local\Logseq\app-0.8.16\resources\app\electron.js:15867:76
at node:electron/js2c/browser_init:189:579
at EventEmitter. (node:electron/js2c/browser_init:161:11433)
at EventEmitter.emit (node:events:527:28)

This record repeats 15+ times over the next 6 seconds. There are then no records until the following day when I think all the pages had disappeared:

[2023-01-31 09:34:37.242] [info] Logseq App(0.8.16) Starting…
[2023-01-31 09:34:37.398] [info] restore proxy settings {:type “system”}
[2023-01-31 09:34:37.529] [info] set proxy to {:type “system”}
[2023-01-31 09:34:37.673] [debug] [updater] checking https://update.electronjs.org/logseq/logseq/win32-x64/0.8.16
[2023-01-31 09:35:40.699] [debug] :electron.handler/watch-dir {:path “C:\Users\\USER_NAME\.logseq/config”}

Is there any solution? I can’t use Logseq at the moment as I am concerned I will lose more information and potentially not be able to recover the original pages.

I would be happy to restore the old pages if there is a mechanism for doing this that doesn’t require renaming all the bak files!

Any help gratefully received.

I wonder if that didn’t happen?

I think it’s an issue of Gdrive + Logseq Sync?

This error then repeats 100+ times and then changes…

[2023-01-30 14:52:25.823] [warn] :electron.fs-watcher/on-unlink-dir {:path “G:\My Drive\AppData\Logseq”}
[2023-01-30 14:52:25.888] [debug] :electron.fs-watcher/on-unlink {:path “G:\My Drive\AppData\Logseq\logseq\metadata.edn”}
[2023-01-30 14:52:25.891] [debug] :electron.fs-watcher/on-unlink {:path “G:\My Drive\AppData\Logseq\logseq\config.edn”}
[2023-01-30 14:52:25.894] [debug] :electron.fs-watcher/on-unlink {:path “G:\My Drive\AppData\Logseq\logseq\custom.css”}
[2023-01-30 14:52:25.897] [debug] :electron.fs-watcher/on-unlink {:path “G:\My Drive\AppData\Logseq\logseq\pages-metadata.edn”}

The fs-watcher is for watching the external editing on the file system. It’s telling that some stuff outside of Logseq (likely Gdrive?) is deleting files.
So moving the graph directory out of Gdrive is highly recommended.

1 Like

I’m creating a thread on the edit conflict:

Thanks for the reply.

I don’t think it is an issue with Google Drive. I think it is the Android App and sync system that caused the issue.

I restored the deleted md files from GDrive bin and they kept being deleted as soon as the sync executed. Just as well that the files were stored on GDrive otherwise it appears I would have lost a host of edits.

I have uninstalled the Android app, cleared the cache on the desktop, restored the deleted md files again, updated to 0.8.17 on the desktop and everything appears to be syncing fine now. No loss of files to date.

My feeling is that there is an issue with the Android app or the Android app and sync function. For the moment I won’t be reinstalling the Android app as I don’t have time to keep restoring files and finding the issue!

Makes the sync function useless at the moment!

they kept being deleted as soon as the sync executed

It needs further investigate. But Logseq has no logic of deleting multiple files. Code reviews proved this:

The most suspicious line in your log is here:

[2023-01-30 14:52:25.053] [warn] :electron.fs-watcher/on-error Watch error happened: {:path #object[Error Error: UNKNOWN: unknown error, watch]}

Likely related to some strange behavior of GDrive.

I’ve been using Google Drive for years and never experienced this issue before. That includes editing and saving files using many different applications. Also I have many years developing apps.

My suspicion is that the sync system is forcing the remote version on the local version. I just don’t see why Google Drive would choose to delete any files on its own, the source of the deletion must surely be the Logseq app?

I really like Logseq but the sync system needs to be more robust and should play nicely with any remote backup system like Google Drive or OneDrive. It provides belt and braces for issues like I have faced.

1 Like

Ideally it should. But OneDrive / GDrive / iCloud are messing the FS event firing / file conflict resolution on some OS in our observation. It’s not an issue specific to Logseq Sync, but might due to the frequent small-file IO

Meanwhile, Dropbox is having a much better record :sweat_smile:

We are looking for help on improving the compatibility.

1 Like

Just thought I’d give you an update on the file loss issue.

Since making the changes I mentioned a week ago I haven’t experienced any sync issues and the Logseq files remain in the same place on the GDrive.

Indications, to me, are that GDrive on its own isn’t the issue but you know more than me, I just thought this update may be of use.

Happy to test anything if that will progress the development of Logseq.

1 Like

Hey!! I have also the same issue. Nothing is synced and it states “Internal state synchronization failed”. I had it sync with Zotero but everything else was local. The option of history of each page does not show anything and I am not a tecchie. :cry: :sob: :woozy_face: I am very worried because I had all my content there and I was preparing for a book with the content. What should I do?

1 Like