Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all disappear with version > 0.62 #4539

Closed
L0cutus opened this issue Mar 10, 2022 · 24 comments · Fixed by #4575
Closed

all disappear with version > 0.62 #4539

L0cutus opened this issue Mar 10, 2022 · 24 comments · Fixed by #4575
Labels
fixed-next-release ✅ Fixed, will be in the next release os:linux priority-A query :type/bug Something isn't working. Affects daily use. :type/regression

Comments

@L0cutus
Copy link

L0cutus commented Mar 10, 2022

What happened?

when i start the the app, i see only for a small instant the menu on the left than all disappear (black window)

Reproduce the Bug

simply start any version > 0.62
Linux Mint latest version

Expected Behavior

No response

Screenshots

No response

Desktop Platform Information

No response

Mobile Platform Information

No response

Additional Context

No response

@kwand
Copy link

kwand commented Mar 11, 2022

I'm having the same problem. I can see the top menu appearing, and then everything just becomes a white screen.

Launching logseq from the terminal strangely does not give any error messages (unlike last time when something wasn't properly installed in the build process).

I am on Arch Linux, building from the logseq-desktop-git AUR package.

@andelf
Copy link
Collaborator

andelf commented Mar 11, 2022

@L0cutus Are you running an .AppImage?

@kwand
Copy link

kwand commented Mar 11, 2022

I have an error message now. Seems to be a problem with loading graphs from before version 0.63 (this is only my guess, since I re-compile from source daily - there's a report of a similar issue, version 0.63, in the Discord #bugs channel from a user using an M1 Mac).

This is what shows up in the Developer Console (The user on Discord seems to have the same error message Cannot read properties of null (reading 'toLowerCase')):

Screenshot

image

I am able to get Logseq to load if I purge the settings folder in ~/.config/Logseq. It only fails when I try to reload my graph (with the above error message)


Update. Seems to cause the same issue upon restarting after loading the graph. From the console, it appears it isn't trying to load the previous graph (which failed with error), yet we still get this error message:

Screenshot

image

@andelf Let me know if you require the full console log (and how I should upload it here - I'm not quite familiar with how to use the Developer Tools). I believe you should be able to re-produce, however.

@andelf
Copy link
Collaborator

andelf commented Mar 11, 2022

From the error log, it seems there's a bug in template handling.
more precisely, it might be an error while handling some dynamic variable in your template.

image

Does any of your template contains a <%...%>? If so, can you provide the original documents?

@kwand
Copy link

kwand commented Mar 11, 2022

@andelf Doesn't seem to be the templates (assuming you mean Templates.md within the graph directory) - I only have one that I haven't used in months, so I just deleted the .md file entirely. I didn't see any dynamic variables either.

Same error after reloading (the two errors you see the only ones in the log):

image

Unfortunately, I can't provide my graph - contains too much personal information.

@andelf
Copy link
Collaborator

andelf commented Mar 11, 2022

That's OK. The following steps might help:

  • Clean cache, re-add the graph
  • re-index
  • Split the graph files, to find which file causes the error
  • Search across all files for <% if any

@kwand
Copy link

kwand commented Mar 11, 2022

@andelf I can only get as far as the first step - everything turns into a blank screen once I re-add the graph.

I'm able to search with command-line tools (since I'm on Linux) through all the files however - no trace of <% (and I don't remember typing anything like that either - I don't use dynamic variables, and anything too complicated in my personal graph)

Also, it seems to be able to finish parsing all the files based on what I see in the log. It "crashes" with those two error messages once it gets to Starting to rebuild search indices.

@kwand
Copy link

kwand commented Mar 11, 2022

@andelf
Seem to have found the bug: I noticed there was a log message showing something from the default queries in config.edn - once I commented them out, the graph loaded.

:default-queries
 {:journals
  [{:title               "🔨 NOW"
    :query            [:find (pull ?p [*])
                       :in $ ?start ?today
                       :where
                       [?p :block/marker ?marker]
                       [(contains? #{"NOW" "DOING"} ?marker)]]
    :inputs           [:365d :today]
    :result-transform (fn [result]
                             (sort-by (fn [h]
                                   (get h :block/priority "Z")) result))
    :collapsed?       false
    :breadcrumb-show? false}  

  ;; {:title "❓ Random Block"
  ;; :query [:find (pull ?b [*])
  ;;         :where
  ;;         [?b :block/content ?content]
  ;;         (not [(empty? ?content)])]
  ;; :result-transform (fn [result]
  ;;                     [(rand-nth result)])
  ;; :collapsed? false}

  {:title         "🔥 OVERDUE"
    :query         [:find (pull ?b [*])
                :in $ ?start ?next
                :where
                [?b :block/marker ?marker]
                (or [?b :block/scheduled ?d]
                [?b :block/deadline ?d])
                [(contains? #{"TODO" "DOING" "NOW" "LATER" "WAITING"} ?marker)]
                [(>= ?d ?start)]
                [(<= ?d ?next)]]
    :inputs [:365d :1d]
    :result-transform (fn [result]
                            (sort-by (fn [h]
                                  (get h :block/priority "Z")) result))
    :collapsed? false
    :breadcrumb-show? false}

  {:title "📚Backlog"
  :query [:find (pull ?todo [*]) :in $ ?current-page
  :where
  [?p :block/name ?current-page]
  [?todo :block/marker ?marker]
  (not [?todo :block/page ?p])
  (not [_ :block/refs ?todo])
  [(contains? #{"TODO" "DOING"} ?marker)]
  (or-join [?todo]
        (and  [?todo :block/page ?page]
                  [?page :block/properties ?props]
                  [(get ?props :is) ?is]
                  [(= ?is "active")] )
        (and [?todo :block/page ?page]
                (not-join [?todo]
                              [?todo :block/refs ?ref]
                              [?ref :block/journal? true])
                [(missing? $ ?page :block/properties)])
  ) ]
  :inputs [:current-page]}
    {:title      "📅 NEXT"
      :query      [:find (pull ?p [*])
                  :in $ ?start ?next
                  :where
                  [?p :block/marker ?marker]
                  (or [?p :block/scheduled ?d]
                    [?p :block/deadline ?d]
                  [?p :block/journal-day ?d])
                  [(contains? #{"NOW" "LATER" "TODO" "WAITING"} ?marker)]
                  [(> ?d ?start)]
                  [(< ?d ?next)]]
      :inputs     [:today :7d-after]
      :result-transform (fn [result]
                              (sort-by (fn [h]
                                    (get h :block/priority "Z")) result))
      :collapsed? false
      :breadcrumb-show? false}
  ]}

The query was working before however. Not sure what changed in the recent update?


EDIT: Here's a more detailed error message from the console after trying to reload the queries again:

image

Actually, that query in the log doesn't seem to be related to my default queries (I thought it was showing one of the queries I put in config.edn, but it's not). Though, possibly it's an (internal) query resulting from the default queries?

@andelf andelf added :type/bug Something isn't working. Affects daily use. query :type/regression labels Mar 11, 2022
@Kongxiangzhouye
Copy link

I have the same problem with version 0.63 of win10. The reason for the error may be the same as @locutus. I also use the same query query in config.

@cnrpman
Copy link
Collaborator

cnrpman commented Mar 11, 2022

@locutus @Kongxiangzhouye We might need samples for debugging, including the config.edn and a subset of your graph. Can you send them to junyi@logseq.com ?

@L0cutus
Copy link
Author

L0cutus commented Mar 11, 2022

@L0cutus Are you running an .AppImage?

yes

@L0cutus
Copy link
Author

L0cutus commented Mar 11, 2022

-1646985157606.log
i have attached the console.log just after the start-and-crash of latest 0.63 version, also the config.edn
config.edn.txt

@andelf
Copy link
Collaborator

andelf commented Mar 11, 2022

Thank you @L0cutus

The following code causes the crash. cc @cnrpman

(defn- resolve-input
[input]
(cond
(= :right-now-ms input) (util/time-ms)
(= :start-of-today-ms input) (util/today-at-local-ms 0 0 0 0)
(= :end-of-today-ms input) (util/today-at-local-ms 24 0 0 0)
(= :today input)
(date->int (t/today))
(= :yesterday input)
(date->int (t/minus (t/today) (t/days 1)))
(= :tomorrow input)
(date->int (t/plus (t/today) (t/days 1)))
(= :current-page input)
(string/lower-case (state/get-current-page))
(and (keyword? input)
(util/safe-re-find #"^\d+d(-before)?$" (name input)))
(let [input (name input)
days (util/parse-int (subs input 0 (dec (count input))))]
(date->int (t/minus (t/today) (t/days days))))
(and (keyword? input)
(util/safe-re-find #"^\d+d(-after)?$" (name input)))
(let [input (name input)
days (util/parse-int (subs input 0 (dec (count input))))]
(date->int (t/plus (t/today) (t/days days))))
(and (string? input) (text/page-ref? input))
(-> (text/page-ref-un-brackets! input)
(string/lower-case))

Move likely, the following:

(= :current-page input)
(string/lower-case (state/get-current-page))

(defn get-current-page
[]
(when (= :page (get-current-route))
(get-in (get-route-match)
[:path-params :name])))

@kingwiiwii
Copy link

I have the same issue on Win10 and IOS.

@cnrpman
Copy link
Collaborator

cnrpman commented Mar 11, 2022

@kingwiiwii do disabling queries from config.edn works for your case? Seems something happen there.

@kingwiiwii
Copy link

I've tried commenting them out and it still seems to be happening. Do you have a copy of the default config file and i'll try using that ?

@cnrpman
Copy link
Collaborator

cnrpman commented Mar 11, 2022

@kingwiiwii
config.edn.zip

@kingwiiwii
Copy link

Thanks.

Tried there sorry still the same thing.

@L0cutus
Copy link
Author

L0cutus commented Mar 11, 2022

Thanks.

Tried there sorry still the same thing.

same here, only one time, after i have reindexed my graph and i have copied the config.edn.zip posted just before, it starts but on the next restart -> black screen

@kwand
Copy link

kwand commented Mar 12, 2022

@kingwiiwii @L0cutus Do you both have any other queries in your graph? The only queries I had were in the config.edn (which were custom, copied from somewhere online). Perhaps you can try temporarily removing all pages that contain queries?

Also, ensure to clear the cache after doing so (or after replacing config.edn). You probably will also need to clear the settings directory (On Linux, it's ~/.config/Logseq. I don't know where the folder is on other OSes) in order to stop your graph from automatically loading and causing a blank screen to access the settings to the clear the cache.

@cnrpman I am able to consistently restart and open my graph with the default config.edn however.

@cnrpman I believe the crashing may have something to do with this query. Again, this is a custom query that I copied from somewhere - IIRC, here.

Also did some further testing. I am able to load every query that I commented out previously, except for this one:

  {:title "📚Backlog"
  :query [:find (pull ?todo [*]) :in $ ?current-page
  :where
  [?p :block/name ?current-page]
  [?todo :block/marker ?marker]
  (not [?todo :block/page ?p])
  (not [_ :block/refs ?todo])
  [(contains? #{"TODO" "DOING"} ?marker)]
  (or-join [?todo]
        (and  [?todo :block/page ?page]
                  [?page :block/properties ?props]
                  [(get ?props :is) ?is]
                  [(= ?is "active")] )
        (and [?todo :block/page ?page]
                (not-join [?todo]
                              [?todo :block/refs ?ref]
                              [?ref :block/journal? true])
                [(missing? $ ?page :block/properties)])
  ) ]
  :inputs [:current-page]}

Not sure if this is related, but I saw that there's pull request (#4540) mentioning there are currently bugs with nested not statements in queries? The query above that appears to be causing problems also happens to have nested nots.

Unfortunately, I can't seem to able to compile and test the PR (since I'm reliant on logseq-desktop-git AUR package - I haven't set up a development environment). While it doesn't appear that this PR would solve the problem (since it's a 0.6.2 issue - and as far as I know, crashing to white screen did not happen previously with this query), I guess it's worth taking a look at?

Ignore what I said here (the strikethroughed text). Not related.


For easy reference (also posted in a previous reply), the queries that I commented out previously:

:default-queries
 {:journals
  [{:title               "🔨 NOW"
    :query            [:find (pull ?p [*])
                       :in $ ?start ?today
                       :where
                       [?p :block/marker ?marker]
                       [(contains? #{"NOW" "DOING"} ?marker)]]
    :inputs           [:365d :today]
    :result-transform (fn [result]
                             (sort-by (fn [h]
                                   (get h :block/priority "Z")) result))
    :collapsed?       false
    :breadcrumb-show? false}  

  ;; {:title "❓ Random Block"
  ;; :query [:find (pull ?b [*])
  ;;         :where
  ;;         [?b :block/content ?content]
  ;;         (not [(empty? ?content)])]
  ;; :result-transform (fn [result]
  ;;                     [(rand-nth result)])
  ;; :collapsed? false}

  {:title         "🔥 OVERDUE"
    :query         [:find (pull ?b [*])
                :in $ ?start ?next
                :where
                [?b :block/marker ?marker]
                (or [?b :block/scheduled ?d]
                [?b :block/deadline ?d])
                [(contains? #{"TODO" "DOING" "NOW" "LATER" "WAITING"} ?marker)]
                [(>= ?d ?start)]
                [(<= ?d ?next)]]
    :inputs [:365d :1d]
    :result-transform (fn [result]
                            (sort-by (fn [h]
                                  (get h :block/priority "Z")) result))
    :collapsed? false
    :breadcrumb-show? false}

  {:title "📚Backlog"
  :query [:find (pull ?todo [*]) :in $ ?current-page
  :where
  [?p :block/name ?current-page]
  [?todo :block/marker ?marker]
  (not [?todo :block/page ?p])
  (not [_ :block/refs ?todo])
  [(contains? #{"TODO" "DOING"} ?marker)]
  (or-join [?todo]
        (and  [?todo :block/page ?page]
                  [?page :block/properties ?props]
                  [(get ?props :is) ?is]
                  [(= ?is "active")] )
        (and [?todo :block/page ?page]
                (not-join [?todo]
                              [?todo :block/refs ?ref]
                              [?ref :block/journal? true])
                [(missing? $ ?page :block/properties)])
  ) ]
  :inputs [:current-page]}
    {:title      "📅 NEXT"
      :query      [:find (pull ?p [*])
                  :in $ ?start ?next
                  :where
                  [?p :block/marker ?marker]
                  (or [?p :block/scheduled ?d]
                    [?p :block/deadline ?d]
                  [?p :block/journal-day ?d])
                  [(contains? #{"NOW" "LATER" "TODO" "WAITING"} ?marker)]
                  [(> ?d ?start)]
                  [(< ?d ?next)]]
      :inputs     [:today :7d-after]
      :result-transform (fn [result]
                              (sort-by (fn [h]
                                    (get h :block/priority "Z")) result))
      :collapsed? false
      :breadcrumb-show? false}
  ]}

Actually, had some trouble reproducing for a second - seems like I have to clear the cache every time I add a new query to config.edn? (Adding the problematic query indeed causes everything to go white screen)

@kwand
Copy link

kwand commented Mar 12, 2022

Looking at the commits, @logseq-cldwalker @tiensonqin I suspect this has something to do with the work that's been done on queries in the last 2-3 days? (I compile daily, and haven't had problems until Mar 10th)

@pinusm
Copy link

pinusm commented Mar 13, 2022

happens to me as well. 0.63, on Win11.

@L0cutus
Copy link
Author

L0cutus commented Mar 15, 2022

for me the problem still persist.
(tested the latest nightly build 14/03/2022)

@L0cutus
Copy link
Author

L0cutus commented Mar 16, 2022

Seems latest nightly (20220316) fixed the problem for me thanks !

@logseq-cldwalker logseq-cldwalker removed their assignment Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-next-release ✅ Fixed, will be in the next release os:linux priority-A query :type/bug Something isn't working. Affects daily use. :type/regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants