I was trying to run a project with drake. The make(plan)
runs through fine but after the the last point of the plan I receive an error.
Error in file(private$total_file, "r+w") : cannot open connection
Additional Warning:
In file(private$total_file, "r+w") :
'C:\R_project\.drake/drake/history/total' cannot open file: Invalid argument
I am running on a windows system (with \\
path separators). Typically R uses the /
path convention and handles this fine. But somehow the paths are messed up here and I do not know why.
Is this known and a workaround available? Does someone know where the error is produced, so I can fix it in the drake code?
Thank you!
Example code:
plan2 = drake_plan(
loadRequirements = {
library(ggplot2)
}
)
vis_drake_graph(plan2)
make(plan2)
Output of traceback()
> traceback()
20: file(private$total_file, "r+w")
19: private$txtq_inc_total(length(out))
18: private$txtq_push(title = title, message = message)
17: force(code)
16: private$txtq_exclusive(private$txtq_push(title = title, message = message))
15: config$cache$history$push(title = target, message = meta_hash)
14: store_meta(target = target, value = value, meta = meta, hash = hash,
config = config)
13: store_item(target = target, value = value, meta = meta, config = config)
12: store_outputs(target = target, value = value, meta = meta, config = config)
11: conclude_build_impl.default(value, target, meta, config)
10: conclude_build_impl(value, target, meta, config)
9: conclude_build(build, config)
8: local_build(target = targets[1], config = config, downstream = targets[-1])
7: loop_check(config)
6: drake_backend_loop(config)
5: drake_backend(config)
4: run_backend(config)
3: process_targets(config)
2: make_impl(config)
1: make(plan)
On my Windows 10 machine, your example runs without error. Maybe you are using old versions of
drake
andtxtq
. If so, you can upgrade them withinstall.packages()
. Otherwise,make()
withhistory = FALSE
should avoid the issue.Created on 2020-07-28 by the reprex package (v0.3.0)
Session info