Post

7 followers Follow
4
Avatar

Saving Error - "No such file or directory"

I've noticed a few people have had this error, and it's never really been pegged down. Unfortunately, I have it, and I'm not sure what to do about it, and it isn't going away.

  1. I'm using RStudio Server on EC2, AMI= ami-a5f120cc, an Ubuntu based instance.
  2. I used the terminal to rejig my project directories a bit. Literally just renamed things - let say OldCode to NewCode
  3. RStudio sees the files & directory, e.g. /NewCode/example.R
  4. I can open example.R
  5. I cannot save example.R - I get the "No such file or directory", which is rich considering it opened it from there, in the GUI. This is only true for /NewCode/, not other directories at the same level.

I have restarted the AWS instance, but that didn't solve the problem.
I have ensure the RStudio user has admin priviliges, and that the folder /Code/ is chmod 755

WRT Application logs [http://support.rstudio.org/help/kb/troubleshooting/rstudio-server-application-logs] I do not have a user.log file in that directory. There is a sys.log file though.

And from my session:
@@@

RStudio.version()
[1] "0.95.256"
sessionInfo()
R version 2.14.1 (2011-12-22)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=C

[4] LC_COLLATE=C LC_MONETARY=C LC_MESSAGES=C

[7] LC_PAPER=C LC_NAME=C LC_ADDRESS=C

[10] LC_TELEPHONE=C LC_MEASUREMENT=C LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] plyr_1.7.1 lme4_0.999999-0 Matrix_1.0-3 lattice_0.20-0 quantmod_0.3-17
[6] Defaults_1.1-1 TTR_0.21-1 xts_0.8-6 zoo_1.7-7

loaded via a namespace (and not attached):
[1] grid_2.14.1 nlme_3.1-103 stats4_2.14.1 tools_2.14.1

as.list(Sys.getenv())
$DISPLAY
[1] ":0"

$EDITOR
[1] "vi"

$GIT_ASKPASS
[1] "rpostback-askpass"

$HOME
[1] "/home/rstudio"

$LC_CTYPE
[1] "en_US.UTF-8"

$LD_LIBRARY_PATH
[1] "/usr/lib/R/lib:/lib:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64:/usr/lib/jni"

$LN_S
[1] "ln -s"

$LOGNAME
[1] "rstudio"

$MAKE
[1] "make"

$PAGER
[1] "/usr/bin/pager"

$PATH
[1] "/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin"

$RSTUDIO_USER_IDENTITY
[1] "rstudio"

$RS_RPOSTBACK_PATH
[1] "/usr/lib/rstudio-server/bin/rpostback"

$R_BROWSER
[1] "xdg-open"

$R_BZIPCMD
[1] "/bin/bzip2"

$R_DOC_DIR
[1] "/usr/share/R/doc"

$R_GZIPCMD
[1] "/bin/gzip"

$R_HOME
[1] "/usr/lib/R"

$R_INCLUDE_DIR
[1] "/usr/share/R/include"

$R_LIBS_SITE
[1] "/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library"

$R_LIBS_USER
[1] "~/R/library"

$R_PAPERSIZE
[1] "letter"

$R_PAPERSIZE_USER
[1] "a4"

$R_PDFVIEWER
[1] "/usr/bin/xdg-open"

$R_PLATFORM
[1] "x86_64-pc-linux-gnu"

$R_PRINTCMD
[1] "/usr/bin/lpr"

$R_RD4DVI
[1] "ae"

$R_RD4PDF
[1] "times,inconsolata,hyper"

$R_SESSION_TMPDIR
[1] "/tmp/Rtmpqp1s9e"

$R_SHARE_DIR
[1] "/usr/share/R/share"

$R_SYSTEM_ABI
[1] "linux,gcc,gxx,gfortran,?"

$R_TEXI2DVICMD
[1] "/usr/bin/texi2dvi"

$R_UNZIPCMD
[1] "/usr/bin/unzip"

$R_ZIPCMD
[1] "/usr/bin/zip"

$SED
[1] "/bin/sed"

$SSH_ASKPASS
[1] "rpostback-askpass"

$TAR
[1] "/bin/tar"

$USER
[1] "rstudio"
@@@

Any help?

Thanks,
Dan

