Optical Society of America translator not working

"An error occurred saving with Optical Society of America. Attempting to save using Embedded Metadata instead."

I haven't seen it work on any articles at the moment. Here is an example of one (that is open access):
https://opg.optica.org/oe/fulltext.cfm?uri=oe-30-20-35467&id=502123
(note that the organization has renamed itself "Optica")

My version of Zotero is: 6.0.18
I can reproduce the issue in Microsoft Edge (v 107.0.1418.52), Chrome (v 107.0.5304.107), and Firefox (v 107.0).

I get the following error (reported in the Zotero connector extension):
[JavaScript Error: "TypeError: Cannot read properties of null (reading 'documentElement')
at scrape (eval at (chrome-extension://ekhagklcjbdpajgpjgmbionohlpdbjgc/inject/translate_inject.js:63:4), :106:18)
at async doWeb (eval at (chrome-extension://ekhagklcjbdpajgpjgmbionohlpdbjgc/inject/translate_inject.js:63:4), :88:3)" {file: "[object Object]"}]

And here the debug log (from Chrome):
The Debug ID is D456402627
  • Works for me (and the translator was updated in early October for the new site) --
    you've run through the other items on https://www.zotero.org/support/troubleshooting_translator_issues ?
  • That's where I started, and I thought I had gone through the items, but on closer examination I haven't:
    - double checked that cookies are enabled (#11)
    - uninstalled & reinstalled the connector extension (#12)

    Pretty sure I checked all the others.
  • I've examined settings in Chrome and Edge. Cookies are allowed, and I removed and re added the Zotero connector extension. No other extensions are enabled in Edge, but the problem still persists.

    Could it be a firewall problem? I noticed the following early in the debug log:
    (3)(+0000042): Translators: Looking for translators for http://192.168.100.1/pfblockerng/pfblockerng_alerts.php

    which would be my gateway.

    In the Report errors I notice:
    Error: Only 0 translators present in cache. Resetting

    Does this mean it can't find the translator to use, and then fails out to embedded metadata?
  • Yeah, although it gets some translators (Embedded Metadata is also one), but that would almost definitely be the issue. You'd have to find a way to whitelist that (it's a local port so I think it should typically be whitelisted anyway

  • Thanks for the quick response. On further troubleshooting, I'm not sure what the issue is. The various POST commands to http://127.0.0.1:23119 seem to be getting through.

    I further tested on a different computer, and no issues. It's on the same network as the other, so I'm inclined to discard the firewall hypothesis. The debug text between the two is very similar up to the point of failure, which is after a "Method getSelectedCollection succeeded" line (noted below).

    I'd think maybe a stale cache on the browser or something (other computer is a fresh install of Win 11, Firefox, & Zotero) - except it seems odd that it affects all 3 browsers on the computer. Any ideas on things to check on the computer itself?

    On a related note, it appears that both the Optical Society and Embedded metadata translators download multiple copies of the author names into the metadata (I had hoped that the Optical Society translator would not have this issue, but it appears that it does). Is this a bug (i.e. can you reproduce this, or is the problem again on my end).


    *Successful on other computer:*
    (3)(+0000013): Connector: Method getSelectedCollection succeeded

    (3)(+0000005): progressWindowIframe.changeHeadline message received in injected page moz-extension://e0b4a38e-41d9-4467-b43c-8aa82e66ba51/progressWindow/progressWindow.html

    (3)(+0000022): progressWindowIframe.resized message received in injected page https://opg.optica.org/oe/fulltext.cfm?uri=oe-30-21-39188&id=509758

    (3)(+0001469): Parsing cross-origin response for https://opg.optica.org/viewmedia.cfm?uri=oe-30-21-39188&seq=0

    (3)(+0000082): Translate: PDF embed page HTML:

    *Failed on original computer:*
    (3)(+0000004): Connector: Method getSelectedCollection succeeded

    (3)(+0000004): progressWindowIframe.changeHeadline message received in injected page chrome-extension://nmhdhpibnnopknkmonacoephklnflpho/progressWindow/progressWindow.html

    (3)(+0000007): progressWindowIframe.resized message received in injected page https://opg.optica.org/oe/fulltext.cfm?uri=oe-30-21-39188&id=509758

    (3)(+0000302): progressWindowIframe.mouseenter message received in injected page https://opg.optica.org/oe/fulltext.cfm?uri=oe-30-21-39188&id=509758

    (3)(+0000046): progressWindowIframe.mouseleave message received in injected page https://opg.optica.org/oe/fulltext.cfm?uri=oe-30-21-39188&id=509758

    (3)(+0000878): Translate: PDF embed page HTML:

    (2)(+0000001): Translate: Translation using Optical Society of America failed:
    TypeError: Cannot read properties of null (reading 'documentElement')

    TypeError: Cannot read properties of null (reading 'documentElement')
    at scrape (eval at (chrome-extension://nmhdhpibnnopknkmonacoephklnflpho/inject/translate_inject.js:63:4), :106:18)
    at async doWeb (eval at (chrome-extension://nmhdhpibnnopknkmonacoephklnflpho/inject/translate_inject.js:63:4), :88:3)
    url => https://opg.optica.org/oe/fulltext.cfm?uri=oe-30-21-39188&id=509758
    downloadAssociatedFiles => true
    automaticSnapshots => true
  • I can reproduce the author import bug CC @AbeJellinek who updated the translator

    Other sites seem to work normally on that computer? And you've tried resetting translators I take it? Can you try updating translators from the *Connector* preferences while having the debug (again in the connector) run and submitting that?
  • If by "other sites" you mean general web browsing, I have not noted any issues with browsing the web on this computer.

    I reset translators by going to Zotero preferences > Advanced, then pressing the "Update now" button. The problem persisted.

    I then went to the Edge extension options for the Zotero Connector, enabled debug output logging, then pressed "Update Translators".

    The debug output ID is: D573825794
  • No, I mean -- does Zotero import work elsewhere -- google scholar, your local library catalog, JSTOR, etc.? (We'll have a fix for the duplicate authors out shortly)
  • Google scholar worked, although it grabbed the html full text rather than the pdf (The Optical Society translator and embedded metadata translators both get the pdf rather than the html version of the full text).

    JSTOR also appears to work, though I don't have access to the pdfs, the metadata downloaded fine whether it was an individual article or via checkboxes in the folder dropdown.

    I tried another one (semi-randomly; I looked at the American Institute of Physics/AIP and picked an article from one of their open access journals). It too seemed to work just fine (using a translator called 'Atypon journals" I think).
    https://aip.scitation.org/doi/10.1063/5.0109265

    Guess I have a bit of Murphy's Law going on - the particular catalog I want doesn't work on the particular computer I'd like it to, and everything else seems to work :/
  • edited November 22, 2022
    OK, so I've finally been able to replicate this, and I think it's an Edge/Chrome issue -- could you try on Firefox again? (Short version, the code tries to get elements from a PDF page which exists in Firefox because the PDF reader is HTML based, but not in Edge/Chromium, which have PDF readers that are applications, and so it fails in unexpected ways. I think that should be fixable.

    (And I think I have a fix for this, might just take a little to get it up)
  • Huh, it does appear to work in Firefox on this computer now. Not sure what I did earlier when it didn't appear to work with Firefox.

    At any rate, it now works in Firefox on both computers I've tested on here (and doesn't in Edge or Chrome).

    On a side note, did the author fix for the translator got pushed through already? I didn't see duplicate authors on this latest Firefox test (just tested the one article though).
  • Yes, the multiple author fix went through yesterday. I have the fix for Optica/OSA under review
Sign In or Register to comment.