ATFutures / upthat

Urban planning and transport health assessment tool
4 stars 1 forks source link

Error on loading the app with Error in if: argument is of length zero #54

Open Robinlovelace opened 4 years ago

Robinlovelace commented 4 years ago

I get a crash on loading the master version. Any ideas what's causing this @mpadge ? Tried to debug but failed so far. Reprex (let me know if you can reproduce this):

devtools::install_github("atfutures/upthat")
#> Skipping install of 'upthat' from a github remote, the SHA1 (15d75686) has not changed since last install.
#>   Use `force = TRUE` to force installation
upthat::runUpthat()
#> Loading required package: shiny
#> 
#> Listening on http://127.0.0.1:6853
#> Reading this matching file: /home/robin/R/x86_64-pc-linux-gnu-library/3.6/upthat/net.Rds
#> Warning: Error in if: argument is of length zero

#> Warning: Error in if: argument is of length zero

Created on 2019-12-17 by the reprex package (v0.3.0)

mpadge commented 4 years ago

I can't reproduce that. I just cloned a fresh repo, and all worked out of the box with default network only. I then pb_downloaded, and everything still worked seamlessly. I notice on your message here that you've also got an inst/net-ac1.Rds, which may be part of the problem? What happens if you do a fresh clone?

Robinlovelace commented 4 years ago

Good point, testing it...

Robinlovelace commented 4 years ago

I can reproduce on fresh clone. I'm using the latest version of R and at the moment that's the only difference I can think of:


R version 3.6.2 (2019-12-12) -- "Dark and Stormy Night"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

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.

  Natural language support but running in an English locale

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.

Restarting R session...

> library(upthat)

Restarting R session...

> library(upthat)
> runUpthat()
Loading required package: shiny

Listening on http://127.0.0.1:6813
Found these Rds files: 
Reading this matching file: /home/robin/R/x86_64-pc-linux-gnu-library/3.6/upthat/net.Rds
Warning: Error in if: argument is of length zero
  [No stack trace available]
Warning: Error in if: argument is of length zero
  [No stack trace available]
mpadge commented 4 years ago

okay, i've not yet updated my R, but will do so now and see if i can reproduce it then ...

mpadge commented 4 years ago

Nup, R3.6.2 "Dark and Stormy Night" (... and how long have we waited for that release title? ...) still can't reproduce it. I can't really help you there, sorry

Robinlovelace commented 4 years ago

Hmmm... an enigma. At least it's not affecting production at the moment.

Robinlovelace commented 4 years ago

Update: I can reproduce this on rocker/geospatial with the following commands:

docker run -e PASSWORD=yourpassword -p 8788:8787 rocker/geospatial &

Then from inside the container:

devtools::install_github("mpadge/upthat", "new-demo-data") 
> 
> devtools::install_github("mpadge/upthat", "new-demo-data")
Skipping install of 'upthat' from a github remote, the SHA1 (a0c48059) has not changed since last install.
  Use `force = TRUE` to force installation
> upthat::runUpthat()
Loading required package: shiny

Listening on http://127.0.0.1:5630
no tokens foundNo mapdeck token found on system. Trying environment variable MAPBOX
fatal: not a git repository (or any of the parent directories): .git
Warning in system("git rev-parse --short HEAD", intern = TRUE) :
  running command 'git rev-parse --short HEAD' had status 128
Found these Rds files: 
Reading this matching file: /usr/local/lib/R/site-library/upthat/net.Rds
Warning: Error in if: argument is of length zero
  [No stack trace available]
Warning: Error in if: argument is of length zero
  [No stack trace available]
Robinlovelace commented 4 years ago

Could it be that there is no crash data? Heads-up @mpadge .