none
Change port 12800 to 80 on R Server for Linux RRS feed

  • Question

  • I created the following Azure instance:  "Microsoft R Server 2016 (version 9.0.1) for Linux (CentOS version 7.2)".   I then connected to it from R Studio and it worked fine.   I did this from my home.  I then went to work and tried connecting again, but it failed.  I'm 100% positive that my company's firewall does not allow traffic through port 12800.  So I launched the Administration Utility on the CentOS machine and I used option "4" to change the web node port from 12800 to 80.   I'm "pretty sure" that my company allows traffic through port 80.   I then tried connecting and I got an error that states "Failure when receiving data from the peer".   

    Is there something else I need to do to make this work?  I noticed that there are two other ports that I could have changed using the administration tool.  Do I need to change those as well?  Or is there something else I need to do?

    Here is how I connect from R Studio: 

    remoteLogin("myserver.blahblah.com:80", session = TRUE,username="admin", password="blah")

    Thanks,

    Carlos -

    Friday, February 17, 2017 3:23 PM

All replies

  • Hello Carlos,

    To help debug with all the moving parts,

    can you at least successfully run a simple curl request to the `/login` endpoint? You should get a successful HTTP 200 ok or a some other HTTP status if things are stood up correctly.

    curl -i -H "Content-Type:application/json" -X POST -d '{ "username": "YOUR_USER", "password": "YOUR_PASSWORD" }' http://myserver.blahblah:80/login 

    Regards,

    Sean


    Friday, February 17, 2017 10:32 PM
  • Hi Sean,

    I ran the curl command you gave me and that worked well.   It returned a 200.  I also got back an access token.

    The next thing I'm going to do is run my R code outside of my company's firewall while trying to connect to port 80.  Let's see what happens.   I'll post an update soon.

    Thanks,

    Carlos -

    Friday, February 17, 2017 11:27 PM
  • Hi Sean,

    I can connect fine from home from R Studio.  So changing the endpoint port from 12800 to 80 is not a problem with R Server.

    So after successfully connecting from home, I then immediately VPN into work and I try the same exact thing:  I then get the "Failure when receiving data from the peer" error.  As I mentioned in the previous posting, I tried your curl suggestion from work and things worked fine.    

    So there is "something" at work that is interfering when I connect from RStudio.   Judging from the error message, it seems like I actually did connect and that I then get an error when my R script is receiving data.   But it could just be a bad error message.  

    I wonder if somehow there is another port being used in this conversation which my work is blocking ....  I will talk to the firewall guys to see if they can spot something.

    Let me know if you have any other ideas.

    Thanks,

    Carlos -

    Saturday, February 18, 2017 1:18 AM
  • Tried this all again at work. I used Wireshark to capture network traffic and I verified that my laptop is only communicating to port 80 on the R Server.   So it is not a "port blocked" problem.  I'm thinking now that it might be a proxy problem.  

    To troubleshoot, I wrote a three line R program that uses jsonlite to make a REST call to api.census.gov.   This call ("fromJSON") will only work if I include the following line in my R code:
            Sys.setenv(http_proxy="COMPANY_PROXY_ADDRESS_GOES_HERE:80")
    If I don't include this line, then I get the same exact error message that I see when I make my RServer call:  "Failure when receiving data from the peer".

    Unfortunately, the "remoteLogin" call that I use to connect to RServer still does not work even if I run this "http_proxy" code.  So one of the two following things are happening:
    - The remoteLogin call is not picking up on the proxy that I set.
    - Maybe it is not a proxy problem after all.

    I'm still betting that it is a proxy problem and that I just need to find a way to make the "remoteLogin" call know about the proxy.  Have not yet figured out how to do that.

    Let me know if you have any ideas.

    Thanks,

    Carlos -

    Wednesday, February 22, 2017 5:45 PM
  • Perhaps this post has some clues. https://social.technet.microsoft.com/Forums/en-US/08cc3984-bfe3-40b5-932d-178038333523/onebox-configuration-runs-but-cannot-connect-from-other-machine?forum=MicrosoftR
    Thursday, March 9, 2017 2:57 AM
    Moderator
  • Jose, thanks for the reply.   Yes, I do think I have a proxy issue here.  But I don't know what needs to be done to make it go away.   I usually add a line of code such as this in my R script:

    Sys.setenv(http_proxy="COMPANY_PROXY_ADDRESS_GOES_HERE:80")

    But that is not taking care of the problem.   I think that the remoteLogin() function somehow needs to be made aware that there is a proxy that needs to be used.  How to do that?


    Thursday, March 9, 2017 10:24 PM
  • Carlos, I am running ML Server on an Azure VM, and I'm trying to change the port too for universal access. I had everything working smoothly on the default 12800 port. I can call an R function via a REST API call from my laptop RStudio. All fine. But when I attempt to change the webnode port, nothing works. Here is the port update I attempted per the documentation:

    az ml admin port update --webnode 8888

    This seems only to do 'half the job'. It does change the port but (even after restart) somewhere in the configuration it is still holding on to 12800. I've also opened port 8888 on my Azure VM network config. Still no luck.

    I'm not an infrastructure guy, so it could be a lot of things but I had hoped the az ml command would 'just work' per the docs. Any suggestions, help appreciated. Thanks, Andy

    Saturday, May 26, 2018 4:02 AM