Comment 5 for bug 1916482

Revision history for this message
Erik (est-it) wrote :

I had the same problem as you and made some "research".
I think it's not a problem between glance and ceph, but between the uploading client and glance.

Do you have a reverse proxy in front of the uwsgi processes that are used by glance? I mean something like apache or haproxy?

For apache, there is a note in the glance-api-uwsgi.ini on my debian system with victoria backport. It says, glance is not compatible for running behind apache because of two options for http chunked upload. I would say, this comment literally applies to every http reverse proxy
I use HAProxy in front of glance-api to make it HA compatible and transparently switch glance instances etc.

I tried to upload a image direct to an uwsgi network socket, which works fine. With HAProxy as L7 reverse proxy, i got the same errors as you.

TL;DR: When using HAProxy use "mode tcp".

I made TCPDumps on both sides:

Client---HAProxy and HAProxy---Glance

The data stream (that is the image that we are trying to upload) is send to the proxy over http. The proxy sends that data to glance over it's own http connection.
My glance+ceph lab cannot write back the data stream as fast as new data is arriving over network (that's okay, because it's a lab). The consequence is, that our TCP window fills up, until it's full. The HAProxy have to wait with sending new data until the buffer from the glance server is freed. The uploading client must wait too, of course. And because we have two independent HTTP connections, this wait/send/wait... procedure ist somewhat asynchron.

This confuses our client: When the glance server accepts new data (sends an TCP ACK), our client didn't answer with new data but he sends TCP keepalives. TCP keepalives are not the segments, that our glance server wants in a chunked data-stream.
Finally the glance server sends a http error 500 (internal server error).
Our data stream wasn't complete, so we get the error message, you've posted above.

I tried some HAProxy options, the only way I got it working, was to set the frontend/backend to TCP mode ("mode tcp"). That don't proxies HTTP (L7), it redirects a complete TCP stream to a glance server. That works so far.