Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load Better BibTex #236

Closed
ZhengJIN94 opened this issue Oct 23, 2023 · 26 comments
Closed

Failed to load Better BibTex #236

ZhengJIN94 opened this issue Oct 23, 2023 · 26 comments
Labels
bug Something isn't working

Comments

@ZhengJIN94
Copy link

Hi,

After I installed ZotLit, there is an error as follow figure

image

I am sure the better-bibtex-search.sqlite is in that directory.

Another issue is that when I use [@ to cite literature, it return back as [@undefined].

It there any way to solve these two problems?

@retorquere
Copy link

retorquere commented Oct 23, 2023

The citation keys have moved. They live in better-bibtex.sqlite now, that database must be mounted using

ATTACH DATABASE '<path to better-bibtex.sqlite>' AS betterbibtex

after which the citation keys can be read from betterbibtex.citationkey.

@retorquere
Copy link

I tried to prepare a PR but I don't understand the source code of this plugin.

@aidenlx
Copy link
Member

aidenlx commented Oct 24, 2023

Noted, will update shortly

@aidenlx aidenlx added the bug Something isn't working label Oct 24, 2023
@aidenlx
Copy link
Member

aidenlx commented Oct 24, 2023

@retorquere could you provide the version of the better bibtex?

@retorquere
Copy link

6.7.132 or later.

@benpla
Copy link

benpla commented Oct 26, 2023

I have a similar effect (noted here for clarifying):
It differs in Zotero items created before the update and Zotero items created now.

OLD Zotero Items:
On "Create Literature Note" all is fine: citekey is specified correctly.

NEW Zotero Items (added after update):
citekey first looks like it always does in Zotero, but On "Create Literature Note" citekey are "undefined".

grafik

Note:
If I change an old Citekey and "Create Literature Note", then the change take not into account and the old key is exported.

BibTeX: 6.7.132
Obsidian Note for Zotero: 1.0.1

@retorquere
Copy link

That's because I have left the old database in place, it's an easy fallback scenario because database changes are the scariest of changes. But that backup is no longer being updated, so zotlit will have to be updated. This PR fixed it for another project, but I do not understand the composition of zotlit.

@JacobHamelMottiez
Copy link

JacobHamelMottiez commented Oct 29, 2023

I have the same problem as @benpla with citation key of newly added references in Zotero! Thanks @retorquere and @aidenlx for your great work, I am really enjoying both your plugins and I hope this issue will be resolved soon!

@retorquere
Copy link

I'll be glad to help when @PKM-er works on it, but I don't understand how this plugin hangs together.

@alephpiece
Copy link

I have to roll back to Better BibTeX 6.7.130 to make this plugin work.

@retorquere
Copy link

Which will be undone by Zotero in the next 48 hours. This is not a sustainable workaround.

@retorquere
Copy link

retorquere commented Oct 29, 2023

And if you roll back (with all the risk that entails - no support, and when you upgrade back to the regular release, any new citekeys and auto exports you make will be lost during the upgrade), please roll back to 124, not 130.

@luyanze
Copy link

luyanze commented Oct 29, 2023

I use Better BibTeX 6.7.133 and Obsidian Note for Zotero: 1.0.1, and meet the same problems. Roll back is a useful way to temporary solve these problem.

@alephpiece
Copy link

Which will be undone by Zotero in the next 48 hours. This is not a sustainable workaround.

I just turned off automatic updates for Better BibTeX. Hope it works.

@retorquere
Copy link

Still recommend 124 over 130

@retorquere
Copy link

Just as a reminder then: when you go back to the regular release of BBT, some keys might be regenerated, and some auto exports may be lost.

Also please do install the latest BBT release before opening new issues.

@mariomui
Copy link

mariomui commented Oct 29, 2023

I tried to prepare a PR but I don't understand the source code of this plugin.

Part of this plugin uses ophidian core which connects this.current to the SettingsPluginClass.

export const getDefaultSettingsDatabase = (): SettingsDatabase => ({

So here's where the zoterodatadir is being set, and once it is set, that data is being automatically cloned by ophidian core into this.current

P.S. https://github.com/ophidian-lib/core/blob/c5c701558192b9c64a628dce69779ca4e8d98c41/src/plugin-settings.ts#L71
here's the code where ophidian core clones the SettingsTab data into this.current

@retorquere
Copy link

That's fine, but I'm not diving into the details of obsidian plugin building, so I'm not going to prepare a PR. If someone who knows how this plugin is put together is willing to make the PR, I can say exactly what must be changed in the database access.

@mariomui
Copy link

mariomui commented Oct 29, 2023

That's fine, but I'm not diving into the details of obsidian plugin building, so I'm not going to prepare a PR. If someone who knows how this plugin is put together is willing to make the PR, I can say exactly what must be changed in the database access.

i would do it but i just effed up my zotero database across google drive across all my computers. i'm in a process of recovering my data and am loathe to burn my eyes out on the black sun of self inflicted pain again. (be happy to hear how you folks test zotero integration tho')

https://github.com/PKM-er/obsidian-zotlit/blob/dcd41794fd96f92c1866e870821aeb128507b339/app/obsidian/src/settings/base.ts#L58C35-L58C35

i mean is it as simple as just changing this?

@retorquere
Copy link

I only see stuff there about paths. I don't see where the connection is made, or where the database is queried.

But if you're willing to make the PR, the change is that instead of connecting directly to better-bibtex.sqlite, you must connect to any other database (:memory: would work) and then attach the bbt database using

ATTACH ? AS betterbibtex

where the parameter is the full path to better-bibtex.slqite. After this you can query betterbibtex.citekey.

@retorquere
Copy link

Oh I see you're fighting with your data right now. That takes precedence of course. Did you sync with the zotero servers? That's easier to restore from.

@retorquere
Copy link

retorquere commented Oct 29, 2023

I test zotero integration with selenium to set up a prepared profile specifically for the test run, then I drive zotero using a separate plugin called the debug bridge. Does that answer your question? This profile is separate from my "working" profile, my tests don't touch that.

@aidenlx aidenlx pinned this issue Oct 30, 2023
@aidenlx
Copy link
Member

aidenlx commented Oct 30, 2023

should be fixed in v1.1.3

@anandkumar89
Copy link

anandkumar89 commented Dec 12, 2023

Screenshot 2023-12-12 at 10 30 46 AM

Logs in console

Screenshot 2023-12-12 at 10 35 05 AM Screenshot 2023-12-12 at 10 35 24 AM

Still facing this issue.

@anandkumar89
Copy link

Solution : Updating zotero to V7 and betterbibtex plugin also resolved the issue.

@yuhanyao
Copy link

restart obsidian can also solve the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants