org-roam-server icon indicating copy to clipboard operation
org-roam-server copied to clipboard

File viewer does not work

Open junwei-wang opened this issue 4 years ago • 18 comments

As you can see in the image:

Request to URL like http://127.0.0.1:8080/20201125095309-coding.html?token=null will return 404.

Screenshot 2020-11-25 at 10 59 28 Screenshot 2020-11-25 at 10 58 45

Configuration:

(setq org-roam-server-host "127.0.0.1"
      org-roam-server-port 8080
      org-roam-server-authenticate nil
      org-roam-server-export-inline-images t
      org-roam-server-serve-files nil
      org-roam-server-served-file-extensions '("pdf" "mp4" "ogv")
      org-roam-server-network-poll t
      org-roam-server-network-arrows nil
      org-roam-server-network-label-truncate t
      org-roam-server-network-label-truncate-length 60
      org-roam-server-network-label-wrap-length 20)

junwei-wang avatar Nov 25 '20 10:11 junwei-wang

Can you try to export a document in your database to html using org-mode export function. C-c C-e h o default key presses.

goktug97 avatar Nov 25 '20 16:11 goktug97

Yes, I can, as it should be.

junwei-wang avatar Nov 25 '20 18:11 junwei-wang

Can you try restarting your computer: https://github.com/org-roam/org-roam-server/issues/107

goktug97 avatar Nov 25 '20 18:11 goktug97

Yes, I will try latter. Meanwhile, this could be useful for debugging.

org-roam-server-root is a variable defined in org-roam-server.el.

Value
"/path/to/.emacs.d/.local/straight/build-27.1/org-roam-server/."
ls /path/to/.emacs.d/.local/straight/build-27.1/org-roam-server/.
assets                       org-roam-server.el
index.html                   org-roam-server.elc
org-roam-server-autoloads.el

junwei-wang avatar Nov 25 '20 18:11 junwei-wang

It still does not work after rebooting.

I notice the following error reported in the minibuffer when enabling org_roam-server-mode

-contains?: Wrong type argument: listp, sp-text-mode-emoticon-p

junwei-wang avatar Nov 25 '20 21:11 junwei-wang

Hi, I find this link https://www.gitmemory.com/issue/org-roam/org-roam-server/75/687602053.

When I had the 404 issue, I tried to enable org-roam-server in a daemon Emacs, which started by brew services. Now, if I tried to enable org-roam-server in non-deamon Emacs, the file viewer now.

With this information, could you figure out where the bug could come from?

junwei-wang avatar Nov 25 '20 21:11 junwei-wang

As far as I remember it was related to smartparens https://github.com/org-roam/org-roam-server/issues/115

goktug97 avatar Nov 27 '20 13:11 goktug97

I had the same issue after a fresh installation of doom emacs, and this 115 indeed solved it for me.

roiholtzman avatar Dec 30 '20 19:12 roiholtzman

This issue has reappeared for me. I am using doom emacs, and I am not sure why it happens now. I still have the configuration given in 115, but it does not help anymore...

roiholtzman avatar Mar 21 '21 10:03 roiholtzman

What error are you getting? The same error?

Not Found
The requested URL was not found on this server.

goktug97 avatar Mar 21 '21 10:03 goktug97

Yes, exactly. However, I see the content of the backlinks... Screen Shot 2021-03-18 at 16 22 34

roiholtzman avatar Mar 21 '21 10:03 roiholtzman

For me, deleting org-roam.db and recreating it fixed the problem. Can you try it?

goktug97 avatar Mar 21 '21 10:03 goktug97

I have the same issue whenever I rename filename of an oram item. The viewer would say that the renamed item is not found.

Maybe, some hook could be added after file is renamed.

发自我的iPad

在 2021年3月21日,11:39,Göktuğ Karakaşlı @.***> 写道:

 For me, deleting org-roam.db and recreating it fixed the problem. Can you try it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

junwei-wang avatar Mar 21 '21 11:03 junwei-wang

For me, deleting org-roam.db and recreating it fixed the problem. Can you try it?

I tried it, but it doesn't help.. I still get the same error.

roiholtzman avatar Mar 21 '21 12:03 roiholtzman

@goktug97 this is the http request I see in the emacs log

(request
 (date "Sun, 21 Mar 2021 09:56:52 GMT")
 (address "127.0.0.1")
 (get "/org-roam-buffer")
 (headers
  ("GET" "/org-roam-buffer?path=/Users/roiho/Dropbox%20(Weizmann%20Institute)/PHD/org-roam/20200924192709-rotator_get_different_geometric_phases_by_an_auxiliary_term.org&label=Rotator:%20get%20different%20geometric%20phases%20by%20an%20auxiliary%20term&token=null" "HTTP/1.1")
  ("Host" "localhost:8080")
  ("User-Agent" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:86.0) Gecko/20100101 Firefox/86.0")
  ("Accept" "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8")
  ("Accept-Language" "en-US,en;q=0.5")
  ("Accept-Encoding" "gzip, deflate")
  ("Connection" "keep-alive")
  ("Referer" "http://localhost:8080/")
  ("Upgrade-Insecure-Requests" "1")
  ("Content" "")))

in the beginning it tries (get "/org-roam-buffer"). is this ok? also, later it asks for an org file and not an html file. it this ok?

roiholtzman avatar Mar 21 '21 15:03 roiholtzman

@goktug97 this is the http request I see in the emacs log

