Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Do not lose tweets on TLS issues #9

Closed

Description

@IBBoard

Sometimes (possibly just on one network) I get TLS connection errors. Normally this happens when RTing, but occasionally it happens when tweeting. Normally, Corebird/Cawbird keeps the last tweet, but in one specific situation that I think is related to the TLS errors then it forgets it. My assumption is that it doesn't handle the error correctly and treats it as posted.

Activity

  1. added
    bugSomething isn't working
    info requiredThis doesn't seem right or more details are required
    and removed
    info requiredThis doesn't seem right or more details are required
    on Sep 1, 2019
  2. IBBoard commented on Sep 3, 2019

    @IBBoard
    OwnerAuthor

    Error is:

    Exception: Error performing TLS handshake: An unexpected TLS packet was received in TweetUtils.vala:91
    

    At least it's from Vala code and we get a line number!

  3. IBBoard commented on Sep 3, 2019

    @IBBoard
    OwnerAuthor

    This may be handled correctly on sending tweets. start_send_tweet in ComposeTweetWindow.vala only wipes the last message when the async finishes and the tweet succeeds (src).

    But save_last_tweet only saves the text when we're not replying to something. So maybe we lose replies.

  4. added 4 commits that reference this issue on Sep 7, 2019
  5. IBBoard commented on Sep 10, 2019

    @IBBoard
    OwnerAuthor

    From initial testing then the patches are working. I've had an RT that failed that then reset back to the "not RTed" status so that I could RT properly. Previously the UI would say RTed, but the dialog says it failed, then you'd un-RT and it'd complain that the tweet didn't exist, and then you'd RT.

    The only problem is that I've had to add a "Save tweet?" dialog to give users a way out when they quote a tweet, it fails for transient reasons (like the TLS issue), and then by the time they go to post it again then it fails to load the tweet and so they want to clear the draft tweet.

    One thing I need to think about is attached media. I'm not sure how well we can handle keeping draft attached images.

  6. IBBoard commented on Sep 13, 2019

    @IBBoard
    OwnerAuthor

    Today was a REALLY bad day for these errors. Happened repeatedly. Not a clue what's happening with Twitter/the network. I briefly tried Wireshark but it wasn't hugely helpful.

    However, I did find that I've got more work to do:

    • Fix the double notification (I'm considering rearchitecting how that works)
    • Don't inject the DM until we know it sent
    • Reset the "Send" status and stop the spinner when tweeting fails

    Also, I still need to look at attached media.

  7. added 4 commits that reference this issue on Sep 14, 2019
  8. 19 remaining items

  9. IBBoard commented on Oct 5, 2019

    @IBBoard
    OwnerAuthor

    Okay, I think this is about done now. I've still got to look in to the GnuTLS side, but most things should now be handled correctly, fail and retry, or fail silently for some remaining less important things.

    I've merged to Master and will release soon, so give me a shout if there's anything else that people find.

  10. IBBoard commented on Oct 7, 2019

    @IBBoard
    OwnerAuthor

    It looks like there's a simple fix upstream in GnuTLS that appears to work for me.

    It's currently scheduled for v3.6.11 in December.

    In the mean-time, I'll consider this as fixed as it's going to be, unless someone tells me otherwise.

  11. schmittlauch commented on Oct 31, 2019

    @schmittlauch
    Contributor

    @IBBoard Have you really checked compiling cawbird with GnuTLS from master?
    I tried backporting the patches from this commit and compiled cawbird with a glib-networking that uses this patched GnuTLS in NixOS, but I still get TLS errors.

    I want to test building cawbird agains the latest GnuTLS master but currently fail at building the latter.

  12. IBBoard commented on Nov 1, 2019

    @IBBoard
    OwnerAuthor

    I've been running with a custom build of GnuTLS for a few days that basically just adds MR 1087 to the 3.6.10 code and I've not seen a single TLS error.

    I don't believe it's glib-networking that needs recompiling with the updated GnuTLS. I think it's libsoup. I've rebuilt GnuTLS but not glib-networking.

  13. schmittlauch commented on Nov 1, 2019

    @schmittlauch
    Contributor

    I don't believe it's glib-networking that needs recompiling with the updated GnuTLS. I think it's libsoup.

    That is pretty interesting, as libsoup does not even take gnutls as a dependency in NixOS but just depends on glib-networking.
    And that does take gnutls as a dependency.

  14. IBBoard commented on Nov 2, 2019

    @IBBoard
    OwnerAuthor

    Huh, maybe you're right. Maybe I was reading old docs where libsoup used GnuTLS directly. I just rebuilt them both and it worked, but looking at build specs and ldd output then libsoup doesn't reference gnutls but does reference GIO's g_tls_â€Ķ functions and glib-networking provides /usr/lib64/gio/modules/libgiognutls.so, which loads libgnutls.so.30. I might not need to rebuild libsoup.

  15. schmittlauch commented on Jan 7, 2020

    @schmittlauch
    Contributor

    Good news, having built Cawbird against NixOS-unstable with the latest GnuTLS release, I haven't encountered any TLS issues for several hours so far \0/

    Good job.

  16. IBBoard commented on Jan 8, 2020

    @IBBoard
    OwnerAuthor

    I just debugged it. The GnuTLS people knew the protocols enough to understand what to do to fix it!

  17. philipzae commented on Apr 18, 2020

    @philipzae

    I'm running Ubuntu 20.04 with GnuTLS 3.6.13 and still getting the error.

  18. philipzae commented on Apr 18, 2020

    @philipzae

    Well i'm running the snap which has a 18.04 base, so maybe that's the issue then.

  19. j1warren commented on Apr 18, 2020

    @j1warren

    I've never stopped having this error the first time I try to open any tweet in the timeline.
    Pressing back and trying again then works on any tweet.
    18.04, 1.0.5 now.

  20. IBBoard commented on Apr 18, 2020

    @IBBoard
    OwnerAuthor

    As far as I can tell, it looks like Ubuntu 18.04 is still using an old version of GnuTLS (possibly 3.5.18).

    From what I understand of Snap, I think it bundles its own version of many libraries and I assume it is also outdated if you're seeing the errors.

    There's nothing we can do. The changes in this ticket put in the best work-arounds we can without causing different issues. The only real solution is for distros and "application distribution systems" that insist on bundling their own copies of libraries to update their libraries to fix the real bug.

  21. philipzae commented on Apr 18, 2020

    @philipzae

    I've filed a bug with the snap dev of cawbird as this is fixable in snaps.

  22. philipzae commented on Apr 19, 2020

    @philipzae

    Patch to fix it in 18.04 and 19.10 was submitted by the snap maintainer.
    https://bugs.launchpad.net/ubuntu/+source/gnutls28/+bug/1873565

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestexternalProblems caused by dependencies and other systems

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions