You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"No such file or directory" is popped up for a successful "Find in Files" #12781
RStudio 2022.07.1+554 "Spotted Wakerobin" Release (7872775, 2022-07-22) for Ubuntu Bionic
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/110.0
R version:
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 4
minor 2.1
year 2022
month 06
day 23
svn rev 82513
language R
version.string R version 4.2.1 (2022-06-23)
nickname Funny-Looking Kid
Steps to reproduce the problem
The problem comes from time to time and this is not the first time. However I have no repeatable method figured out yet. If you give pointers i will try to replicate.
Describe the problem in detail
When I search a string in all files by using Shift + Cmd + F the IDE is able to search the file and show a few search results in the pane (see screen grab) but on clicking on any of the search result it pops up this error window (see screen grab).
The error has started happening ever since I moved some files around.
Here is the screen grab of the error.
Describe the behavior you expected
I expect it to open the file and take the cursor to the line containing the line - this is the usual behavior.
But instead it is unable to even locate the file.
Got hold of the logs you desired. Used the E command (of rstudio) to export as a text file but that exported a lot of data. You want only the open document API response so here is the copy pasted section of the log that shows the error.
I will learn how to export only one API or group of API responses later.
@sanjmeh Thank you for the logs! @kevinushey can interpret the logs far, far better than I could, but are you by chance using a shared drive?
No, I have a dedicated Ubuntu server with a dedicated root volume and the paths are all accessible through Rstudio files tab, so the drive access cannot be an issue. It is most likely a relative path problem.
And all the above correctly return my home directory /home/sanjay
So for some reason the path JSW-VTPL/oldfuncs is getting added.
I can also tell you I was trying to create a package and then reverted to normal functions. That may have caused some path variables tinkering but not sure why are they still haunting me when I am not writing a package now.
@kevinushey I can reproduce this in RStudio Server (Workbench version) 2023.03.0+385.pro1 on CentOS 7 when not working in a project. When working in a project, find in files works. Note: See #11822. Filed for Server as #12805.
@ronblum can you also confirm what version of grep is installed, and some of the output you see if you set:
Sys.setenv(RSTUDIO_GREP_DEBUG = 1)
before executing Find in Files?
FWIW on Ubuntu, I have:
$ /usr/bin/grep --version
grep (GNU grep) 3.7
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and others; see
<https://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
Can you please also confirm some of the output you see in the console if you run
Here you go..
grep '--binary-files=without-match' '-rHn' '--color=always' '--devices=skip' '-i' '-F' '-f' '/tmp/RtmpfrxsA4/rs_grep3253e06645f32.txt' '--include=*.r' '--include=*.R'
stdout: omni/DBL/api.dbl.R:23:source("../commonAPI.R")
omni/mobifox/api.mfox.R:1:# API functions tailored for ABL. Prefer these over commonAPI.R
omni/abl/api.abl.R:1:# API functions tailored for ABL. Prefer these over commonAPI.R
omni/abl/email.R:4:suppressMessages(source("~/omni/commonAPI.R"))
omni/airtel/omniapi.R:2:if(!exists("loaded.commonapi.r"))
omni/airtel/omniapi.R:3: source("~/omni/commonAPI.R")
omni/inchara/api.inchara.R:24:source("~/omni/commonAPI.R")
omni/cron_statistics.R:3:source("~/omni/commonAPI.R")
omni/smallfns.R:359: remove("loaded.commonapi.r",envir = .GlobalEnv)
omni/projdrain.R:6:source("~/omni/commonAPI.R")
omni/apco/api.apco.R:26:source("~/omni/commonAPI.R")
omni/commonAPI.R:3:loaded.commonapi.r <- T
omni/commonAPI.R:294:# this is in commonAPI.R; we have to remove the individual get_events() in client directory
omni/cron_functions.R:3:if(!exists("loaded.commonapi.r")) source("~/omni/commonAPI.R")
omni/cron_functions.R:9:#source("~/omni/airtel/omniapi.R") # for airtel only - we have to get rid of omniapi.R and move completely to commonAPI.R
JSW-VTPL/oldfuncs/cron_functions.R:4:if(!exists("loaded.commonapi.r")) source("~/omni/commonAPI.R")
JSW-VTPL/oldfuncs/cron_functions.R:10:#source("~/omni/airtel/omniapi.R") # for airtel only - we have to get rid of omniapi.R and move completely to commonAPI.R
JSW-VTPL/jswapi.R:295:# this is in commonAPI.R; we have to remove the individual get_events() in client directory
gpt/smallfns.R:338: remove("loaded.commonapi.r",envir = .GlobalEnv)
TMA/api.R:257:# this is in commonAPI.R; we have to remove the individual get_events() in client directory
Thanks! I think this confirms that RStudio is erroneously placing ~/JSW-VTPL rather than ~/ in front of these paths, but it's still not clear to me why.
Is there any chance that that HOME environment variable (as visible to RStudio in some location) was modified at some point in time?
Or, perhaps, is the R_USER environment variable set to something?
Thanks! I think this confirms that RStudio is erroneously placing ~/JSW-VTPL rather than ~/ in front of these paths, but it's still not clear to me why.
Phew! Atleast one step we progressed.
Is there any chance that that HOME environment variable (as visible to RStudio in some location) was modified at some point in time?
Or, perhaps, is the R_USER environment variable set to something?
There is a chance that environment was fiddled but I donot remember.
Shall I paste the whole envoutput on shell?
FWIW this has been happening to me seemingly every time I open RStudio, switch projects, or open a script. Can send diagnostics if required but maybe best to wait to see the outcome of this exchange.
This looks suspicious to me. Is it possible that your HOME directory was temporarily set to this location, and RStudio Server was started using that as your HOME? If so, it's possible RStudio is "remembering" that location and using that when resolving paths for Find in Files.
Hmm..
A quick echo of $HOME always returns the correct home. Is it possible that bash is saying something as HOME while rstudio something else? How does Rstudio decide what is HOME?
I also checked by list.files("~") and the files listed are correctly my home directory file.
So it seems the expand file name script of rstudio has some weird bug.
YEss! It started working in Elsbeth Germanium ! Kudos to the rstudio team who were persistent enough to get this out of the way. Thanks @mikebessuille@kevinushey@ronblum
Activity
sanjmeh commentedon Mar 5, 2023
I can confirm that the problem has now started in all the files. 100%.
kevinushey commentedon Mar 5, 2023
If you can reproduce the issue again, please try the following steps after:
Help -> Diagnostics -> Request Logfrom the main menu;You should see something like the following there:
except I expect your "response" text might include some error output.
sanjmeh commentedon Mar 6, 2023
Got hold of the logs you desired. Used the
Ecommand (of rstudio) to export as a text file but that exported a lot of data. You want only theopen documentAPI response so here is the copy pasted section of the log that shows the error.I will learn how to export only one API or group of API responses later.
ronblum commentedon Mar 6, 2023
@sanjmeh Thank you for the logs! @kevinushey can interpret the logs far, far better than I could, but are you by chance using a shared drive?
sanjmeh commentedon Mar 6, 2023
No, I have a dedicated Ubuntu server with a dedicated root volume and the paths are all accessible through Rstudio files tab, so the drive access cannot be an issue. It is most likely a relative path problem.
kevinushey commentedon Mar 6, 2023
Thanks -- including the relevant output, with some nicer formatting:
Does this path ("~/JSW-VTPL/tablet/JSW-VTPL/oldfuncs/mariadb.R") look correct?
The most likely explanation is there we're somehow resolving the home directory incorrectly here. Can you also share the output of:
I wonder if those are out-of-sync somehow?
sanjmeh commentedon Mar 7, 2023
NO! This is not correct.
The correct path is
~/JSW-VTPL/oldfuncs/mariadb.Rand the directory
~/JSW-VTPL/tabletalso exists and is usually my current working directory.And all the above correctly return my home directory
/home/sanjaySo for some reason the path
JSW-VTPL/oldfuncsis getting added.I can also tell you I was trying to create a package and then reverted to normal functions. That may have caused some path variables tinkering but not sure why are they still haunting me when I am not writing a package now.
ronblum commentedon Mar 7, 2023
@kevinushey I can reproduce this in RStudio Server (Workbench version) 2023.03.0+385.pro1 on CentOS 7 when not working in a project. When working in a project, find in files works. Note: See #11822. Filed for Server as #12805.
request.log
kevinushey commentedon Mar 7, 2023
@ronblum can you also confirm what version of
grepis installed, and some of the output you see if you set:before executing Find in Files?
FWIW on Ubuntu, I have:
4 remaining items
sanjmeh commentedon Mar 9, 2023
I can see the problem now every time in the log; reproducing one log and explaining it below.
If I see the path it is trying to open:
~/JSW-VTPL/omni/mobifox/api.mfox.RThe actual path is
~/omni/mobifox/api.mfox.RSo due to some reason my home path is wrongly expanded to the current project directory, which is a subdirectory under the home.
kevinushey commentedon Mar 9, 2023
Can you please also confirm some of the output you see in the console if you run
before running Find in Files?
sanjmeh commentedon Mar 9, 2023
Here you go..
kevinushey commentedon Mar 9, 2023
Thanks! I think this confirms that RStudio is erroneously placing
~/JSW-VTPLrather than~/in front of these paths, but it's still not clear to me why.Is there any chance that that
HOMEenvironment variable (as visible to RStudio in some location) was modified at some point in time?Or, perhaps, is the
R_USERenvironment variable set to something?sanjmeh commentedon Mar 9, 2023
Phew! Atleast one step we progressed.
There is a chance that environment was fiddled but I donot remember.
Shall I paste the whole
envoutput on shell?kevinushey commentedon Mar 9, 2023
Yes please, that may be helpful.
SimonDedman commentedon Mar 9, 2023
FWIW this has been happening to me seemingly every time I open RStudio, switch projects, or open a script. Can send diagnostics if required but maybe best to wait to see the outcome of this exchange.
sanjmeh commentedon Mar 10, 2023
Here you go..
kevinushey commentedon Mar 10, 2023
This looks suspicious to me. Is it possible that your
HOMEdirectory was temporarily set to this location, and RStudio Server was started using that as yourHOME? If so, it's possible RStudio is "remembering" that location and using that when resolving paths for Find in Files.sanjmeh commentedon Mar 10, 2023
Hmm..
A quick echo of $HOME always returns the correct home. Is it possible that bash is saying something as HOME while rstudio something else? How does Rstudio decide what is HOME?
I also checked by
list.files("~")and the files listed are correctly my home directory file.So it seems the expand file name script of rstudio has some weird bug.
mikebessuille commentedon Mar 13, 2023
@sanjmeh can you please try the Elsbeth Geranium version, 2022.12.0? We fixed some related problems and I'm hoping this problem is also fixed.
sanjmeh commentedon Mar 13, 2023
YEss! It started working in Elsbeth Germanium ! Kudos to the rstudio team who were persistent enough to get this out of the way. Thanks @mikebessuille @kevinushey @ronblum
mikebessuille commentedon Mar 13, 2023
:) That's great news! Yes the official latest releases is at https://posit.co/download/rstudio-desktop/#download
Glad to hear that fixes your issue! I'll close this issue now.