Skip to content

couch_replicator_auth_session : Could not parse cookie from response headers cookie_format_invalid #1851

@skeyby

Description

@skeyby

In our environment CouchDB is sitting behind an Apache HTTPD with mod_proxy_balancer.

Whenever I start a replication toward the HTTPD proxied url I start getting these errors in couch log:

[error] 2019-01-10T15:35:50.396182Z couchdb@10.99.1.1 <0.6123.0> -------- couch_replicator_auth_session : Could not parse cookie from response headers cookie_format_invalid
[error] 2019-01-10T15:35:53.871404Z couchdb@10.99.1.1 <0.14219.1> -------- couch_replicator_auth_session : Could not parse cookie from response headers cookie_format_invalid
[error] 2019-01-10T15:35:53.872080Z couchdb@10.99.1.1 <0.14232.1> -------- couch_replicator_auth_session : Could not parse cookie from response headers cookie_format_invalid
[error] 2019-01-10T15:35:53.889202Z couchdb@10.99.1.1 <0.14219.1> -------- couch_replicator_auth_session : Could not parse cookie from response headers cookie_format_invalid
[error] 2019-01-10T15:35:53.904773Z couchdb@10.99.1.1 <0.14232.1> -------- couch_replicator_auth_session : Could not parse cookie from response headers cookie_format_invalid

If I start the same exact replication pointing directly to couch the error disappears.

The replication seems to work ok except for the fact that it seems to be somewhat slower in the initial kickoff.

HTTPD is injecting a cookie (called BALANCERID) in the answer to handle sticky session so I suppose the error is about that, yet the cookie itself doesn't seems malformed.

Is there something wrong going on or is the log just too verbose?

This is a comparison between direct and proxied url:

abrancatelli@MacBook-Air-di-Andrea ~> curl -v http://10.33.102.50:5984
* Rebuilt URL to: http://10.33.102.50:5984/
*   Trying 10.33.102.50...
* TCP_NODELAY set
* Connected to 10.33.102.50 (10.33.102.50) port 5984 (#0)
> GET / HTTP/1.1
> Host: 10.33.102.50:5984
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: must-revalidate
< Content-Length: 183
< Content-Type: application/json
< Date: Thu, 10 Jan 2019 15:49:57 GMT
< Server: CouchDB/2.3.0 (Erlang OTP/21)
< X-Couch-Request-ID: 308c9970a8
< X-CouchDB-Body-Time: 0
<
{"couchdb":"Welcome","version":"2.3.0","git_sha":"07ea0c7","uuid":"0a959b9b8227188afc2ac26ccdf345a6","features":["pluggable-storage-engines","scheduler"],"vendor":{"name":"FreeBSD"}}
* Connection #0 to host 10.33.102.50 left intact
abrancatelli@MacBook-Air-di-Andrea ~> curl -v https://XXXXXX.schema31.it
* Rebuilt URL to: https://XXXXXX.schema31.it/
*   Trying 2.228.74.190...
* TCP_NODELAY set
* Connected to XXXXXX.schema31.it (2.228.74.190) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN= XXXXXX.schema31.it
*  start date: Jan 10 13:00:14 2019 GMT
*  expire date: Apr 10 13:00:14 2019 GMT
*  subjectAltName: host "XXXXXX.schema31.it" matched cert's "XXXXXX.schema31.it"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
> GET / HTTP/1.1
> Host: XXXXXX.schema31.it
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 10 Jan 2019 15:50:22 GMT
< Server: CouchDB/2.3.0 (Erlang OTP/21)
< Cache-Control: must-revalidate
< Content-Length: 183
< Content-Type: application/json
< X-Couch-Request-ID: 70b4e6a60a
< X-CouchDB-Body-Time: 0
< X-GCloud-FE-Profile: D=60387
< X-GCloud-FE-Identity: cianuro
< X-GCloud-BE-Route: saferm01
< Set-Cookie: BALANCERID=.saferm01; path=/
<
{"couchdb":"Welcome","version":"2.3.0","git_sha":"07ea0c7","uuid":"0a959b9b8227188afc2ac26ccdf345a6","features":["pluggable-storage-engines","scheduler"],"vendor":{"name":"FreeBSD"}}
* Connection #0 to host XXXXXX.schema31.it left intact

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions