Unable to use Google Cloud Load Balancing for Discourse


(Vinoth Kannan) #1

I know currently Discourse team only recommending DigitalOcean officially. I just want to confirm few things with following issue.

I am able to install Discourse flawlessly in Google Compute Engine. Also am able to configure it with Google Cloud Load Balancing. But after that whenever I try to delete my topic or post or draft GCLR refusing to serve json DELETE method with body content. For more details you can see the issue below.

https://code.google.com/p/google-compute-engine/issues/detail?id=381

And their official reply to this issue is

The load balancer does not allow a DELETE request with a body. A payload within a DELETE request message has no defined semantics; sending a payload body on a DELETE request might cause some existing implementations to reject the request. These kind of requests (with a payload) are rejected at the Google frontend service.

They are not ready to fix this problem and they labelled this issue as WontFix. Now my question is why they are not supporting it? Is there any security problems behind it. Is it best practice to use like this.


(Vinoth Kannan) #2

I think this stackoverflow answer may help you


(Matt Palmer) #3

I’d say you’ll need to use a load balancing service which doesn’t impose invalid requirements on the traffic it’s load balancing.


(Sam Saffron) #4

I agree with @mpalmer that this should be fixed by Google.

But… perhaps you can amend jQuery in a pre-filter or something to append params as opposed to using a body.

Eg:

      ajax("/admin/users/delete-others-with-same-ip.json", {
        type: "DELETE",
        data: {
          "ip": "127.0.0.1"
          "exclude": 11
        }
      })

could easily become:

DELETE 
/admin/users/delete-others-with-same-ip.json?ip=127.0.0.1&exclude=11

(Sam Saffron) #5

The more I read into this the more I find that it is considered “un-REST-y” to do what we are doing in the few places we are sending a body with the DELETE.

I am not against adding the required routes and eliminating the body if you wanted to look into it.


(Matt Palmer) #6

Oh yeah, it’s awfully un-REST-y to be sending a body in a DELETE, and my initial reaction was “that can’t be legit!”, but it’s allowed by the standards, so it’s completely inappropriate for GCLB to be rejecting it.


#7

Thanks for posting this issue, I wasn’t aware of it. Just tried it on my GCE instance and can reproduce it.