Closed colearendt closed 4 years ago
More weirdness afoot that can hopefully help. I have never seen this error before, and have seen it with regularity in a clean environment reproducing these issues:
Warning messages:
1: In `[<-.data.frame`(`*tmp*`, , c("Source", "Repository"), value = list( :
replacement element 1 has 252 rows to replace 130 rows
2: In `[<-.data.frame`(`*tmp*`, , c("Source", "Repository"), value = list( :
replacement element 2 has 252 rows to replace 130 rows
And kinda the inverse problem, I have seen the mapping from "Repository: RSPM" to "Source: RSPM" be pretty flaky. I wrote three manifests in the same project (different subfolders). I got:
"lubridate": {
"Source": "github",
"Repository": null,
--
"lubridate": {
"Source": "CRAN",
"Repository": "https://cluster.rstudiopm.com/cran/__linux__/bionic/latest",
--
"lubridate": {
"Source": "RSPM",
"Repository": "https://cluster.rstudiopm.com/cran/__linux__/bionic/latest",
For all three (the package installation / R session / everything is the same... just different working directories / apps), the package description specifies Repository: RSPM
.
The really troubling one is "github"
, but "CRAN"
is nearly as troubling. It's almost like we're round-robining or something.
I can't easily share the manifest (too big). LMK if it'd be helpful to pair through tomorrow! It is a shared environment, so I can also give you creds if that's helpful.
Another jq
workaround:
cat pre-manifest.json | jq '.packages |= map_values(. | (if .GithubRepo == null and .Source == "github" then .Source |= "RSPM" | .Repository |= "https://cluster.rstudiopm.com/cran/__linux__/bionic/latest" else . end))' > manifest.json
Also note that several of these packages came from RSPM binaries... that shouldn't make a difference, but it's worth noting 😄
Also, has RETICULATE_PYTHON
stuff changed? Specifying the ENV var didn't get me python in the manifest... but specifying writeManifest(python = )
did. I'm really hoping there is something wrong with my environment. This is quite strange.
This manifest problem seems to cause problems on shinyapps.io as well:
Preparing to deploy application...DONE
Uploading bundle for application: 1088881...DONE
Deploying bundle: 2322760 for application: 1088881 ...
Waiting for task: 638941196
building: Parsing manifest
################################ Begin Task Log ################################
################################# End Task Log #################################
Error: Unhandled Exception: Child Task 638941197 failed: Error parsing manifest: GithubUsername must be specified for GitHub package source
In addition: Warning messages:
1: In `[<-.data.frame`(`*tmp*`, , c("Source", "Repository"), value = list( :
replacement element 1 has 217 rows to replace 111 rows
2: In `[<-.data.frame`(`*tmp*`, , c("Source", "Repository"), value = list( :
replacement element 2 has 217 rows to replace 111 rows
Execution halted
################################ Begin Task Log ################################
################################# End Task Log #################################
Error: Unhandled Exception: Child Task 638941197 failed: Error parsing manifest: GithubUsername must be specified for GitHub package source
In addition: Warning messages:
1: In `[<-.data.frame`(`*tmp*`, , c("Source", "Repository"), value = list( :
replacement element 1 has 217 rows to replace 111 rows
2: In `[<-.data.frame`(`*tmp*`, , c("Source", "Repository"), value = list( :
replacement element 2 has 217 rows to replace 111 rows
Execution halted
I'll take a look at this today.
Awesome! Let me know if I can help at all!
It looks like the warnings are coming from here:
If a package is discovered in multiple repositories, then package.repo
will have multiple rows:
Browse[2]> package.repo
name url contrib.url
1 RSPM https://demo.rstudiopm.com/cran/latest https://demo.rstudiopm.com/cran/latest/src/contrib
2 CRAN https://demo.rstudiopm.com/cran/latest https://demo.rstudiopm.com/cran/latest/src/contrib
I think we need to just select the first repository from which the package is found.
I believe this is a bug in the dev version of the
rsconnect
package and the way it builds manifests. Specifically, in some cases a GitHub package can be misrepresented and Connect (1.7.6-6) will try to install it from CRAN / RSPM.To reproduce:
rlang
from GitHubrsconnect::writeManifest
with latest from GitHubYou should see something like:
It only breaks programmatic deployment, as far as I am aware, because IDE deployment does not use this part of the manifest.json. Not sure what, if any, effect would be had on shinyapps.io.
A hacky fix on the
bad-manifest.json
usingjq
:This is a minimal copy of the manifest.json that was created from my environment, just in case it helps diagnose:
manifest.json
``` { "version": 1, "locale": "C", "platform": "3.6.0", "metadata": { "appmode": "rmd-static", "primary_rmd": "file.Rmd", "primary_html": null, "content_category": null, "has_parameters": false }, "packages": { "Rcpp": { "Source": "RSPM", "Repository": "https://cluster.rstudiopm.com/cran/__linux__/bionic/688", "GithubRepo": null, "GithubUsername": null, "GithubRef": null, "GithubSha1": null, "description": { "Package": "Rcpp", "Title": "Seamless R and C++ Integration", "Version": "1.0.1", "Date": "2019-03-16", "Author": "Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou,\n Nathan Russell, Douglas Bates and John Chambers", "Maintainer": "Dirk Eddelbuettel