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

ejetherington
ejetherington
Community Member

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

  • cohix
    cohix
    1Password Alumni

    @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?

  • ejetherington
    ejetherington
    Community Member

    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.

  • cohix
    cohix
    1Password Alumni

    @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.

  • ejetherington
    ejetherington
    Community Member

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

  • 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

  • barnash
    barnash
    Community Member

    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

  • cohix
    cohix
    1Password Alumni

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

  • barnash
    barnash
    Community Member

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

  • barnash
    barnash
    Community Member

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

  • barnash
    barnash
    Community Member

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

  • cohix
    cohix
    1Password Alumni

    @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.

  • barnash
    barnash
    Community Member

    @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!

  • cohix
    cohix
    1Password Alumni

    @barnash thank you!

  • barnash
    barnash
    Community Member
    edited December 2018

    @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 :)

  • cohix
    cohix
    1Password Alumni

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

  • barnash
    barnash
    Community Member

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

  • AGAlumB
    AGAlumB
    1Password Alumni

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

  • cohix
    cohix
    1Password Alumni

    @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.

  • barnash
    barnash
    Community Member

    @cohix Done. Emailed you.

  • cohix
    cohix
    1Password Alumni

    Thanks!

This discussion has been closed.