Closed Barondane closed 1 year ago
No much clue with the given information.
I guess it's related to your change on the date format. Should be helpful if you can provide: 1) the name of the templates 2) the page that include the blocks 3) the first line (block title) of the block 4) the date format you are using. Also I want to confirm if there's no any sync service setup on your graph directory.
Sorry probably my writing was not clear.
Thanks for your help
Update:
I was able to repoduce the bug (s) partially.
I created a new graph locally. Encrypted it. Added some content and dates. Changed date format to EEEE, yyyy/MM/dd.
Result:
My guess is these are two different bugs. Main bug was not reproduced so far. However, it may need some time to reproduce because it did not happen once I changed the date format initially. It took two days.
Thanks for the check. Sounds to be a joint issue of the specific date format setting + encryption.
Update: All content in graph got erased (Hopefully not).
I opened my main graph today. It gave me the usual error (Discrepancy in one page between Logseq and on desk). I chose unencrypted version. I refreshed the app and everything was gone. I refreshed second time and nothing came up. I reindexed and entered my password and it’s still empty. I cleared Logseq cash and linked my graph and entered password and it’s empty.
File explorer does show my pages and shows backups too. I copied my Logseq folder into another location on my desk(do not want to corrupt the orignial by decryption ). I decrypted it with Logseq encrypt UI. Pages have no content.
I am looking into Age now might decrypt the files with it.
Update: Decrypted the files with age and no luck. All are empty. So, something must have triggered updating all files when I refreshed before content erased.
I am investigating some possible causes for what happened and I might have something related to disk permissions.
I just discovered that Logseq does not have permission to access the folder that graph was in. It never asked for permission. At the same time, permission is granted to Logseq for other folders that have other graphs. I do not recall if I was asked to permit or the system automatically permitted. I can confirm though that Logseq can still R/W the folder with lost content.
Possibly, this is an OSX specific bug related to disk permissions.
@Barondane Thanks! It's an important finding.
Humm, I created a graph with wrong permission setup to check the behavior. There's UX response on permission error on macOS 12.4 (both with & w/o Encryption)
Update: I created a new graph and was using Logseq on a daily basis. Multiple pages replaced their content with other pages arbitrarily. There was no relation between any of the pages. These acting pages were not accessed the moment or the day that their content was replaced.
The one common thing I did every time this occurred was refreshing Logseq and then it renders the page discrepancy message and asks me to choose between the two options. One encrypted and another one I can read but it’s from a different page. I choose the one that is readable regardless. Git versions for the lost original pages are not accessible. I can access only new commits with unrelated content.
Since that graph was lost I created a little local automation to back up Logseq graph. Luckily, I was able to recover every lost page with this new graph this way.
Could this too be related to this issue?
Humm, I created a graph with wrong permission setup to check the behavior. There's UX response on permission error on macOS 12.4 (both with & w/o Encryption)
Yes, I looked into it and do not think it's related to permissions any more.
Anyway, some cause make Logseq failed to persist data to the file system, without permission error
Does Logseq logs errors and instances locally? If yes where should I look and debug?
This is an error I got recently. I do not know if it's relevant.
@tiensonqin as per email
@Barondane Some logs stored in ~/Library/Logs/Logseq
For the others they are only available in the Console of Devtools
@cnrpman I emailed you some logs yesterday. If you could check your mailboxes
@Barondane Have you sent the logs to junyi@logseq.com ? What's your email address? I may do a double check.
Sent it to junyidu.cn@gmail.com
@Barondane Sorry I can't find your email even in the spam box. Can you resend it to junyi@logseq.com ?
@cnrpman Done, please let me know if you do not receive it.
Received.
Can you provide logs as https://github.com/logseq/logseq/issues/6834#issuecomment-1279719807 requested? (upon the error happening) The sys log doesn't tell much info
What's the meaning of
I did a logseq refresh before saving it
I can't make a whole view on the case.
Sounds like some internal race condition when the encryption is enabled.
The cmd+r
"Refresh" should always be avoid as it will make internal state into a mess, since Logseq is a multi-window program.
What's the meaning of
I did a logseq refresh before saving it
It took me a minute to know this was in reference to the email. I meant before exporting logs...
I can't make a whole view on the case.
Sounds like some internal race condition when the encryption is enabled. The
cmd+r
"Refresh" should always be avoid as it will make internal state into a mess, since Logseq is a multi-window program.
Very plausible. Will keep this post updated in case of any new development.
Thanks @cnrpman
I run into this occasionally as well, with encryption on. Generally, it appears to be a conflict between encryption and the refresh function. But, I aslo cannot consistently recreate the scenario yet.
The workaround/fix when the diff modal pops up is to just "Select this" for the "on disk" (i.e., readable text) side. Logseq then seems to re-encrypt the file so there won't be plain text if you open up the corresponding .md file.
I will continue to monitor to see if I can find a repeatable pattern and possible cause.
Logseq Encryption is deprecated due to it's experimental & immature state. https://discuss.logseq.com/t/deprecation-of-on-disk-encryption/12334
What happened?
I opened logseq today and called my /template. There was none. I go to check the [[templates]] pages and it was replaced with content from a random block “Block x” that was in my journal from 09-23. I reverted the template page using git successfully. I refreshed and reindexed the app and closed it.
I reopened the app few hours later and a popup says content was modified on desk and asks to select between two options: On desk on left side or on logseq on the right side. The [[page y]] was not modified by me today. I should always select the unencrypted content. So, I selected it but it was not the correct content. It was content from the “block x” !
“Block x” when created was the first backlink to [[page Y]]. I do not see a relationship between [[templates]] and “block x”. I just deleted the references to [[page y]] in “block x” hoping it will stop interfering with my pages.
“Block x” does not have special content or codes. It has references to two dates 09/25 and 10/08. It has also two TODOS. It used to have a reference to [[page y]].
Reproduce the Bug
Not able to repreduce
Expected Behavior
No response
Screenshots
Desktop Platform Information
My graph is saved locally on Mac. It is encrypted. Logseq version is 0.8.7. No plugins. MacOS 12.6. M1. Nothing should modify files on desk. I did not even open any of them out of Logseq.
Mobile Platform Information
No response
Additional Context
I refreshed and reindexed my graph few times during this process. One thing I changed recently was graph date format. I then reindexed. Every thing was fine except one thing: Recent date pages were populating in my pages and graph. Some of them are empty and some have linked references.
Now every time I refresh Logseq it says [[page y]] content was modified and have me chose even if I am in app and did not make any changes.