spyglass-search / spyglass

A personal search engine: Create a searchable library from your personal documents, interests, and more!
https://docs.spyglass.fyi
GNU Affero General Public License v3.0
2.54k stars 58 forks source link

[Windows] Backend not starting #445

Closed TheSelox closed 1 year ago

TheSelox commented 1 year ago

I installed Spyglass a while ago and then it worked. However, for the last couple of weeks it wouldn't start. Did a fresh reinstall with the latest version downloaded from GitHub and either I'm getting an infinite loading screen with "Waiting for backend" or I'm getting this error message: image

System: Windows 10 22H2

travolin commented 1 year ago

@TheSelox If you don't mind can you attach the logs? On windows they are typically found in C:\Users\\AppData\Roaming\athlabs\spyglass\data\logs.

TheSelox commented 1 year ago

Sorry for the delay, here are the logs

client.log.2023-05-08

2023-05-08T15:27:26.404779Z  INFO spyglass_app: Loading prefs from: "C:\\Users\\<user>\\AppData\\Roaming\\athlabs\\spyglass\\config"    
2023-05-08T15:27:26.409534Z  INFO spyglass_app: checking for update...    
2023-05-08T15:27:26.489003Z  INFO spyglass_app: Registering CmdOrCtrl+Shift+/ as shortcut    
2023-05-08T15:27:26.489232Z  INFO spyglass_app::plugins::notify: starting notify plugin    
2023-05-08T15:27:26.489259Z  INFO spyglass_app::plugins::startup: Running startup tasks    
2023-05-08T15:27:26.489266Z  INFO spyglass_app::plugins::notify: waiting for backend...    
2023-05-08T15:27:26.489317Z  INFO spyglass_app::plugins::startup: Running migrations    
2023-05-08T15:27:26.491403Z  INFO sea_orm_migration::migrator: Applying all pending migrations
2023-05-08T15:27:26.492255Z  INFO sea_orm_migration::migrator: No pending migrations
2023-05-08T15:27:26.492269Z  INFO spyglass_app::plugins::startup: Waiting for server backend    
2023-05-08T15:27:26.492275Z  INFO spyglass_app::rpc: Connecting to backend @ ws://127.0.0.1:4664    
2023-05-08T15:27:26.492293Z  INFO spyglass_app::rpc: connecting to backend via ws://127.0.0.1:4664    
2023-05-08T15:27:26.755864Z ERROR spyglass_app::rpc: sidecar terminated: TerminatedPayload { code: Some(101), signal: None }    
2023-05-08T15:27:56.682281Z  WARN spyglass_app::rpc: error connecting: Transport(Error when opening the TCP socket: No connection could be made because the target machine actively refused it. (os error 10061))    
2023-05-08T15:29:03.083373Z  WARN tao::platform_impl::platform::event_loop::runner: NewEvents emitted without explicit RedrawEventsCleared    
2023-05-08T15:29:03.084837Z  WARN tao::platform_impl::platform::event_loop::runner: RedrawEventsCleared emitted without explicit MainEventsCleared    

server.log.2023-05-08

2023-05-08T15:27:26.552353Z  INFO spyglass: Loading prefs from: "C:\\Users\\<user>\\AppData\\Roaming\\athlabs\\spyglass\\config" 
travolin commented 1 year ago

Thanks for the logs! I am looking into this and have a few guesses, but would like to gather some more information. Can you let me know what processor you have? I am looking to see if your processor supports avx2. The processor information would be under System Information.

TheSelox commented 1 year ago

I have a AMD Ryzen 7 5800X

travolin commented 1 year ago

Well that cpu supports avx2 so I would not expect any issues with whisper, but I still see that as the main possibility. I put together a debug build that removes whisper (audio processing) and adds some log messages. The idea is to narrow down if this is an issue with the whisper library or not.

Exe: https://spyglass-dropbox.s3.amazonaws.com/test-builds/spyglass-server.exe You can replace the spyglass-server.exe found in Program Files/Spyglass/

If you can run it up and see what happens, if it doesn’t work can you post up the server log?

Notes: The code changes made for the test build can be found here https://github.com/spyglass-search/spyglass/commit/785b2a1756f2c9e2267142f706d9f6c1c50f6375

I have run Bitdefender on the resulting exe and it shows clean, but my windows 10 test vm windows defender complains about the file. If you have a virus scan software you should have no issue, but some versions of windows defender seem to be giving some false positives. If you have an issue downloading it let me know and I can try building the full installer and provide that instead.

TheSelox commented 1 year ago

I swapped the executables, but I'm getting the exact same error log. So I don't think whisper is the issue. Spyglass worked when I first installed it a while ago, but now I can't get it to run. Hardware didn't change in the meantime.

travolin commented 1 year ago

Did the server log update with a new "Loading prefs from .. " message?

TheSelox commented 1 year ago

Yes, it did!

2023-05-09T19:08:40.132780Z  INFO spyglass: Loading prefs from: "C:\\Users\\<user>\\AppData\\Roaming\\athlabs\\spyglass\\config"    
2023-05-09T19:08:40.132813Z  INFO spyglass: Migrating Plugins    
2023-05-09T19:08:40.134011Z  INFO spyglass: Loading Preferences    
travolin commented 1 year ago

Awesome, that narrows it down a bit. The main spyglass process is failing to load, but seems to get as far as loading the configuration. There are two main places that it can panic, creating the database connection and connecting to the index.

If you don't mind deleting your db.sqlite file and index folder found in the data_directory that would reset your index and allow the system to create a fresh one. The data folder is typically next to the config folder (the location is configured in the settings.ron file).

TheSelox commented 1 year ago

Thank you! I think that did it. The app is starting normally again.

a5huynh commented 1 year ago

Awesome to hear that that solved the issue @TheSelox. I'll consider this close, feel free to open up another issue you're running into problems still 😃