Error 10048 on RStudio startup

I can't start a second instance of RStudio without receiving the "Error Starting R" page. The error message I don't know how to interpret or fix in the context of RStudio.

Are there any settings in RStudio I can tweak to fix this?

Thanks!

Details

From:
C:/Users/MyName/AppData/Local/RStudio/log/rsession-MyName.log

2022-06-07T06:52:01.004631Z [rsession-MyName] ERROR system error 10048 (Only one usage of each socket address (protocol/network address/port) is normally permitted); OCCURRED AT class rstudio::core::Error __cdecl rstudio::core::http::initTcpIpAcceptor(class rstudio::core::http::SocketAcceptorService<class rstudio_boost::asio::ip::tcp> &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &) src/cpp/session/http/SessionWin32HttpConnectionListener.cpp:122; LOGGED FROM: int __cdecl main(int,char *const []) src/cpp/session/SessionMain.cpp:2088

How i reproduce it:

  1. Have system proxy running
  2. Open an instance of RStudio normally in Windows 10. I have a few versions of R installed, using 4.0.3 in this case. This session works fine.
  3. Open a second instance of RStudio. This results in the "Error Starting R" warning and the set of error messages, copied below.

A few other items for context:

  1. Have installed and reinstalled RStudio. This first appeared after upgrading to the most recent version of RStudio (RStudio-2022.02.3-492); it still appeared after downgrading to RStudio-2021.09.3-396.exe
  2. it occurs whether i have had an RStudio project reopen or not.
  3. Removing my .renviron, .rhistory, and .rprofile doesn't fix this.
  4. If i have one instance of RStudio open and try opening an R console with R.exe, i can do so without any problem.
  5. I don't have any new system environmental variables I believe are mucking with this. I use a proxy (Clash for Windows), but the proxy settings are not in my system environmental variables, just in the windows proxy settings. When my proxy is turned off, i can open multiple RStudio instances without trouble. I've used this same proxy software for years without trouble, and I'd like to find a way for RStudio to keep working with this thing. Per Window's proxy settings window, my proxy settings are as follows:
    address: 127.0.0.1 , port: 7890 (this is the port consistently)
    excluded IPs: localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*
    The checkbox for "Don't use the proxy server for local (intranet) addresses" is checked. My proxy also has a loopback option for proxying local traffic, but this is also unused. I upgraded my proxy software to the latest version to no avail.
  6. I have previously used httr::set_config to set a proxy address and httr::reset_config() to clear that, but seems unrelated to the current circumstance.
  7. Lastly, I tried googling the error message. I get the basics about how a socket is in use, etc. etc., but it seems odd to me I haven't had problems in years of using RStudio together with a proxy until I recently upgraded R Studio.

Finally, error messages below:

R Session Startup Failure Report

RStudio Version

RStudio 2021.09.3+396, "Ghost Orchid" (d3cd0996, 2022-04-21) for Windows

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

Error message

[No error available]

Process Output

The R session exited with code 1.

Error output:

[No errors emitted]

Standard output:

[No output emitted]

Logs

C:/Users/MyName/AppData/Local/RStudio/log/rsession-MyName.log

2022-06-07T06:52:01.004631Z [rsession-MyName] ERROR system error 10048 (Only one usage of each socket address (protocol/network address/port) is normally permitted); OCCURRED AT class rstudio::core::Error __cdecl rstudio::core::http::initTcpIpAcceptor(class rstudio::core::http::SocketAcceptorService<class rstudio_boost::asio::ip::tcp> &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &) src/cpp/session/http/SessionWin32HttpConnectionListener.cpp:122; LOGGED FROM: int __cdecl main(int,char *const []) src/cpp/session/SessionMain.cpp:2088
2022-06-07T06:58:46.187739Z [rsession-MyName] ERROR system error 10048 (Only one usage of each socket address (protocol/network address/port) is normally permitted); OCCURRED AT class rstudio::core::Error __cdecl rstudio::core::http::initTcpIpAcceptor(class rstudio::core::http::SocketAcceptorService<class rstudio_boost::asio::ip::tcp> &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &) src/cpp/session/http/SessionWin32HttpConnectionListener.cpp:122; LOGGED FROM: int __cdecl main(int,char *const []) src/cpp/session/SessionMain.cpp:2088
2022-06-07T06:58:46.187739Z [rsession-MyName] ERROR system error 10048 (Only one usage of each socket address (protocol/network address/port) is normally permitted); OCCURRED AT class rstudio::core::Error __cdecl rstudio::core::http::initTcpIpAcceptor(class rstudio::core::http::SocketAcceptorService<class rstudio_boost::asio::ip::tcp> &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &) src/cpp/session/http/SessionWin32HttpConnectionListener.cpp:122; LOGGED FROM: int __cdecl main(int,char *const []) src/cpp/session/SessionMain.cpp:2088

1 Like

There's some discussion of this issue here: Windows Server user was given access to the RStudio Desktop session of another user · Issue #10488 · rstudio/rstudio · GitHub

I'm having the same problem on RStudio Desktop when I open a second session. So if I understand correctly, multiple sessions are trying to access the same port? Is there any way to fix this, perhaps by upgrading RStudio when the next version comes out?

This started happening after I upgraded to RStudio Prairie Trillium: 2022.02-481.

1 Like

Thanks for the heads up! I will watch that issue. I added a mention of this thread there.

For anyone who finds this thread, a new github issue on this one is here: Error 10048 and 10053 on RStudio Startup · Issue #11395 · rstudio/rstudio · GitHub

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.