brianpetro / obsidian-smart-connections

Chat with your notes & see links to related content with AI embeddings. Use local models or 100+ via APIs like Claude, Gemini, ChatGPT & Llama 3

Home Page:https://smartconnections.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Obsidian hangs when creating new files

jowitte opened this issue · comments

Since a few days Obsidian is hanging whenever I create a new file and Smart Connections tries to create embeds - see screenshot.

Screenshot by Dropbox Capture

Is anybody else experiencing a similar issue?

One case where I've seen this happen is with really large notes (>100K words). Do you think that could be what's happening here?

🌴

No. I only have small notes with max. 200-300 words.

Based on the screenshot, are you saying it gets stuck at that point? Or are you just trying to show the process that's occurring after each new note? 🌴

One case where I've seen this happen is with really large notes (>100K words). Do you think that could be what's happening here?

🌴

It happens with me; I have a similar sized vault (2600 notes). This problem occurs mainly when using block embeddings. Note embeds are relatively less problematic for me.

It just freezes the M2 Mac, does not get stuck though.

@brianpetro Is there a recommended hack to use block embeds without this happening?

@brianpetro It's what happens after creating a new note, switching to a different note and then back again to the newly created note.

+2024-06-12: It also happens if I rename files.

Hey @jowitte & @uva2212

As of v2.1.72/2.2.22, a "full scan" is no longer initiated when creating a new note.

🌴

@brianpetro This happens again in 2.2.27.

Hey @jowitte

So far, on multiple occasions, the "Making Smart Connections..." process has locked up Obsidian because of a single, very large file.

There also has been an instance where this happens when somehow the frontmatter was repeated many times at the beginning of the note, which might be related to this https://forum.obsidian.md/t/issue-using-obsidian-sync-sometimes-duplication-of-content-in-same-note/19829/23

Identifying and excluding the largest note files in your vault would be a good idea to see if that fixes this. Otherwise, I will need something to investigate to help—for example, a screenshot of any errors appearing in the developer console when this happens.

If you can identify any files causing this, it would also be helpful if you sent them my way so that I can build some test cases around them to prevent the issue in the future.

🌴

I only have short notes. But my vault contains roughly 5'000 notes.

However: I can reproduce this - it always happens when I extract content into a new file using the note Composer. The extraction works, but if I then switch to the new file, Obsidian hangs and in the developer console there is an endless loop with messages shown in the screenshot. The first message I can see is as well in one screenshot.

Screenshot by Dropbox Capture

Screenshot by Dropbox Capture

Screenshot by Dropbox Capture
Screenshot by Dropbox Capture

Hey @jowitte

Thanks for elaborating on that and providing those screenshots. Unfortunately, I still have more questions than answers.

To help get those answers, I just shipped an update that improves those error logs to help us better understand what's causing the error.

Unfortunately, I couldn't reproduce the issue using the composer extraction. If you can reproduce the issue with a handful of notes you are willing to share, I can try to reproduce the issue with those notes in a test vault.

The error in your second screenshot is from the copilot plugin. While it's probably unrelated, it might be worth trying again after disabling that plugin just to make sure there isn't some sort of compatibility issue.

After updating, if the error happens again, the blank line should be replaced with a "batch" object. It would be helpful to click on the to ensure that each batch is different. This way we can rule out some sort of infinite loop issue.

Thanks for your help in solving this
🌴

I forced refresh and disabled Copilot. Now the error is gone, but in the console I get
Screenshot by Dropbox Capture

@jowitte that error shouldn't impact anything, it simply is saying that the plugin isn't connecting to Smart Connect app.

Is everything else working now? Are you still able to reproduce the other "error importing" issue? 🌴

Issue remains...i attached to origin note, the target note and a screenshot of the console. The console runs in an endless loop and then I get the crash.

Werbemarkt-Daten Schweiz.md
Test for Smart Connections Crash.md
Screenshot by Dropbox Capture

I also validated, that this is not related to the Note Composer extraction. It happens when I create a new note and the switch to the new note.

I can confirm the error @jowitte has.

When opening an empty file trough a link with the "Smart Connections Files" pane open, the log is flooded with exactly the same error message causing Obsidian to freeze and eventually die.

Steps to reproduce:

  1. Have the Smart Connections Files' pane open on the side.
  2. Open any note.
  3. Create a link to a non-existing note (e.g. [[123123123]])
  4. Click on the link to that note.

Thanks @jgontrum . I guess we're getting closer - if I close the "Smart Connections Files" pane everything works as expected. Opening the pane while a new file is open causes the above described behaviour. So it somehow seems to be related to the pane...

@jowitte I just tried reproducing again, this time using the files attached above and the instructions provided by @jgontrum

Unfortunately, I still have no luck in reproducing the error.

The best way forward may be if either of you can initiate a test vault I can use to investigate this. Basically, a minimal vault that I can use to follow the instructions to see the error in action.

Once the vault is created, you can zip the vault folder and send it to me. In case the vault has any private info/credentials, instead of uploading here, you can send the zip to brian at smartconnections.app.

Thanks for both of your help in getting to the bottom of this
🌴

I've sent a vault to you with a reduced note set. I was able to reproduce the error.

@jowitte @jgontrum @uva2212 this should be fixed as of v2.1.82

It turns out that the issue was caused by erroneous logic that only occurs when a specific notification is muted, which made it hard to debug.

Huge thanks to @jowitte for pushing this across the finish line, including creating a test vault for me to reproduce the issue. I wouldn't have been able to figure this one out without that support 👏😊

@jowitte once you confirm the issue is fixed, please do the honors of closing this issue.

Thanks again for your support in improving Smart Connections!
🌴

Works like charm. Big thanks to @brianpetro - keep up the good work!