Ian Pylvainen

9 comments

0
Avatar

Dan,

Thanks and this seems likely to be related to a bug we have to relative directories and working in projects. I've updated the bug report to look into this as well. Also I think that if you clear the sdb (source data based) directory inside ~/.rstudio, then this might get things working for now.

Josh

Ian Pylvainen 0 votes
Comment actions Permalink
0
Avatar

Update:
I subsequently started completely from scratch with a new AMI, etc... built the newest version of RStudio/R etc... And still had the same problem.

However, when I finally used the recursive version of chmod, i.e:
sudo chmod -R 777 Project/Code/ things started working fine.

So it appears to be a permissions issue in this case, though a very difficult one to understand. The user details i was using in RStudio was admin, so this was very strange.

D

Ian Pylvainen 0 votes
Comment actions Permalink
0
Avatar

Dan,

Okay great! Thank you for the update and this is good to know!

Josh

Ian Pylvainen 0 votes
Comment actions Permalink
0
Avatar

Hello:

I am getting the same error.

As someone else has noted, the error appears randomly - at least I haven't been able to pin it down.

I tried the suggestions mentioned in this sequence of posts: chmod -R on the directory ... to no avail.

I am using RStudio Server (Community version) on AWS EC2 ... RStudio is invoked through port 8787 using Chrome browser

One work-around was to shut down the browser and then restart it.

Usman Suleman 0 votes
Comment actions Permalink
0
Avatar

I ran into this error myself, and I'm posting what seems to have worked based on a comment on this stack overflow post and Josh's answer above.

The error is not limited to building a package; I encountered it while working in a bog standard RStudio project.

 

So I closed RStudio, went into the terminal and removed the entire subdirectory .RStudio.user (inside the project directory, which is not what Josh suggested above). I restarted RStudio and voila. It works, and RStudio recreated the .RStudio.user directory.

For future reference I am using RStudio 1.0.143 on OS/X 10.12.5.

Drew Tyre 0 votes
Comment actions Permalink
0
Avatar

I have a similar problem (randomly occurring) for files located in different directories, with the following configuration:

  1. rstudio-server version 1.0.153 on Ubuntu 16.04.3 LTS,
  2. remote connection through vpn,
  3. rstudio runs in Firefox 55.0.3 (64 bits), on MacOS Sierra version 10.12.6 (16G29).

Error messages from the system (real computer and user names have been replace by hostname and username respectively):

