Use of Local Images Plus breaks REST API #129
Replies: 15 comments 1 reply
-
I'm hoping to centralize all of the conversation around this issue here from the various places the conversation has been ongoing including, at least:
So far: I haven't been able to reproduce this on my end, so I don't have a very good idea about where to look. I'm running this plugin in the following environment:
& have tried probably a dozen operations including, at least:
without any trouble whatsoever. If any of you all have any guesses, I'd love to hear them! |
Beta Was this translation helpful? Give feedback.
-
I can verify that at least Local REST API (1.6.0) is working normally in a "test vault", with the same version of Obsidian (v1.4.15 Insider and installer v1.4.14), and in the same OS/packages, so I guess there is a combination of x and y, causing issues. When time permits, I'll try to narrow it down by "dissecting" plugins, and then maybe notes (which contain metadata).
As mentioned in the discussion #78, if I put a line with if (!isStats && typeof entity !== "string" && !Buffer.isBuffer(entity)) {
console.log("Entity: " + (entity));
throw new TypeError("argument entity must be string, Buffer, or fs.Stats");
} .. And as mentioned, if I comment out the line throwing the error (39419), note recall at least works as expected again (though it's not a solution) Screenshot from Obsidian > Developer Tools > Console (cleared first), after a (single) reload on a URL-matching webpage (this GitHub issue), only contained in the note below. In Developer Tools > Sources, the scope for "etag" seems to be "buffer". I have no idea how to "inspect it further" (tried looking at the memory inspector for the buffer, but I don't see any obvious issues here) I've also tried disabling "Note Recall" (which is the main future I really love and use the most). I then found that just by entering the API key in Obsidian Web, the TypeError is thrown. I've also been running "insecure" (since only used locally here), but as mentioned in this issue, I also get the TypeError, just by trying to download the certificate: A quick check using openssl, shows some more details. At least the certificate is valid (but not trusted in my browser, since I don't use anymore).
In my "test vault", I get directly to the "download certificate" (without the error). PS: I also tried to reset crypto in Local REST API, and reloaded the plugin, but the same issue still occurs. BTW: I'm no developer, but if you know any "tricks" on how to increase verbosity/logging, etc., I guess I'll manage to implement it. Since everything is working as expected in my test vault, it will be interesting to see results after trying to dissect a bit more. I'll update when time permits. |
Beta Was this translation helpful? Give feedback.
-
I find https://github.com/Sergei-Korneev/obsidian-local-images-plus , the newest version may break local |
Beta Was this translation helpful? Give feedback.
-
Thanks @calmwaves111 👍 . I also recently updated local images plus to version 0.15.8 (https://github.com/Sergei-Korneev/obsidian-local-images-plus/releases/tag/0.15.8), so it's something here... I (also) got it working (fully) after disabling local images plus (0.15.8), and using Obsidian Web in secure/encrypted mode (disabled "Enable Non-encrypted (HTTP) Server). Verified traffic using tcpdump/wireshark (port 27124 being used). Trying to use non-encrypted, I also got an "ERR" in Obsidian Web. Based on tcpdump, it still tries to use port 27124. Removing the certificates from my "keychain" (not trusted anymore), reloading Local REST API plugin in Obsidian, and restarting the browser, then going into Obsidian Web, removing the API key, then "pressing anywhere" outside the API key field (to save???), and then re-entering the key seems to solve that as well (it now connects non-encrypted, using port 27123). After the steps outlined, I also get the "icon" for non-encrypted. So after disabling local images plus v0.15.8, I got it working again, both in secure and non-secure mode. |
Beta Was this translation helpful? Give feedback.
-
Regarding the ERR in Obsidian Web, I noticed it's a bit "tricky" to change around, e.g. from non-encrypted to encrypted, and vice versa (resulting in "ERR" in Obsidian Web). This might be more related to the Obsidian Web behavior, but leaving my notes here, if it helps: After successfully being set up using non-encrypted (certificate not imported/trusted), I can verify traffic and connections, using port 27123. If I then import the certificate (into the trusted keychain, for MacOS), restart the browser, and reload the Local REST API plugin, I immediately see the "encrypted icon" from Obsidian Web > Options (without changing anything.. yet). BUT Obsidian Web (in Vivaldi here) still connects to non-encrypted, using port 27123 (see below) ❯ grc sudo lsof -iTCP -n -P|egrep -e '(27123|27124)'
Obsidian 20949 esod 34u IPv4 0xe161315d72222c05 0t0 TCP 127.0.0.1:27124 (LISTEN)
Obsidian 20949 esod 42u IPv4 0xe161315d71db0295 0t0 TCP 127.0.0.1:27123 (LISTEN)
Obsidian 20949 esod 48u IPv4 0xe161315d724defb5 0t0 TCP 127.0.0.1:27123->127.0.0.1:57433 (ESTABLISHED)
Vivaldi 29317 esod 34u IPv4 0xe161315d7222374d 0t0 TCP 127.0.0.1:57433->127.0.0.1:27123 (ESTABLISHED) If I then disable non-encrypted by de-selecting "Enable Non-encrypted (HTTP) Server", reload the Local REST API plugin, and restart the browser, I actually get the ERR again (note that certificate is now fully trusted, and should be working) Checking connections, it seems to establish "something" on port 27124 (maybe the plugin settings, itself?) ❯ grc sudo lsof -iTCP -n -P|egrep -e '(27123|27124)'
Obsidian 20949 esod 34u IPv4 0xe161315d72e6f74d 0t0 TCP 127.0.0.1:27124 (LISTEN)
Obsidian 20949 esod 42u IPv4 0xe161315d72842fb5 0t0 TCP 127.0.0.1:27124->127.0.0.1:57649 (ESTABLISHED)
Vivaldi 30447 esod 30u IPv4 0xe161315d72502fb5 0t0 TCP 127.0.0.1:57649->127.0.0.1:27124 (ESTABLISHED) BUT the client (Obsidian Web) still also seems to try to connect to port 27123, based on traffic, e.g. this snippet from tcpdump (viewed in wireshark), while using note recall. To "solve it", I have to:
Obsidian Web now connects successfully using encrypted mode, without any ERR. |
Beta Was this translation helpful? Give feedback.
-
My problem is that if I open 【Search for previous notes about this page in the background】 in obsidian-web, obsidian-web will show err, win 10, obsidian 1.4.14, loacal rest api 1.6.0, edge 117.0.2045.43 This seems to be due to edge, I have everything working fine in chrome after I uninstalled local-images-plus I don't know what to do because it was working fine a few days ago |
Beta Was this translation helpful? Give feedback.
-
Basically what I noticed as well (but MacOS and Vivaldi). Did you try my "solution" mentioned above (re-entering the API Key, after reloading Local REST API plugin AND reloading your browser)? At least that worked for me, both going from encrypted > non-encrypted, and from non-encrypted to encrypted. If not, I'd spin up a tcpdump, just to verify that (all) traffic was going as expected (based on your settings, that is). Anyways, I guess this is "out of scope" for this issue, and more related to how Obsidian Web (re)connects to the Local REST API. |
Beta Was this translation helpful? Give feedback.
-
yes, I create a new ob vault, then installed the local rest api plugin, and then connected the key of this new vault. The problem of this issue should only be related to the update of local image plus. maybe I have to propose an issue with local image plus. |
Beta Was this translation helpful? Give feedback.
-
Great! As mentioned, it seems a bit tricky to "save changes" in Obsidian Web sometimes, hence my little "remove API key, click somewhere, and re-apply the very same API key"-trick. I know the extension is mainly for Chrome, so could be Vivaldi-related (in my case, at least).
Please do! I'll follow, and assist (more) if possible 👍 . For now, I've just pinned version Local Images Plus on 0.15.7 using Obsidian BRAT, as the issues with Local REST API only seems to occur in combination with the latest version (0.15.8). |
Beta Was this translation helpful? Give feedback.
-
Disabling 'Local Images Plus' and restarting Obsidian also did the trick for me! |
Beta Was this translation helpful? Give feedback.
-
It is something related to the http etags, I guess. You are very welcomed to investigate and propose a patch (to this software or mine ). |
Beta Was this translation helpful? Give feedback.
-
My setup is very similar to @coddingtonbear (thank you for this plugin, BTW), Ubuntu 23.04, Local Rest API 1.6.0, but my Obsidian appimage is 1.4.16. This same problem started for me and it's not only this plugin, but the Telegram sync plugin can no longer function, and it has a similar error: I'll try the suggestions with Local Images Plus and report back. Yes, in fact Local Rest API and Telegram Sync are once again working, so that plugin seems to be the culprit. |
Beta Was this translation helpful? Give feedback.
-
We're still discussing possible changes/compatibility issues at Sergei-Korneev/obsidian-local-images-plus#47 The issue is possibly related to the Again, I'm no developer (which I guess should be a "prerequisite" for troubleshooting the code here 🙈), but I love both plugins, hence wanting to help, as much as I can. I don't know if we should keep the issue open here (until fixed), but I guess @coddingtonbear can decide. |
Beta Was this translation helpful? Give feedback.
-
I don't mind keeping the issue open so folks can find it, but from what I can read on Sergei-Korneev/obsidian-local-images-plus#47, it does look like this is, unfortunately, a problem that would need to be fixed there rather than here. For those looking for a TLDR: if I understand the conversation there -- and, please, correct me if I don't -- the problem is rooted in a dependency used by @57r31 has posted a pull request https://github.com/Sergei-Korneev/obsidian-local-images-plus/pull/48/files#diff-4fab5baaca5c14d2de62d8d2fceef376ddddcc8e9509d86cfa5643f51b89ce3dR1024 that corrects the changes made by Unfortunately @Sergei-Korneev is too busy right now to help with this further, and, honestly, I can relate to that! Please try to keep in mind that those of us who work on open-source projects like this one are doing so as volunteers in our free time because we enjoy the creative pursuit and could just as easily decide to be spending our time drinking margaritas on a beach or playing video games. How you engage with folks who work on open-source projects impacts how much those folks continue to enjoy it... and you're dependent on them enjoying the work for them to do the work. If you don't think you have software skills -- you probably have more than you think! You're on github right now, and this stuff isn't as complicated as you might imagine; give it a shot! To help out, I think there look to be a few different things you might be able to do:
Good luck and, hopefully, have fun! |
Beta Was this translation helpful? Give feedback.
-
I assume this issue has resolved by now given the lack of conversation over the last year. Even if it isn't, this issue is a problem in a separate library that can't be resolved here; so I'm going to convert this to a discussion so folks can reference it in discussions about ways to resolve the problem via changes to the Local Images Plus plugin. |
Beta Was this translation helpful? Give feedback.
-
obsidian-web js a brower-plugin:https://github.com/coddingtonbear/obsidian-web
now it cannot work well,In the console i see this message:
there is more information in this issue:#80
in fact. I also meet this error in other case:when I click the 【 download this certificate】It will jump to the edge browser and report this error

Beta Was this translation helpful? Give feedback.
All reactions