简体   繁体   中英

ERROR: [_parse_http_data] invalid HTTP method in shiny app

When I load my docker shiny app domain name in the browser, it crashes (greys out) and I get this "ERROR: [_parse_http_data] invalid HTTP method".

I have developed an web application that consists of a shiny app (has a login feature connected to an RMySQL database), a website and a mariadb database. I put them together in a docker-compose file and tested it on my local computer and it works fine. I then proceeded to deploy them in a Kubernetes cluster in GCE and that was also successful. I used cloudflare to install a ssl certificate for the shiny app domain (ie trnddaapp.com). Now when I load the shiny app domain in the browser it appends the https and loads the app successfully but after about a minute it crashes (greys out). I loaded the shiny app external ip with http and this doesn't crash.

The closest solution I have come to is https://github.com/rstudio/shiny-server/issues/392 but there doesn't seem to be any other solution to my problem. I would be grateful if anyone help me resolve this problem.

This is the error message I get when I check with kubectl log [app pod name], I get this error:

 ERROR: [_parse_http_data] invalid HTTP method
 ERROR: [_parse_http_data] invalid HTTP method
 ERROR: [_parse_http_data] invalid HTTP method

I expect the app not to crash when the shiny app domain (trnddaapp.com) is appended with the https.

Let's start with the analysis of the error message, it says:

[_parse_http_data]

So we know that your app is receiving something, but it doesn't understand what it is (it may be a malformed HTTP/1.0 or HTTP/1.1 or even binary data) then we have an

invalid HTTP method

Now we are sure it is not a HTTP/1.X call but a stream of (non recognized) data. We now know is not the instance since it "deploys" and "delivers" the service, but something inside that is just breaking.

There are a few things that may be happening, since it runs in your local machine (where I am assuming it has access to more resources, especially memory) it may be an issue of resource allocation and that once ran in a container, it could be possible that it empties its allocated amount of resources and breaks (perhaps a library that is called in real time that uses a chunk of memory?) but we won't be sure unless we can debug it inside a container, so could it be possible for you to add a debug library that records your requests to see if it parses all of those and at some point in time it stops and why? I know a person from R-Studio created a httpuv that logs every request this can be done as in:

devtools::install_github('rstudio/httpuv@wch-print-req')

And after that, maybe share the output and see why the application is behaving like that and killing its own service.

I really thank you in advance, hopefully with those logs we may be able to shed more light into this matter.

Thanks once again!

-JP

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM