coddingtonbear / obsidian-local-rest-api

Unlock your automation needs by interacting with your notes in Obsidian over a secure REST API.
MIT License
644 stars 59 forks source link

Plugin Stopped working with. Code 500: Internal Server Error / TypeError... #80

Closed x012 closed 1 year ago

x012 commented 1 year ago

Recently Obsidian Rest Api Plugin stopped working after a restart after a power outage (not sure if related) Since then i tried uninstalling and reinstalling the plugin, but nothing changed.

In the console i see this message:

TypeError: argument entity must be string, Buffer, or fs.Stats
    at etag (plugin:obsidian-local-rest-api:39419:15)
    at generateETag (plugin:obsidian-local-rest-api:40374:16)
    at ServerResponse.send2 [as send] (plugin:obsidian-local-rest-api:43551:20)
    at ServerResponse.json (plugin:obsidian-local-rest-api:43579:19)
    at RequestHandler.returnCannedResponse (plugin:obsidian-local-rest-api:45578:63)
    at RequestHandler.eval (plugin:obsidian-local-rest-api:46188:12)
    at Generator.next (<anonymous>)
    at eval (plugin:obsidian-local-rest-api:79:61)
    at new Promise (<anonymous>)
    at __async (plugin:obsidian-local-rest-api:63:10)

In the client side (https://coddingtonbear.github.io/obsidian-local-rest-api/) I get this response:

Code 500 Undocumented Error: Internal Server Error along with the same error message as above as the 'Response body'

x012 commented 1 year ago

Here is an issue on a different project that seems to be related. It also has a fix, but I have no idea how to apply it (or can it even be applied) here. (I don't have any knowledge with node.js)

https://github.com/ionic-team/ionic-cli/issues/598

calmwaves111 commented 1 year ago

+1, I also meet this

esodesod commented 1 year ago

Can't believe I missed this issue. I'm also seeing this, starting a few days ago (I initially thought it was something wrong with a tag or metadata in one of my notes, which has happened to me before). Anyway, I took some notes into discussion here https://github.com/coddingtonbear/obsidian-local-rest-api/discussions/78

I (incidentally) tested to comment out line 39419, and then "note recall" started working again, and no "ERR" in Obsidian Web anymore. Does not solve the issue, but at least I can use note recall again 😄

coddingtonbear commented 1 year ago

I'm afraid this isn't a problem in obsidian-web, but in the API it interacts with -- could I convince you all into moving this discussion here: https://github.com/coddingtonbear/obsidian-local-rest-api/issues/79?