R Session Aborted whenever I try to access (open, save) R script on a network drive (Win10)

I have a brand new corporate laptop running a Windows 10 Enterprise and I'm trying to get all things R working. I'm running R version 4.1.2 and RStudio 2021.09.0+351 "Ghost Orchid" Release (99999999999999999999999999999999, 2021-09-20) 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

I have needed to revert to 32bit R as the 64bit version does not work at all (even RGui just flashes and is gone). I'm slowly getting there and have now isolated my problems to accessing R scripts that are stored on a network drive. Scripts that are synced to my laptop from OneDrive or SharePoint, or stored locally all seem to work fine.

I can use the said location on the network drive as a working directory and my script works just fine on RGui or if I just copy-paste everything to the RStudio console from another text editor but whenever I try to open a script file on RStudio or even save just a new (even empty) R script to that same network directory, I get the error "R Session Aborted. R encountered a fatal error. The session was terminated. Start New Session". My newly created test script files do appear on the network drive with the right content though. Then, to get RStudio working again, I'll need to reset its state ( https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-Desktop-s-State ) so that it forgets ever having seen a file from the network drive. These two errors always appear on the log:

2021-11-18T10:48:11.401128Z [rsession-username] ERROR Unable to retrieve user home path. HRESULT: -2147024893; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::core::system::userSettingsPath(const class rstudio::core::FilePath &,const class std::basic_string<char,struct std::char_traits,class std::allocator > &,bool) src/cpp/core/system/Win32System.cpp:338
2021-11-18T10:48:11.406128Z [rsession-username] ERROR system error 22 (The device does not recognize the command); OCCURRED AT class rstudio::core::Error __cdecl rstudio::core::crash_handler::initialize(enum rstudio::core::crash_handler::ProgramMode) src/cpp/core/CrashHandler.cpp:358; LOGGED FROM: int __cdecl main(int,char *const ) src/cpp/session/SessionMain.cpp:1866

I was on an extended leave for a over a year and returned to work last spring. I don't think this has ever worked since but I was about to be issued this new laptop so I only started really troubleshooting once the fresh installation had issues as well.

Any ideas on how to proceed to get the networked scripts working as they used to and still should?

After even more digging I eventually found this Issues with R (3.6.3) and RStudio (1.2.5033) on network mapped drive (U:) - #2 by Harlananelson and it seems that it's related. Previously I was accessing the network location as //server/share/folder and it seems to be working now when I actually mapped the share as Z:\folder and accessed the files from there.

I don't know how the current version 2021.09 relates to the v1.4 mentioned here Not possible to save file from Rstudio 1.2.5033 and 1.3.036 (Windows 10) on network shares (UNC paths) · Issue #6587 · rstudio/rstudio · GitHub but it's been over a year and the issue still seems to persists? Should I maybe open another issue in GitHub or will the fix eventually be released? @kevinushey ?

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.