REFUSED_STREAM on AOSP 6 chinese (but not on AOSP 4 French)

  • Hello,

    I encounter a problem to register an account in Davdroid: I get REFUSED_STREAM when connecting. The funny thing is: This is not working on an Android 6 / MIUI phone (chinese), but on my old nexus 4 with AOSP (french), it’s working perfectly with same credentials.
    I’ve seen the same error concerning HTTP/2 in this forum, and I have tried deactivating HTTP/2 to test, but the problem still persists.

    • Logs here
    • Steps to reproduce:
      • Create an account (“+” button)
      • Choose “Custom URL”
      • Enter URL and credentials, uncheck “preventive authentication”
      • After some waiting, an error message appears (no caldav/cardav found)
    • Configurations:
      • Server: Raspberry Pi, Archlinux, Nginx 1.10.0 (HTTP/2 enabled but not mandatory), SabreDav
      • Failing device: XiaoMi 3 , Android 6.0.1, Chinese locale; Davdroid 1.0.8 installed via APK (furnished by F-Droid)
      • Working device: Nexus 4 , AOSP / Android 4.4.4, French locale; Davdroid 1.0.8 installed via F-Droid

    Have you maybe a clue to solve this?
    Thanks a lot (and thanks for DavDroid! 😁 )

  • developer

    Please follow up in nginx HTTP/2 incompatible with okhttp. You’ll have to disable HTTP/2 on your server completely, otherwise okhttp (and thus DAVdroid) will try to use it and fail.

  • developer

    I have reopened the thread for further discussion.

    REFUSED_STREAM is a HTTP/2 thing. “Streams” have been introduced with HTTP/2 and SPDY (I wonder why they didn’t use SCTP) and there is no such thing for HTTP/1.1. So, it should not be possible that a REFUSED_STREAM error is related to anything else than HTTP/2 (or SPDY).

    Did you try to completely disable mod_http2 and mod_spdy in the server (= unloading the modules / compiling it without those modules)?

    Why does it work with your other device: I don’t know. Maybe okhttp decides to not use HTTP/2 on this device for some reason, or there’s some other configuration detail which doesn’t let this error appear. Without verbose and exact debugging, I can’t tell you why.

  • Thanks a lot for completing your answer! ☺

    I’ve tried to disable HTTP/2 on my server like this:

    server {
    #    listen 443 ssl http2;
        listen 443 ssl;
        server_name dav.mydomain.tld;
        root /srv/http/sabredav/;

    …but after further investigations today, I oddly found that my server was still considered as HTTP/2 enabled for dav.mydomain.tld… (test of domain with )

    I will try soon to disable http/2 everywhere in nginx, to see if it works, and follow the issue with okhttp.

Similar topics