chrisgrieser / shimmering-obsidian

Alfred Workflow with dozens of features for controlling your Obsidian vault.
https://alfred.app/workflows/chrisgrieser/shimmering-obsidian/
MIT License
830 stars 41 forks source link

[Bug]: cannot search (o ... search) #108

Closed boxcounter closed 1 year ago

boxcounter commented 1 year ago

Bug Description

cannot search using o ...

image

Relevant Screenshot

image

To Reproduce

No response

Debugging Log

[09:30:39.782] Logging Started...
[09:30:42.331] Shimmering Obsidian[Script Filter] Queuing argument '(null)'
[09:30:42.616] Shimmering Obsidian[Script Filter] Script with argv '(null)' finished
[09:30:42.621] ERROR: Shimmering Obsidian[Script Filter] Code 1: /Users/boxcounter/Alfred.alfredpreferences/workflows/user.workflow.B844E779-37E6-4BDB-8178-E9B075D501F3/scripts/o_search.js: execution error: Error: SyntaxError: JSON Parse error: Unexpected EOF (-2700)
[09:37:27.490] Shimmering Obsidian[Script Filter] Queuing argument '(null)'
[09:39:39.871] Shimmering Obsidian[Script Filter] Queuing argument '(null)'

Workflow Configuration 1

image

Workflow Configuration 2

image

Version & System Information

- macOS: 13.1 (22C65)
- Obsidian: 1.1.9
- Alfred: v5.0.6 [2110]
- Shimmering-obsidian: v.3.3.0
- Advanced URI: v1.31.2
- Metadata Extractor: v1.1.0

Make sure you have done the following

chrisgrieser commented 1 year ago

could you add the full output of the oinfo command?

cjinfantino commented 1 year ago

This also did not work for me with 3.3.0 or 3.2.3. It was when I downgraded to 3.2.2 that it started working as expected.

chrisgrieser commented 1 year ago

it would really helpful if you could be a bit more explicit what exactly works when and when not.

if oinfo works in 3.2.2, please attach the output


also in general, you could try a full reinstall, meaning removing the workflow completely and then installing it again (not installing on an existing installation)

cjinfantino commented 1 year ago

Yes, apologies for the lack of detail. In 3.3.0 and 3.2.3 I was unable to search, e.g 'o', or use any keywords that I tested except for 'oo'. When I would type in the other keywords, alfred would quickly flash the workflow then disappear.

When I installed 3.2.2 all the keywords, including searching with 'o ' functioned normally. But, in the process of getting 'oinfo' for you, 3.3.0 is now working. Let me give the steps to make it clear what happened:

  1. Fresh install 3.3.0 (I never installed this workflow before)
  2. Could not search 'o'
  3. Read directions and installed URI and Metadata plugin to Obsidian
  4. Could not search 'o'
  5. Uninstalled 3.3.0 and then reinstalled
  6. Could not search 'o'
  7. Downgraded to 3.2.3 place over 3.3.0
  8. Could not search 'o'
  9. Uninstall workflow completely
  10. Installed 3.2.3 fresh
  11. Could not search 'o'
  12. Installed 3.2.2 over place of 3.2.3
  13. Search worked with 'o' and other keywords
  14. Began writing this post and ran 'oinfo' for 3.2.2
  15. Installed 3.3.0
  16. Ran 'oinfo'
  17. Tested search with 'o' and it worked.

Hope this helps. It seems a fresh install of 3.3.0 without ever having the workflow installed before is the only thing I can think that was different.

oinfo for 3.2.2

-------------------------------
Metadata JSONs: 4/3
Metadata String Length: 125685
-------------------------------
WORKSPACE DATA
'workspace.json' exists
-------------------------------
INSTALLED VERSION
macOS: 13.1
Alfred: 5.0.6
---
Obsidian: .asar file missing
This Workflow: 3.2.2
Advanced URI Plugin: 1.31.2
Metadata Extractor: 1.1.0
-------------------------------
LATEST VERSION
Obsidian: 1.1.9 (Insider: 1.1.9)
This Workflow: 3.3.0
Advanced URI Plugin: 1.31.2
Metadata Extractor: 1.1.0
-------------------------------
INTERNAL WORKFLOW CONFIGURATION
Vault Path: /Users/cjinfantino/Dropbox/Apps/Obsidian_Vault
Vault Name (encoded): Obsidian_Vault
-------------------------------

oinfo for 3.3.0

-------------------------------
Metadata JSONs: 4/3
Metadata String Length: 126773
-------------------------------
WORKSPACE DATA
'workspace.json' exists
-------------------------------
INSTALLED VERSION
macOS: 13.1
Alfred: 5.0.6
---
Obsidian: .asar file missing
This Workflow: 3.3.0
Advanced URI Plugin: 1.31.2
Metadata Extractor: 1.1.0
-------------------------------
LATEST VERSION
Obsidian: 1.1.9 (Insider: 1.1.9)
This Workflow: 3.3.0
Advanced URI Plugin: 1.31.2
Metadata Extractor: 1.1.0
-------------------------------
INTERNAL WORKFLOW CONFIGURATION
Vault Path: /Users/cjinfantino/Dropbox/Apps/Obsidian_Vault
Vault Name (encoded): Obsidian_Vault
-------------------------------
chrisgrieser commented 1 year ago

thanks for the thorough retracing! I have added some extra safety-nets to handle this stuff, so the issue should not occur anymore.

boxcounter commented 1 year ago

Hi, chrisgrieser. I've installed v3.3.2, Neither oinfo nor o ... worked for me.

Steps:

  1. uninstall 3.3.0
  2. install 3.3.2
  3. run oinfo, no output in clipboard
  4. run osetup, choose the only vault. Obsidian restarted automatically, and Alfred popped up a failure hint and suggested me to run oupdate. (picture 1)
  5. run oupdate, Alfred popped up a succuessful hint. (picture 2)
  6. run oinfo, still no ouput.
  7. run o ... , search did not work neither.

picture 1:

image

picture 2:

image

debug log:

image
cjinfantino commented 1 year ago

@boxcounter have you tried installing 3.2.2 first and seeing if that works? I haven't dug in, but that's when it started working for me, and one thing I noticed was with 3.3.0, it appeared to be missing some of the workflows. When I installed 3.2.2 and looked in Alfred I noticed all the workflows and hotkey.

Again, I have no idea if it's the answer, as I didn't dig in too much.

I would try:

  1. Install 3.2.2 in-place
  2. Test
  3. If it works upgrade in-place to 3.3.2
  4. Test
chrisgrieser commented 1 year ago

@boxcounter from your debugging log, it looks like the writing of the metadata wasn't successful.

Could you run Metadata Extractor: Write JSON File to disk. from the command palette and then try again o and oinfo?

Also, could you show your environment variables again, now after the re-installation?

chrisgrieser commented 1 year ago

oh, another potential issue might be if you named your Obsidian config folder to something other than .obsidian

boxcounter commented 1 year ago

@boxcounter from your debugging log, it looks like the writing of the metadata wasn't successful.

Could you run Metadata Extractor: Write JSON File to disk. from the command palette and then try again o and oinfo?

Also, could you show your environment variables again, now after the re-installation?

o ... and oinfo did not work after Metadata Extractor: Write JSON file with metadata to disk run. image

Enviroment variables are:

image

And Obsidian config folder is left untouched:

image

And Metadata Extractor setting is left unchanged:

image image
boxcounter commented 1 year ago

Thanks. It works when I downgraded to 3.2.2. and also works when I upgraded it to 3.3.2.

chrisgrieser commented 1 year ago

And Metadata Extractor setting is left unchanged:

hah, that's the issue though, they should be untouched by you, but the Alfred workflow should touch them. (that's what the restart on osetup does, or at least is supposed to do.)

by having periodic writing and writing on launch disabled, the metadata never gets written, which is also consistent with the debugging log further above. for whatever reason, those settings have not been enabled by osetup, even though they should 🤔

boxcounter commented 1 year ago

hah, thanks for your explanation, chrisgrieser. I got it.

Is there anything I can do to help you fix this issure?

chrisgrieser commented 1 year ago

unfortunately, I do not really have any idea what's causing this, and as long as I cannot reproduce it, it's not really easy to think of something

Vlahn commented 1 year ago

I know it's not helpful to not submit any additional info for a bug report.. However, I really wanted to add to the existing reports above to say that I too am experiencing this issue (keyword: 'o' not working). I also have the experience of the 'metadata export' failing to work as the workflow expected and needing to manually trigger it (which is reported to succeed).

  1. I have followed the various steps described above (unchecked retain settings on workflow import, osetup, oupdate etc)
  2. I have tried installing 3.2.2 and it has not helped either
  3. I have tried removing the workflow and reinstalling without any success either.

I am on an M1 Mac. I am using a current public build of Obsidian (1.1.9).

chrisgrieser commented 1 year ago

okay, I have rewritten larger parts of the workflow to avoid issue an Alfred method for reading config data. Now running osetup should work far more reliably.

boxcounter commented 1 year ago

Hi, it happened again after I upgraded it to v3.5.3. And like before, works after I degraded to v3.2.2.

chrisgrieser commented 1 year ago

yeah, I cannot really fathom what could cause that issue.

The only thing I could think of is an Obsidian-side issue from the migration von 0.x to 1.x. You can quit Obsidian, delete workspace and/or a workspace.json file in {vaultpath}/.obsidian (hidden folder, can be made visible with cmd+shift+.), start Obsidian again and then try whether osetup works. (This will only delete your current workspace, meaning your sidebar tabs will be reset and you will have to add your tabs there manually again.)


If that does not help, I think creating a new bug report would be best. Since larger parts of the workflow have been rewritten with 3.5, I'd need the new debugging logs, the new oinfo output etc from the latest version to determine what could still be causing this – basically I'd need a fresh set of all the debugging-related information before I can really do anything.

chrisgrieser commented 1 year ago

closing this since I assume it's fixed. And if not, someone with this issue needs to submit a new bug report form, since I'd need the debugging logs with the new version anyway