Bad gateway. Help needed


I’m getting a bad gateway error that I can’t solve. On the Opal R log I can see that my function is running, however when the return line is interpreted, a 502 error occurs.

A reproducible example:


builder <- newDSLoginBuilder()
builder$append(server = "study1", url = "", 
               user = "dsuser", password = "password", 
               resource = "RSRC.tcga_liver")

logindata <- builder$build()

conns <- datashield.login(logins = logindata, assign = TRUE, 
                          symbol = "res")

datashield.assign.expr(conns = conns, symbol = "rse", expr = quote(as.resource.object(res)))

ans.gender <- ds.limma(model =  ~ gdc_cases.demographic.gender, 
                       Set = "rse", = "RNAseq", 
                       sva = FALSE)
deseq_ds = ds.DESeq2(model = ~ gdc_cases.demographic.gender, set = "rse")

On this example (when I run it) the ds.limma returns a table while the ds.DESeq2 returns a 502 error. Both functions are called using the same structure, so I can’t understand why one works and the other does not. The code for them can be found at

Thanks for your time,


Hi Xavier, in my experience this type of error happens when the server is overloaded. In my local machine using DESeq2 is a lot more intensive than limma. Limma runs OK, but the equivalent DESeq2 command on the same data causes a crash. The error is different though - I get a connection refused message

Those are unfortunate news, thanks for the response.

Hi Xavier,

It is time for you to get your own development server :slight_smile: opal-demo is not meant for heavy loads.


Yes, definitely I will have to look into getting a development server. Do you think it’s possible to develop some sort of check / error formatting that catches this types of crashes? I got really frustrated not understanding the source of my error.

The problem is that R eats all the memory and opal has no room to react/reply. One option is to have distinct servers, one for opal, another one for R.


By the way, if the your DS aggregation task takes a long time to run, have a try to the dev version of DSI:


it might help.