Apologies for opening another issue, normally renv doesn't give me so many problems.
I am not sure how I end up in this situation, but renv in a project worked ~well yesterday (as in #1948) but now it doesn't.
renv errors after not finding a DESCRIPTION file for my project:
- Project '~/Documents/projects/EpiNeuro' loaded. [renv 1.0.7.9000; sha: 1f99d7d]
Error in normalizePath(path, winslash, mustWork) :
path[1]="/home/lrevilla@irsicaixa.es/Documents/projects/EpiNeuro/DESCRIPTION": No such file or directory
There was never one.
Thinking it might be something related to using an unreleased renv version I switched from renv 1.0.7.9000 [Sha 1f99d7d8ce7829fa67f3295f5a447e3df09c7a38] to 1.0.7 from CRAN but it still fails.
I switched back to 1.0.7.9000 with renv::restore(packages = "renv") and the problem persists.
On a different project with [renv 1.0.7.9000; sha: 1f99d7d] I don't have this problems.
So I think this is a unique setting of this project.
The renv/activate.R file is the same in both projects (via diff EpiNeuro/renv/activate.R NEUROEpiCas/renv/activate.R).
In the faulty project I have two settings file (one dcf and one json) that the content did not match (the dcf file was missing a vcs.manage.ignores: TRUE and between them the snapshot.type was different, the dcf was implicit but the json was explicit).
But the settings are mostly similar between projects:
I am running out of ideas of what can be the cause of this error (short of deleting the renv folder and related files and avoid using it in production). It prevents me of using renv::snapshot and renv::status...
Status
```
R --vanilla
R version 4.4.0 (2024-04-24) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> renv::status()
Error in normalizePath(path, winslash, mustWork) :
path[1]="/home/lrevilla@irsicaixa.es/Documents/projects/EpiNeuro/DESCRIPTION": No such file or directory
Traceback (most recent calls last):
9: renv::status()
8: renv_snapshot_dependencies(project, dev = dev)
7: dynamic(list(project = project, type = type, dev = dev), renv_snapshot_dependencies_impl(project,
type, dev))
6: the$dynamic_objects[[id]] %||% {
dlog("dynamic", "memoizing dynamic value for '%s'", id)
value
}
5: renv_snapshot_dependencies_impl(project, type, dev)
4: withCallingHandlers(renv_dependencies_impl(path = path, root = project,
field = "Package", errors = config$dependency.errors(), dev = dev),
renv.dependencies.problems = function(cnd) {
if (identical(config$dependency.errors(), "ignored"))
return()
if (interactive() && !proceed())
cancel()
}, renv.dependencies.count = function(cnd) {
count[[cnd$data$path]] <<- cnd$data$count
}, renv.dependencies.elapsed_time = function(cnd) ...)
3: renv_dependencies_impl(path = path, root = project, field = "Package",
errors = config$dependency.errors(), dev = dev)
2: renv_path_normalize(path, mustWork = TRUE)
1: normalizePath(path, winslash, mustWork)
```
Snapshot
```
> renv::snapshot()
It looks like you've called renv::snapshot() in a project that hasn't been activated yet.
How would you like to proceed?
1: Activate the project and use the project library.
2: Do not activate the project and use the current library paths.
3: Cancel and resolve the situation another way.
Selection: 1
- renv activated -- please restart the R session.
Error in normalizePath(path, winslash, mustWork) :
path[1]="/home/lrevilla@irsicaixa.es/Documents/projects/EpiNeuro/DESCRIPTION": No such file or directory
Traceback (most recent calls last):
15: renv::snapshot()
14: renv_lockfile_create(project = project, type = type, libpaths = libpaths,
packages = packages, exclude = exclude, prompt = prompt,
force = force, dev = dev)
13: withRestarts(renv_lockfile_create_impl(project, type, libpaths,
packages, exclude, prompt, force, dev = dev), renv_recompute_records = function() {
renv_dynamic_reset()
renv_lockfile_create_impl(project, type, libpaths, packages,
exclude, prompt, force, dev = dev)
})
12: withOneRestart(expr, restarts[[1L]])
11: doWithOneRestart(return(expr), restart)
10: renv_lockfile_create_impl(project, type, libpaths, packages,
exclude, prompt, force, dev = dev)
9: packages %||% renv_snapshot_dependencies(project = project, type = type,
dev = dev)
8: renv_snapshot_dependencies(project = project, type = type, dev = dev)
7: dynamic(list(project = project, type = type, dev = dev), renv_snapshot_dependencies_impl(project,
type, dev))
6: the$dynamic_objects[[id]] %||% {
dlog("dynamic", "memoizing dynamic value for '%s'", id)
value
}
5: renv_snapshot_dependencies_impl(project, type, dev)
4: withCallingHandlers(renv_dependencies_impl(path = path, root = project,
field = "Package", errors = config$dependency.errors(), dev = dev),
renv.dependencies.problems = function(cnd) {
if (identical(config$dependency.errors(), "ignored"))
return()
if (interactive() && !proceed())
cancel()
}, renv.dependencies.count = function(cnd) {
count[[cnd$data$path]] <<- cnd$data$count
}, renv.dependencies.elapsed_time = function(cnd) ...)
3: renv_dependencies_impl(path = path, root = project, field = "Package",
errors = config$dependency.errors(), dev = dev)
2: renv_path_normalize(path, mustWork = TRUE)
1: normalizePath(path, winslash, mustWork)
> packageVersion("renv")
[1] ‘1.0.7’
```
Apologies for opening another issue, normally renv doesn't give me so many problems.
I am not sure how I end up in this situation, but renv in a project worked ~well yesterday (as in #1948) but now it doesn't. renv errors after not finding a DESCRIPTION file for my project:
There was never one.
Thinking it might be something related to using an unreleased renv version I switched from renv 1.0.7.9000 [Sha 1f99d7d8ce7829fa67f3295f5a447e3df09c7a38] to 1.0.7 from CRAN but it still fails. I switched back to 1.0.7.9000 with
renv::restore(packages = "renv")
and the problem persists.On a different project with [renv 1.0.7.9000; sha: 1f99d7d] I don't have this problems. So I think this is a unique setting of this project. The renv/activate.R file is the same in both projects (via
diff EpiNeuro/renv/activate.R NEUROEpiCas/renv/activate.R
). In the faulty project I have two settings file (one dcf and one json) that the content did not match (the dcf file was missing a vcs.manage.ignores: TRUE and between them the snapshot.type was different, the dcf was implicit but the json was explicit). But the settings are mostly similar between projects:I am running out of ideas of what can be the cause of this error (short of deleting the renv folder and related files and avoid using it in production). It prevents me of using renv::snapshot and renv::status...
Status
``` R --vanilla R version 4.4.0 (2024-04-24) -- "Puppy Cup" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > renv::status() Error in normalizePath(path, winslash, mustWork) : path[1]="/home/lrevilla@irsicaixa.es/Documents/projects/EpiNeuro/DESCRIPTION": No such file or directory Traceback (most recent calls last): 9: renv::status() 8: renv_snapshot_dependencies(project, dev = dev) 7: dynamic(list(project = project, type = type, dev = dev), renv_snapshot_dependencies_impl(project, type, dev)) 6: the$dynamic_objects[[id]] %||% { dlog("dynamic", "memoizing dynamic value for '%s'", id) value } 5: renv_snapshot_dependencies_impl(project, type, dev) 4: withCallingHandlers(renv_dependencies_impl(path = path, root = project, field = "Package", errors = config$dependency.errors(), dev = dev), renv.dependencies.problems = function(cnd) { if (identical(config$dependency.errors(), "ignored")) return() if (interactive() && !proceed()) cancel() }, renv.dependencies.count = function(cnd) { count[[cnd$data$path]] <<- cnd$data$count }, renv.dependencies.elapsed_time = function(cnd) ...) 3: renv_dependencies_impl(path = path, root = project, field = "Package", errors = config$dependency.errors(), dev = dev) 2: renv_path_normalize(path, mustWork = TRUE) 1: normalizePath(path, winslash, mustWork) ```Snapshot
``` > renv::snapshot() It looks like you've called renv::snapshot() in a project that hasn't been activated yet. How would you like to proceed? 1: Activate the project and use the project library. 2: Do not activate the project and use the current library paths. 3: Cancel and resolve the situation another way. Selection: 1 - renv activated -- please restart the R session. Error in normalizePath(path, winslash, mustWork) : path[1]="/home/lrevilla@irsicaixa.es/Documents/projects/EpiNeuro/DESCRIPTION": No such file or directory Traceback (most recent calls last): 15: renv::snapshot() 14: renv_lockfile_create(project = project, type = type, libpaths = libpaths, packages = packages, exclude = exclude, prompt = prompt, force = force, dev = dev) 13: withRestarts(renv_lockfile_create_impl(project, type, libpaths, packages, exclude, prompt, force, dev = dev), renv_recompute_records = function() { renv_dynamic_reset() renv_lockfile_create_impl(project, type, libpaths, packages, exclude, prompt, force, dev = dev) }) 12: withOneRestart(expr, restarts[[1L]]) 11: doWithOneRestart(return(expr), restart) 10: renv_lockfile_create_impl(project, type, libpaths, packages, exclude, prompt, force, dev = dev) 9: packages %||% renv_snapshot_dependencies(project = project, type = type, dev = dev) 8: renv_snapshot_dependencies(project = project, type = type, dev = dev) 7: dynamic(list(project = project, type = type, dev = dev), renv_snapshot_dependencies_impl(project, type, dev)) 6: the$dynamic_objects[[id]] %||% { dlog("dynamic", "memoizing dynamic value for '%s'", id) value } 5: renv_snapshot_dependencies_impl(project, type, dev) 4: withCallingHandlers(renv_dependencies_impl(path = path, root = project, field = "Package", errors = config$dependency.errors(), dev = dev), renv.dependencies.problems = function(cnd) { if (identical(config$dependency.errors(), "ignored")) return() if (interactive() && !proceed()) cancel() }, renv.dependencies.count = function(cnd) { count[[cnd$data$path]] <<- cnd$data$count }, renv.dependencies.elapsed_time = function(cnd) ...) 3: renv_dependencies_impl(path = path, root = project, field = "Package", errors = config$dependency.errors(), dev = dev) 2: renv_path_normalize(path, mustWork = TRUE) 1: normalizePath(path, winslash, mustWork) > packageVersion("renv") [1] ‘1.0.7’ ```