(request
 (date "Sun, 21 Mar 2021 09:56:52 GMT")
 (address "127.0.0.1")
 (get "/org-roam-buffer")
 (headers
  ("GET" "/org-roam-buffer?path=/Users/roiho/Dropbox%20(Weizmann%20Institute)/PHD/org-roam/20200924192709-rotator_get_different_geometric_phases_by_an_auxiliary_term.org&label=Rotator:%20get%20different%20geometric%20phases%20by%20an%20auxiliary%20term&token=null" "HTTP/1.1")
  ("Host" "localhost:8080")
  ("User-Agent" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:86.0) Gecko/20100101 Firefox/86.0")
  ("Accept" "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8")
  ("Accept-Language" "en-US,en;q=0.5")
  ("Accept-Encoding" "gzip, deflate")
  ("Connection" "keep-alive")
  ("Referer" "http://localhost:8080/")
  ("Upgrade-Insecure-Requests" "1")
  ("Content" "")))

in the beginning it tries (get "/org-roam-buffer"). is this ok? also, later it asks for an org file and not an html file. it this ok?

Is this a new issue for you? Did viewer work in the past? /Users/roiho/Dropbox%20(Weizmann%20Institute) Maybe the encoded path causing the problem. Can you try again by copying your roam folder to a local folder (not cloud) without any spaces and changing the path variable accordingly in emacs?

goktug97 avatar Mar 31 '21 12:03 goktug97

@goktug97 this is the http request I see in the emacs log

(request
 (date "Sun, 21 Mar 2021 09:56:52 GMT")
 (address "127.0.0.1")
 (get "/org-roam-buffer")
 (headers
  ("GET" "/org-roam-buffer?path=/Users/roiho/Dropbox%20(Weizmann%20Institute)/PHD/org-roam/20200924192709-rotator_get_different_geometric_phases_by_an_auxiliary_term.org&label=Rotator:%20get%20different%20geometric%20phases%20by%20an%20auxiliary%20term&token=null" "HTTP/1.1")
  ("Host" "localhost:8080")
  ("User-Agent" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:86.0) Gecko/20100101 Firefox/86.0")
  ("Accept" "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8")
  ("Accept-Language" "en-US,en;q=0.5")
  ("Accept-Encoding" "gzip, deflate")
  ("Connection" "keep-alive")
  ("Referer" "http://localhost:8080/")
  ("Upgrade-Insecure-Requests" "1")
  ("Content" "")))

in the beginning it tries (get "/org-roam-buffer"). is this ok? also, later it asks for an org file and not an html file. it this ok?

Is this a new issue for you? Did viewer work in the past? /Users/roiho/Dropbox%20(Weizmann%20Institute) Maybe the encoded path causing the problem. Can you try again by copying your roam folder to a local folder (not cloud) without any spaces and changing the path variable accordingly in emacs?

I don't know what solved the issue, but it is now working great! (among else I updated my doom emacs)

roiholtzman avatar Apr 04 '21 10:04 roiholtzman

@goktug97 this is the http request I see in the emacs log

(request
 (date "Sun, 21 Mar 2021 09:56:52 GMT")
 (address "127.0.0.1")
 (get "/org-roam-buffer")
 (headers
  ("GET" "/org-roam-buffer?path=/Users/roiho/Dropbox%20(Weizmann%20Institute)/PHD/org-roam/20200924192709-rotator_get_different_geometric_phases_by_an_auxiliary_term.org&label=Rotator:%20get%20different%20geometric%20phases%20by%20an%20auxiliary%20term&token=null" "HTTP/1.1")
  ("Host" "localhost:8080")
  ("User-Agent" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:86.0) Gecko/20100101 Firefox/86.0")
  ("Accept" "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8")
  ("Accept-Language" "en-US,en;q=0.5")
  ("Accept-Encoding" "gzip, deflate")
  ("Connection" "keep-alive")
  ("Referer" "http://localhost:8080/")
  ("Upgrade-Insecure-Requests" "1")
  ("Content" "")))

in the beginning it tries (get "/org-roam-buffer"). is this ok? also, later it asks for an org file and not an html file. it this ok?

Is this a new issue for you? Did viewer work in the past? /Users/roiho/Dropbox%20(Weizmann%20Institute) Maybe the encoded path causing the problem. Can you try again by copying your roam folder to a local folder (not cloud) without any spaces and changing the path variable accordingly in emacs?

I don't know what solved the issue, but it is now working great! (among else I updated my doom emacs)

For some reason, it stopped working again. Now the request is empty:

(request
 (date "Sun, 11 Apr 2021 10:22:56 GMT")
 (address "127.0.0.1")
 (get "/roam-data")
 (headers
  ("GET" "/roam-data?token=null" "HTTP/1.1")
  ("Host" "localhost:8080")
  ("User-Agent" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:86.0) Gecko/20100101 Firefox/86.0")
  ("Accept" "text/event-stream")
  ("Accept-Language" "en-US,en;q=0.5")
  ("Accept-Encoding" "gzip, deflate")
  ("Connection" "keep-alive")
  ("Referer" "http://localhost:8080/")
  ("Cookie" "_xsrf=2|6bb1fce4|b5bc1f8bd8d658827fd5a7db71a66952|1616329630; username-localhost-8888=\"2|1:0|10:1616329634|23:username-localhost-8888|44:YTUyZjA2MzQxNGUyNGZlMGFiMTliNTM1MzRlODZiYjc=|b9b2f7b1adb43f02c92534eed7954e431b3d72bfe7796992063c759b35a0cb15\"")
  ("Pragma" "no-cache")
  ("Cache-Control" "no-cache")
  ("Content" "")))

roiholtzman avatar Apr 11 '21 10:04 roiholtzman