ctmm-initiative / ctmmweb

Web app for analyzing animal tracking data, built upon ctmm R package
http://biology.umd.edu/movement.html
GNU General Public License v3.0
32 stars 21 forks source link

Session crashes when fitting a model #33

Closed regan-sarwas closed 7 years ago

regan-sarwas commented 7 years ago

Stack Trace:

Warning: Error in mypaste: Need character strings
Stack trace (innermost first):
    74: mypaste
    73: crayon::inverse
    72: cat
    71: para_ll [helpers.R#446]
    70: system.time
    69: print
    68: eval
    67: eval
    66: withProgress
    65: observeEventHandler [/Users/regan_sarwas/MyForks/ctmm-webapp/server.R#1334]
     1: shiny:::runApp
ERROR: [on_request_read] connection reset by peer

Reproduce with:

  1. Use the current master or $ git checkout 55913c9 (the prior commit e2d7543 works fine)
  2. Select 100 samples of buffalo Cilla (others fail as well)
  3. Switch to Model Selection page
  4. Click Fit Model button Browser window goes grey, and needs to be reloaded
xhdong-umd commented 7 years ago

Yes I found the same error in my windows virtual machine test. I added a dependency package crayon to print console message with color, which need to be installed from github instead CRAN. I have fixed run.R script to make sure this, your test was before that fix.

You can try the newest version, it should be fixed.

Sadly, windows console doesn't support ANSI color so you will not see them in color, unless you are using conemu or cmder.

regan-sarwas commented 7 years ago

Oops. My mistake. Thanks. I had loaded all the packages on my development machine, and was running the app directly without sourcing run.R. It works fine when I source run.R.

As a side node, r-lib/crayon on CRAN is not available for R3.4.1, so you need to install from github as done in run.R.

> install.packages('r-lib/crayon')
:
2. package ‘r-lib/crayon’ is not available (for R version 3.4.1)
xhdong-umd commented 7 years ago

Yes, run.R install crayon from github (the older version didn't recognize number input, that's why you are getting that error). So even if you are running locally, it's suggested to run run.R at least once to install the dependency packages first.

Ideally I can put some code in the app so it will try to install from github for these special packages. However installing lots of packages in one run often met problems, and I found it's easier to install github packages separately, since the CRAN packages usually are tested more frequently and cause less problems in installation.

xhdong-umd commented 7 years ago

I just found that the newest RStudio preview version in windows should support ANSI color in console. I haven't verify in my windows VM yet, but I guess the color message should work if you install the newest version.

regan-sarwas commented 7 years ago

Good to know, thanks. I do most of my work on a Mac, and the color looks good there.