jannessm / joplin-zotero-link

8 stars 5 forks source link

"Zotero not found" / "Cannot read properties of undefined (reading 'map')" #19

Closed AJSchiller closed 1 week ago

AJSchiller commented 1 month ago

Since upgrading to Zotero 7, I keep getting a "Zotero not found" error:

Zotero not found

This is happening across multiple releases of Zotero Link.

Debugging console shows the following errors (I'm not sure which are relevant and didn't want to spam, so please let me know if I should add the full traceback for any or all of them):

Uncaught TypeError: Cannot read properties of undefined (reading 'map')

GET http://localhost:23119/api/users/0/items?itemType=-attachment&q= 500 (Internal Server Error)

PluginRunner: Could not send IPC message: pluginMessage :  {callbackId: 'cb_nz.magnusso.zotero-link_1730485618224_200', target: 'plugin', pluginId: 'nz.magnusso.zotero-link', eventId: '___plugin_event_1_2', args: Array(1)} Error: An object could not be cloned.

Uncaught (in promise) Error: An object could not be cloned.

POST http://localhost:23119/zotserver/search 404 (Not Found)

Current setup: Joplin 3.1.20 (prod, linux)

Sync Version: 3 Profile Version: 47 Keychain Supported: No

Revision: 8199362

Backup: 1.4.2 Enhancement: 1.2.1 Inline tags: 1.3.0 Link Graph UI: 1.5.0 Note Tabs: 1.4.0 Quick Links: 1.3.2 Zotero Link: 2.0.1

Zotero 7.0.9 (64-bit)

jannessm commented 1 month ago

Hey, which zotero version do you use? Is Zotero running when this error occurs? And have you checked which address zotero is listening to?

AJSchiller commented 1 month ago

The last number (7.0.9) is the Zotero version, I edited the post to clarify, sorry. Yes, Zotero is running and listening to http://localhost:23119/api

jannessm commented 3 weeks ago

could you please run this in your terminal?

curl "http://localhost:23119/api/users/0/items?itemType=-attachment&q="

I would guess that entries in your library are broken and therefore zotero can not return the results of your query.

AJSchiller commented 3 weeks ago

Nothing happens. Is that expected?

jannessm commented 3 weeks ago

No. All items in your library should be returned.

Please try to get some error messages out of Zotero, so that you can see what causes your issue.

AJSchiller commented 1 week ago

It seems this is the same issue as here - I had links to local PDF files on a different computer, which obviously don't work from my current machine.

If anyone else encounters this error, follow either of two methods described here to get a debug output file from Zotero and check for errors along the lines of DOMException: Could not parse path. These will detail the broken links. Once these attachments are removed or repaired, the plugin should run correctly again.

@jannessm , sorry for the duplicate. Out of curiosity, why would a broken attachment link interfere with this plugin? I didn't think it needed to access attachments to work 🤔

jannessm commented 1 week ago

Actually, it is an error in the Zotero api. The API returns the Status 500 which means that there was an internal error on the side of Zotero.