logseq / logseq

A privacy-first, open-source platform for knowledge management and collaboration. Download link: http://github.com/logseq/logseq/releases. roadmap: http://trello.com/b/8txSM12G/roadmap
https://logseq.com
GNU Affero General Public License v3.0
31.97k stars 1.86k forks source link

Unable to close Logseq, stuck at Syncing internal status #8536

Open ianhellstrom opened 1 year ago

ianhellstrom commented 1 year ago

Search first

What Happened?

Once in a while, Logseq does not close when I click on the X and it says "Syncing internal status".

The dev console shows this:

Error: Cannot write $cljs_bean$core$Bean$$
    at $com$cognitect$transit$impl$writer$marshal$$ (writer.js:417:9)
    at $com$cognitect$transit$impl$writer$emitObjects$$ (writer.js:171:9)
    at $com$cognitect$transit$impl$writer$marshal$$ (writer.js:444:35)
    at $com$cognitect$transit$impl$writer$marshal$$ (writer.js:381:75)
    at $com$cognitect$transit$impl$writer$emitObjects$$ (writer.js:171:9)
    at $com$cognitect$transit$impl$writer$marshal$$ (writer.js:444:35)
    at $com$cognitect$transit$impl$writer$marshal$$ (writer.js:381:75)
    at $com$cognitect$transit$impl$writer$emitMap$$ (writer.js:317:25)
    at $com$cognitect$transit$impl$writer$marshal$$ (writer.js:381:75)
    at $com$cognitect$transit$impl$writer$marshal$$ (writer.js:381:75)
    at $com$cognitect$transit$impl$writer$Writer$$.write (writer.js:508:9)
    at $frontend$db$utils$db__GT_string$$ (utils.cljs:24:19)
    at $frontend$db$persist_BANG_$$ (db.cljs:93:47)
    at repo.cljs:418:5
    at Function.$G__21801__1$$ [as $cljs$core$IFn$_invoke$arity$1$] (core.cljs:4330:10)

Git autosync is disabled on my machine. Waiting does not help either.

Reproduce the Bug

Frankly, I don't know what causes it. Usually when I edit multiple files. But not always.

Expected Behavior

No response

Screenshots

No response

Desktop or Mobile Platform Information

MacOs 13.1 (2021 MacBook Pro with M1 Max chip, 32 GB).

Additional Context

Similar problem but on Win 11: https://github.com/logseq/logseq/issues/7752 And: https://github.com/logseq/logseq/issues/5808

But no proposed solution works for me.

Are you willing to submit a PR? If you know how to fix the bug.

cnrpman commented 1 year ago

Does this happen after recovered from sleep?

ianhellstrom commented 1 year ago

No. It happens when I have worked in Logseq, try to quit without even a screensaver in-between. Just not always but it appears to be in increasing in frequency.

ianhellstrom commented 1 year ago

Could it be related to the size of the graph? I have 2k pages with PDFs and lots of links back and forth.

FYI I have the following plugins installed:

Not sure if that info helps.

cnrpman commented 1 year ago

The comment in #5808 is very similar

ianhellstrom commented 1 year ago

I only have one Logseq window. Multiple tabs perhaps but only one window.

cnrpman commented 1 year ago

Another case: https://discuss.logseq.com/t/i-cant-exit-logseq-without-having-to-force-quit-overall-macos-system-slowdown/15239/6

cnrpman commented 1 year ago

@ianhellstrom Is this working for you?

I did have git auto commit enabled, it is now disabled and appears to be working.

ianhellstrom commented 1 year ago

I have never had autocommit enabled, so no.

jasonzhouu commented 1 year ago

Come across to the same issue and the same error message in the dev console.

I have tried to force reload, but still does not work.

Finally closed it by force quit in activity monitor, now I can close Logseq as normal.

https://user-images.githubusercontent.com/19926174/226106979-8b525b47-a0d5-4c59-9f81-792653228fd6.mov

Mancn-Xu commented 1 year ago

I encountered the same problem with Logseq 0.8.18 and the latest nightly version.

I tried the following steps:

Advanced -> Clear cache Disable all plugins Settings -> Disable Git auto commits With these settings, I can open multiple windows without any errors in both versions.

  1. when I enable Git auto commits in the nightly version, the console displays the message

    "DevTools was disconnected from the page. Once the page is reloaded, DevTools will automatically reconnect." 20230323101423 - CleanShot - Logseq 20230323101837 - CleanShot - Logseq

    and both the original and new windows display a blank page without any content. The app becomes unresponsive and I have to force quit it. Clearing the cache is necessary to restore normal function.

  2. In the 0.8.18 version, I received the notification

"Internal status sync failed" .

But both the original and new windows remained functional.

20230323103310 - CleanShot - Logseq


My system information is as follows:

App Version: 0.8.18、nightly Git Revision: db76ba8 Platform: Mozilla/5.0 (Macintosh Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML like Gecko) Logseq/0.8.18 Chrome/104.0.5112.124 Electron/20.3.8 Safari/537.36 Language: zh-CN

yaahc commented 1 year ago

Same issue, using the sync feature. I'm getting the same "Error: Cannot write ..." error that @ianhellstrom posted

version 0.9.2

cnrpman commented 1 year ago

@yaahc Does clear cache help? It requires a start-from-scratch setup of your graph https://discuss.logseq.com/t/how-to-clear-cache-in-logseq/13693

Saidelocha commented 1 year ago

Same problem here. Don't know what produce that. Force to quit is the only way when that happen.

Macbook pro 14inch 16go Ventura 13.4 Logseq 0.9.9

https://github.com/logseq/logseq/assets/97402209/9ee9ad30-f8fe-4a4d-8079-2dd1f8e664a4

cnrpman commented 1 year ago

@Saidelocha We don't have any clue to stable reproduce this issue yet. Want to know if clear cache (mentioned above) help.

ianhellstrom commented 1 year ago

@yaahc Does clear cache help? It requires a start-from-scratch setup of your graph https://discuss.logseq.com/t/how-to-clear-cache-in-logseq/13693

Not for me

Saidelocha commented 1 year ago

@Saidelocha We don't have any clue to stable reproduce this issue yet. Want to know if clear cache (mentioned above) help.

For the moment, after a force to quit, it's not necessary anymore as the problem have disappeared. Next time, I will try that before to force to quit.

KingMob commented 1 year ago

Someone earlier in the thread asked if it was related to sleep. I just got the error, and it may have been, at least in my case.

I let my macbook's battery drain by accident, so it went into hibernation, and when I restarted it, Logseq started trying to update to the latest version (0.9.10), but was stuck with the error. I toggled the developer tools, clicked the Maximize Window button, and then it crashed.

I restarted Logseq, and it appears to be working, and on the latest version, although the "Recent" section is out of date.

I'm on an Intel Macbook Pro 2019, Ventura 13.4.1, using Logseq 0.9.9 when it crashed. I don't have git syncing turned on, but I used to awhile back. This bug has happened a few times now, but I'm not sure what the commonality is.

ianhellstrom commented 1 year ago

The problem in my case was never related to hibernation, so that alone cannot explain it.

cnrpman commented 1 year ago

Hibernation could be a reason. I have reach this error once, and it's after hibernation

cnrpman commented 1 year ago

We are planing to switch the persist-db towards a sqlite-based solution. Hoping would help fixing this during the transiting.

mdelanno commented 11 months ago

Clearing the cache works for me.

ubuntudroid commented 8 months ago

For me it seems to have been caused by opening a second Logseq window. Though it doesn't seem to always happen.