Got Error 502 using R.NET on 64 bit azure

63 Views Asked by At

I want to integrate c# with R (V4.1.0) using r.net (v1.9.0.0) and I have 2 Azure Web Apps, one with 32 bit setting on Platform and the other one using 64 Bit.

When I want to get instance with this code:

REngine engine = REngine.GetInstance

It works just fine on 32 bit, while on 64 Bit Web App I always got

Error 502 - Web server received an invalid response while acting as a gateway or proxy server

Any idea on what could be the cause of these symptoms?

1

There are 1 best solutions below

0
lrasmus On

This post from Microsoft says a 502 can be caused by a few different things, including "application crashing due to an exception" - https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-http-502-http-503

I see you are using R 4.1.0. There is a known issue with R 4.0.3 and higher in R.NET being investigated and tracked - https://github.com/rdotnet/rdotnet/issues/139#issuecomment-898699993. It has to do with Windows 10 x64 and Control Flow Guard. There are some workarounds provided for desktop users - including disabling CFG - but I'm not sure that would apply to an Azure Web Apps deployment.

If this is crashing because of this issue, your main option for now may be to downgrade to R 4.0.2. Is that an option for you?