op cli: intermittent "(ERROR) unexpected end of JSON input"

I wish I could provide more detail but all I know is that sometimes, when using op about 1 in 5 requests errors out with "(ERROR) unexpected end of JSON input"

Are there any undocumented commands I can use to receive more information?


1Password Version: 0.5.3
Extension Version: Not Provided
OS Version: OS X 10.13.6
Sync Type: Not Provided
Referrer: forum-search:op json input

Comments

  • cohixcohix

    Team Member

    @ejetherington That's not an error I've ever seen before. Could you tell me which command you've been seeing this with, or is it entirely random?

  • Thanks for your reply.
    I've seen it from op list documents and op get item.
    We primarily use op through a wrapper python script, but those are the commands getting executed by the wrapper.

  • cohixcohix

    Team Member

    @ejetherington Alright thank you. I haven't been able to reproduce this myself, but I will dig a little deeper today to see if there's anything strange going on.

  • Yeah, intermittent failures are really tough to track down. Thanks for having a look!

  • rickfillionrickfillion Junior Member

    Team Member

    I wonder if maybe one of your items somehow got invalid JSON put into it. Next time you experience this, could you maybe try to figure out which item it was dealing with? Then see if you can reproduce it reliably by manually invoking op get item on that item (or document if that's the case)?

    If we could narrow it down to a specific item we could then look at different ways of figuring out what went wrong.

    Rick

  • I've been experiencing this as well.
    With sometimes when I'm running op get item, on different items. If I retry it works perfectly.
    Is there a way to get more logs from op or something?
    Thanks

  • cohixcohix

    Team Member

    @barnash Unfortunately there's no extra logging we can enable. When the failure occurs, does it take significantly longer than normal?

  • I have no idea, since I'm running the command line automatically, I'll try to add logs and check

  • @cohix Lets say that it does take longer, what do you suggest in that scenario?

  • @cohix I just encountered the error again, it didn't take longer than usual, just got it right after running the command

  • cohixcohix

    Team Member

    @barnash That dispels my theory of a network timeout :) If you wouldn't mind adding logging to your script to determine which item (in the case of op get item) or vault (in the case of op list items) is causing the error, we can try to track this down more quickly.

  • @cohix sure, I can do that. it's op get item for sure, I happens every time to a different item. I added some more logs so next time it happens I'll know more.
    I'll let you know here once it happens again. Thanks!

  • cohixcohix

    Team Member

    @barnash thank you!

  • barnashbarnash
    edited December 9

    @cohix I have some new data.
    It happened again.
    I looked at my logs since 30 days ago, it only happened when I query few items in parallel. I'm not saying it has to be the parallel issue, but it might be a lead for something..
    Might be some kind of a race condition in the op code. Not sure that you meant for it to be able to run in parallel...

    Good news are that most of my calls in parallel do work, just around 1/500 calls I get this error :)

  • cohixcohix

    Team Member

    @barnash Interesting. That does give me an idea, I'll look into it and post back here if I discover anything.

  • @cohix let me know if you want me to try something/send me a version with more logs, whatever may help

  • brentybrenty

    Team Member

    Thank you! We'll be in touch if need need more details. :)

  • cohixcohix

    Team Member

    @barnash could you please send me a direct message on this forum (or email connor [at] agilebits.com) using the email address associated with your account, letting me know (as close as you can) the date/time that one or more of these errors occured? My theory (repeated Request IDs) is looking more likely, and I'd like to look at our server logs to confirm.

  • @cohix Done. Emailed you.

  • cohixcohix

    Team Member

    Thanks!

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file