less /var/log/syslog | grep -e "rsession"
Sep  5 13:47:22 hostname rsession-username[2485]: ERROR system error 2 (No such file or directory); OCCURRED AT: rstudio::core::Error rstudio::session::source_database::get(const string&, boost::shared_ptr<rstudio::session::source_database::SourceDocument>) /home/ubuntu/rstudio/src/cpp/session/SessionSourceDatabase.cpp:570; LOGGED FROM: rstudio::core::Error rstudio::session::modules::source::{anonymous}::closeDocument(const rstudio::core::json::JsonRpcRequest&, rstudio::core::json::JsonRpcResponse*) /home/ubuntu/rstudio/src/cpp/session/modules/SessionSource.cpp:715
Sep  5 14:03:50 hostname rsession-username[2817]: ERROR system error 2 (No such file or directory); OCCURRED AT: rstudio::core::Error rstudio::session::source_database::get(const string&, boost::shared_ptr<rstudio::session::source_database::SourceDocument>) /home/ubuntu/rstudio/src/cpp/session/SessionSourceDatabase.cpp:570; LOGGED FROM: rstudio::core::Error rstudio::session::modules::source::{anonymous}::closeDocument(const rstudio::core::json::JsonRpcRequest&, rstudio::core::json::JsonRpcResponse*) /home/ubuntu/rstudio/src/cpp/session/modules/SessionSource.cpp:715
Sep  5 14:25:23 hostname rsession-username[3138]: ERROR system error 2 (No such file or directory); OCCURRED AT: rstudio::core::Error rstudio::session::source_database::get(const string&, boost::shared_ptr<rstudio::session::source_database::SourceDocument>) /home/ubuntu/rstudio/src/cpp/session/SessionSourceDatabase.cpp:570; LOGGED FROM: SEXPREC* rstudio::session::modules::r_packages::{anonymous}::rs_getKnitParamsForDocument(SEXP) /home/ubuntu/rstudio/src/cpp/session/modules/SessionRCompletions.cpp:456
Sep  5 14:25:29 hostname rsession-username[3138]: ERROR system error 2 (No such file or directory); OCCURRED AT: rstudio::core::Error rstudio::session::source_database::get(const string&, boost::shared_ptr<rstudio::session::source_database::SourceDocument>) /home/ubuntu/rstudio/src/cpp/session/SessionSourceDatabase.cpp:570; LOGGED FROM: SEXPREC* rstudio::session::modules::r_packages::{anonymous}::rs_getKnitParamsForDocument(SEXP) /home/ubuntu/rstudio/src/cpp/session/modules/SessionRCompletions.cpp:456
Sep  5 14:25:38 hostname rsession-username[3138]: ERROR system error 2 (No such file or directory); OCCURRED AT: rstudio::core::Error rstudio::session::source_database::get(const string&, boost::shared_ptr<rstudio::session::source_database::SourceDocument>) /home/ubuntu/rstudio/src/cpp/session/SessionSourceDatabase.cpp:570; LOGGED FROM: rstudio::core::Error rstudio::session::modules::source::{anonymous}::closeDocument(const rstudio::core::json::JsonRpcRequest&, rstudio::core::json::JsonRpcResponse*) /home/ubuntu/rstudio/src/cpp/session/modules/SessionSource.cpp:715
Sep  5 14:47:19 hostname rsession-username[3575]: ERROR system error 2 (No such file or directory); OCCURRED AT: rstudio::core::Error rstudio::session::source_database::get(const string&, boost::shared_ptr<rstudio::session::source_database::SourceDocument>) /home/ubuntu/rstudio/src/cpp/session/SessionSourceDatabase.cpp:570; LOGGED FROM: SEXPREC* rstudio::session::modules::r_packages::{anonymous}::rs_getKnitParamsForDocument(SEXP) /home/ubuntu/rstudio/src/cpp/session/modules/SessionRCompletions.cpp:456
Sep  5 14:48:09 hostname rsession-username[3575]: ERROR system error 2 (No such file or directory); OCCURRED AT: rstudio::core::Error rstudio::session::source_database::get(const string&, boost::shared_ptr<rstudio::session::source_database::SourceDocument>) /home/ubuntu/rstudio/src/cpp/session/SessionSourceDatabase.cpp:570; LOGGED FROM: rstudio::core::Error rstudio::session::modules::source::{anonymous}::closeDocument(const rstudio::core::json::JsonRpcRequest&, rstudio::core::json::JsonRpcResponse*) /home/ubuntu/rstudio/src/cpp/session/modules/SessionSource.cpp:715
Sep  5 16:11:26 hostname rsession-username[5719]: ERROR system error 2 (No such file or directory); OCCURRED AT: rstudio::core::Error rstudio::session::source_database::get(const string&, boost::shared_ptr<rstudio::session::source_database::SourceDocument>) /home/ubuntu/rstudio/src/cpp/session/SessionSourceDatabase.cpp:570; LOGGED FROM: SEXPREC* rstudio::session::modules::r_packages::{anonymous}::rs_getKnitParamsForDocument(SEXP) /home/ubuntu/rstudio/src/cpp/session/modules/SessionRCompletions.cpp:456
Sep  5 16:11:34 hostname rsession-username[5719]: ERROR system error 2 (No such file or directory); OCCURRED AT: rstudio::core::Error rstudio::session::source_database::get(const string&, boost::shared_ptr<rstudio::session::source_database::SourceDocument>) /home/ubuntu/rstudio/src/cpp/session/SessionSourceDatabase.cpp:570; LOGGED FROM: rstudio::core::Error rstudio::session::modules::source::{anonymous}::closeDocument(const rstudio::core::json::JsonRpcRequest&, rstudio::core::json::JsonRpcResponse*) /home/ubuntu/rstudio/src/cpp/session/modules/SessionSource.cpp:715
Pascal Oettli 0 votes
Comment actions Permalink
0
Avatar

I cant see a solution as yet to this rstudio bug, Is it still not resolved?

Sanjay Mehrotra 0 votes
Comment actions Permalink