Zotero API key incorrect, please help to fix

Hi,

I’m new to Collabora, trying to set up things as part of a Nextcloud installation. I’ve created a private Zotero API key and entered it into the respective field (as per How to Manage Bibliographic Data With Zotero and Collabora Online - Collabora Office and Collabora Online), but it’s always reported to be invalid (“Zotero API key incorrect” upon opening a document in Collabora).

I’ve checked that the key exists and is working by accessing https://api.zotero.org/keys/MYKEY, and that curl -H "Zotero-API-Key: MYKEY" https://api.zotero.org/users/MYID/items returns my items as expected.

So, how can I figure out what’s wrong? I don’t have much experience debugging NC + Collabora so any help is appreciated.

Welcome to the forum @xkoeLRBcsFZtCSxE . :slight_smile:

Could you give us your exact:

  • Help > About info?
  • + Which version of Nextcloud are you running?

And you added the Zotero API key like that article said? Under Nextcloud’s:

  • Administration Settings > Office
  • “Enter Zotero API Key”

(Maybe double-check and make sure there wasn’t an extra character at the beginning/end, like an accidental extra space or quote or something.)

In addition, if your Nextcloud and CODE is on HTTP, then accessing Zotero via HTTPS possibly won’t work.

1 Like

Sorry for the long delay. I kind of gave up on this a year ago, but I’d like to solve it again. Basically, I have Nextcloud on my own domain, I’m accessing it with HTTPS. Collabora works fine in other aspects as much as I can tell, but I always get the incorrect key error for Zotero. No, it’s not mistyped. And I tried several different keys.

My current system:
Nextcloud 29.0.0 on https://nextcloud.mydomainname.org
Collabora Online Development Edition 24.04.3.1 594b605 on https://nextcloud.mydomainname.org/collabora

Are there any requirements as to what permissions the key should hold?

How do debug this further to know what’s wrong beyond the not-so-helpful error message I’m getting now?

COOLWSD version: 24.04.3.1 (git hash: 594b605(E))
LOKit version: Collabora Office 24.04.3.1 (git hash: 31b6e2c)
Served by: Debian GNU/Linux 12 (bookworm)
Server ID: d9f2ca4f

I’m aware that these are not the very latest versions, but this problem has persisted for a long time for me, I don’t think it’s going to be solved by an update.

1 Like

Welcome back + thanks for the latest info @xkoeLRBcsFZtCSxE . :slight_smile:

Hmm, well, there was a Zotero bug closed just 2 weeks ago. So maybe try latest 24.04.4?

Looks like there is also an open:

back in April 2023, but no response/retesting from that user since.


Hmmm… Well, there is the super secret “Triple-Click menu” in the About > Help dialog. After you enable it, you should be able to F12 and see your browser’s Console debugger:

Maybe when the Zotero API error pops up, it might spit out a more detailed error in console?

Well, embarrassing for me, but perhaps good news for you is that there was nothing wrong with Collabora after all. It was my browser blocking access to the Zotero API. I enabled the debug menu as instructed (maybe unnnecessary?), opened the Developer console, and there saw a line saying it couldn’t access the key. Changed the settings, now it’s working. I needed the help because it wouldn’t occur to me that it wasn’t a Collabora issue but a browser issue, so I thank you for the kind help. Cheers!

1 Like

Fantastic, @xkoeLRBcsFZtCSxE. Glad you were able to find a solution. :slight_smile:

  • Which browser were you using?
  • + Do you remember which exact browser setting it was?

That might help someone in the future who might come across your same issue!

@Tex , I’m happy to leave more info to help others. It was one of the plugins I’m using, in particular my umatrix settings, but it could’ve been any plugin that filters traffic. I was using Edge but it could’ve happened with any browser with plugins that filter 3rd-party traffic. The problem was that I had an incorrect mental picture of how Collabora would communicate with the Zotero API - I assumed it was a server-side thing, so I wasn’t careful with the settings in my browser.

1 Like

Thanks!

Yes, I know that game too. I have my main browser typically locked way down (no Javascript with NoScript + heavy adblocking).


One of the first debugging tricks I like to do whenever ever something goes weird is:

  • Try it in a completely different / fresh browser.

For example, I use Firefox as my main, so I’d test it in:

  • Edge / Chrome

where I don’t have any fancy extensions/settings. :slight_smile:


Side Note: What are you still using uMatrix for?

Do you have uBlockOrigin installed?

Did you know that it can do almost all of uMatrix’s old functionality using uBlockOrigin’s “Dynamic Filtering” / “Advanced Mode”?

For some more info, see:

A few years back, I read through all uBO’s Wiki / documentation. I had NO IDEA that lots of that advanced functionality was even buried in there!

So I finally jumped closer towards “Medium Mode”. So happy that I did!

@Tex , yes, the fresh/plugin-free browser is the right way, but one needs to think of that first. This time, I didn’t.

uMatrix has way more granular control over which types of elements you want to allow, and it also gives you a nice matrix of what types of elements were accessed from what source that I like to look at sometimes. It’s true that this functionality may not be necessary all the time, and yes I spend much less time on fiddling with such things these days, but uBlocker Origin is definitely a step down from what uMatrix offers. I also like to keep my matrix and blocker rules separate - I use ublocker for the filter lists and blocking specific elements on sites; umatrix for the access rules. I’m not entirely certain, but I think uBlocker may be able to handle uMatrix rules as is (i.e. same syntax), so maybe it can do all that uMatrix does(??), but it cannot edit those rules within the UI.

From the first comment in the second discussion you linked:

“[…] I found out about the archiving of the repo, so I started looking for an alternative and there it was, UBO was the answer (or at least a very good alternative). I hope they can bring more granularity on what you allow/block just like uMatrix, but UBO is truly a beast like you said.”

(emphasis added by me)

1 Like

Both are made by the same great person (gorhill), and he discontinued uMatrix because uBlockOrigin’s “Expert Mode” already covered almost all the old uMatrix functionality!

I definitely know I’ve read his posts about it over the years(, but couldn’t re-find his specific discussions to link you to).

I think once you enable the uBO’s “Hard Mode”, you can get a more complicated grid UI + access to many of those bells and whistles.

Or, you can always go into the text version of “My Rules” and put in specific lines. Like:

Since I was never a uMatrix user, I didn’t pay too close attention whenever it got brought up.

But if the dev himself said uMatrix was completely superseded (okay, 99% superseded) years ago, I’d trust him. :slight_smile:


Complete Side Note: One of my favorite Filters ever is making all embedded Youtube videos click-to-play.

If you put that into uBO’s “My Filters” settings page:

||youtube.com^$3p,frame,redirect=click2load.html
||youtube-nocookie.com^$3p,frame,redirect=click2load.html

instead of seeing a Youtube thumbnail + player, I:

  • see a blank white box with the URL in it (which I can copy/paste).
  • can click on the box to load the video.

I learned that trick back in 2021 and have been using it ever since:

I even expanded the same trick to support Vimeo, Scribd, and Soundcloud embeds too:

||player.vimeo.com/video^$3p,frame,redirect=click2load.html
||scribd.com^$3p,frame,redirect=click2load.html
||soundcloud.com^$3p,frame,redirect=click2load.html

Now NOTHING loads without my express approval! :stuck_out_tongue:

And if I think it sounds interesting, all it takes is a little click and the video/file loads like normal!