Error when deploying Meteor app to Galaxy - meteor

I'm new to Meteor so forgive me if this is too simple, I continuously receive the following errors when trying to deploy my app.
I've desperately scoured the internet in hopes of finding the answer but the same error is still coming up.
> 95gp
> 2016-09-06 06:44:07-05:00Application process starting, version: 1 on apprunner (embedded)
> 95gp
> 2016-09-06 06:44:09-05:00/app/bundle/programs/server/boot.js:333
> 95gp
> 2016-09-06 06:44:09-05:00}).run();
> 95gp
> 2016-09-06 06:44:09-05:00 ^
> 95gp
> 2016-09-06 06:44:09-05:00
> 95gp
> 2016-09-06 06:44:09-05:00Error: $ROOTURL, if specified, must be an URL_
> 95gp
> 2016-09-06 06:44:09-05:00 at Error (native)
> 95gp
> 2016-09-06 06:44:09-05:00 at packages/meteor/urlserver.js:8:1_
> 95gp
> 2016-09-06 06:44:09-05:00 at packages/meteor/urlserver.js:19:1_
> 95gp
> 2016-09-06 06:44:09-05:00 at /app/bundle/programs/server/packages/meteor.js:1365:3
> 95gp
> 2016-09-06 06:44:09-05:00 at /app/bundle/programs/server/boot.js:292:10
> 95gp
> 2016-09-06 06:44:09-05:00 at Array.forEach (native)
> 95gp
> 2016-09-06 06:44:09-05:00 at Function..each..forEach (/app/bundle/programs/server/nodemodules/underscore/underscore.js:79:11)_
> 95gp
> 2016-09-06 06:44:09-05:00 at /app/bundle/programs/server/boot.js:128:5
> 95gp
> 2016-09-06 06:44:09-05:00Application exited with code: 1 signal: null
> 95gp
> 2016-09-06 06:44:09-05:00Application process closed with code: 1 signal: null
> 95gp
> 2016-09-06 06:44:19-05:00The container has crashed. A new container will be started to replace it.
All help is appreciated,
Cheers

Ok according to the logs you've shared $ROOTURL is not defined. Create a settings.json file in the root of your meteor project.
Should contain a structure such as:
{
"galaxy.meteor.com": {
"env": {
"ROOT_URL": "http://yourappname.meteorapp.com/",
"DEPLOY_HOSTNAME":"galaxy.meteor.com",
"MONGO_URL": "mongodb://mongourl"
}
}
}
Then you can take a look at the deployment instructions that are on the galaxy website.
http://galaxy-guide.meteor.com/deploy-guide.html

Related

How to list and remove lazyData of R package?

I want to write a package with internal data, and my method is discribe here
My DESCRIPTION file is:
Package: cancerProfile
Title: A collection of data sets of cancer
Version: 0.1
Authors#R: person("NavyCheng", email = "navycheng2020#gmail.com", role = c("aut", "cre"))
Description: This package contain some data sets of cancers, such as RNA-seq data, TF bind data and so on.
Depends: R (>= 3.4.0)
License: What license is it under?
Encoding: UTF-8
LazyData: true
and my project is like this:
cancerProfile.Rproj
NAMESPACE
LICENSE
DESCRIPTION
R/
data/
|-- prad.rna.count.rda
Then I install my package and load it:
> library(pryr)
> library(devtools)
> install_github('hcyvan/cancerProfile')
> library(cancerProfile)
> mem_used()
82.2 MB
> invisible(prad.rna.count)
> mem_used()
356 MB
> ls()
character(0)
> prad.rna.count[1:3,1:3]
TCGA.2A.A8VL.01A TCGA.2A.A8VO.01A TCGA.2A.A8VT.01A
ENSG00000000003.13 2867 1667 3140
ENSG00000000005.5 6 0 0
ENSG00000000419.11 1354 888 1767
> rm(prad.rna.count)
Warning message:
In rm(prad.rna.count) : object 'prad.rna.count' not found
My question is why I can't 'ls' and 'rm' prad.rna.count and how can I don this?
In your case you couldn't ls() or rm() the dataset because you never put it in your global environment. Consider the following:
# devtools::install_github("hcyvan/cancerProfile")
library(cancerProfile)
library(pryr)
mem_used()
#> 31.8 MB
data(prad.rna.count)
mem_used()
#> 32.2 MB
ls()
#> [1] "prad.rna.count"
prad.rna.count[1:3,1:3]
#> TCGA.2A.A8VL.01A TCGA.2A.A8VO.01A TCGA.2A.A8VT.01A
#> ENSG00000000003.13 2867 1667 3140
#> ENSG00000000005.5 6 0 0
#> ENSG00000000419.11 1354 888 1767
mem_used()
#> 305 MB
rm(prad.rna.count)
ls()
#> character(0)
mem_used()
#> 32.5 MB
Created on 2019-01-15 by the reprex package (v0.2.1)
Since I used data() rather than invisible(), I actually put the data into the global environment, allowing me to see it via ls() and remove it via rm(). The way I loaded the data (data()) didn't increase memory usage because it just returns a promise, but when I evaluated the promise via prad.rna.count[1:3,1:3], the memory usage shot up. Luckily, since I had a name pointing to the object by using data() rather than invisible(), when I used rm(prad.rna.count), R recognized there was no longer a name pointing to that object and released the memory. I'd check out http://adv-r.had.co.nz/memory.html#gc and http://r-pkgs.had.co.nz/data.html#data-data for more details.

R library(RCurl) behavior change on travis-ci

this line of code previously worked on travis-ci but now fails. works fine on appveyor
RCurl::getURL( "ftp://ftp.cdc.gov/pub/data/yrbs/" , ftp.use.epsv = TRUE, dirlistonly = TRUE )
here's the text of the error-
Error in function (type, msg, asError = TRUE) :
server did not report OK, got 425
Calls: get_catalog ... <Anonymous> -> curlPerform -> .Call -> <Anonymous> -> fun
i think my .travis.yml is a pretty standard r configuration:
language: r
cache: packages
sudo: required
apt_packages:
- unixodbc-dev
- libarchive-dev
successful build log late february 2018 at https://api.travis-ci.org/v3/job/343635739/log.txt
failed build log early march 2018 https://api.travis-ci.org/v3/job/352115990/log.txt
the libcurl block looks nearly identical, but there's one noticeable difference between the success and the failure--
late feburary success:
2 upgraded, 35 newly installed, 1 to remove and 124 not upgraded.
mid march failure:
2 upgraded, 35 newly installed, 1 to remove and 135 not upgraded.
minor r session info changes:
late february success:
Session info ------------------------------------------------------------------
date 2018-02-20
DBI 0.7 2017-06-18 cran (#0.7)
devtools 1.13.4 2017-11-09 CRAN (R 3.4.2)
lodown 0.1.0 2018-02-20 Github (ajdamico/lodown#6a69363)
rlang 0.1.6 2017-12-21 cran (#0.1.6)
srvyr 0.3.0 2018-01-24 cran (#0.3.0)
mid march failure:
Session info ------------------------------------------------------------------
date 2018-03-12
DBI 0.8 2018-03-02 cran (#0.8)
devtools 1.13.5 2018-02-18 CRAN (R 3.4.3)
lodown 0.1.0 2018-03-12 Github (ajdamico/lodown#bef726b)
rlang 0.2.0 2018-02-20 cran (#0.2.0)
srvyr 0.3.1 2018-03-10 cran (#0.3.1)

Strange addTaskCallback work in RStudio

This is my next question from cycle of "strange" questions.
I found same difference in code execution in R console and RStudio and couldn't understand reason of it. It's also connected with incorrect work of "track" package in RStudio and R.NET as I'd written before in Incorrect work of track package in R.NET
So, let's look at example from https://search.r-project.org/library/base/html/taskCallback.html
(I corrected it a little for correct data output for sum in RStudio)
times <- function(total = 3, str = "Task a") {
ctr <- 0
function(expr, value, ok, visible) {
ctr <<- ctr + 1
cat(str, ctr, "\n")
if(ctr == total) {
cat("handler removing itself\n")
}
return(ctr < total)
}
}
# add the callback that will work for
# 4 top-level tasks and then remove itself.
n <- addTaskCallback(times(4))
# now remove it, assuming it is still first in the list.
removeTaskCallback(n)
## Not run:
# There is no point in running this
# as
addTaskCallback(times(4))
print(sum(1:10))
print(sum(1:10))
print(sum(1:10))
print(sum(1:10))
print(sum(1:10))
## End(Not run)
An output in R console:
>
> # add the callback that will work for
> # 4 top-level tasks and then remove itself.
> n <- addTaskCallback(times(4))
Task a 1
>
> # now remove it, assuming it is still first in the list.
> removeTaskCallback(n)
[1] TRUE
>
> ## Not run:
> # There is no point in running this
> # as
> addTaskCallback(times(4))
1
1
Task a 1
>
> print(sum(1:10))
[1] 55
Task a 2
> print(sum(1:10))
[1] 55
Task a 3
> print(sum(1:10))
[1] 55
Task a 4
handler removing itself
> print(sum(1:10))
[1] 55
> print(sum(1:10))
[1] 55
>
> ## End(Not run)
>
Okay, let's run this in RStudio.
Output:
> source('~/callbackTst.R')
[1] 55
[1] 55
[1] 55
[1] 55
[1] 55
Task a 1
>
Second run give us this:
> source('~/callbackTst.R')
[1] 55
[1] 55
[1] 55
[1] 55
[1] 55
Task a 2
Task a 1
>
Third:
> source('~/callbackTst.R')
[1] 55
[1] 55
[1] 55
[1] 55
[1] 55
Task a 3
Task a 2
Task a 1
>
and so on.
There is a strange difference between RStudio and R console and I don't know why. Could anyone help me? Is is bug or it's normal and I have curved hands?
Thank you.
P.S. This post connected with correct working of "track" package, because "track.start" method consist this part of code:
assign(".trackingSummaryChanged", FALSE, envir = trackingEnv)
assign(".trackingPid", Sys.getpid(), envir = trackingEnv)
if (!is.element("track.auto.monitor", getTaskCallbackNames()))
addTaskCallback(track.auto.monitor, name = "track.auto.monitor")
return(invisible(NULL))
which, I think, doesn't work correct in RStudio and R.NET
P.P.S. I use R 3.2.2 x64, RStudio 0.99.489 and Windows 10 Pro x64. On RRO this problem also exists under R.NET and RStudio
addTaskCallback() will add a callback that's executed when R execution returns to the top level. When you're executing code line-by-line, each statement executed will return control to the top level, and callbacks will execute.
When executed within source(), control isn't returned until the call to source() returns, and so the callback is only run once.

Issues using xlsx package to insert data from R to excel

I´m trying to create a new excel workbook from R to save a few small datasets using xlsx package. For some reason it was working fine, but i´m unable to do it again.
Code to create a new workbook
library("xlsx")
library("xlsxjars")
library("rJava")
file <- "marca_imei.xlsx"
wb <- loadWorkbook(file)
# The error:
# Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
# java.lang.IllegalArgumentException: Your InputStream was neither an OLE2 stream, nor an OOXML stream
I´ve searched for an answer but it seems people are having the same error when importing data from excel.
I´ve tried what was recommended but it didn´t work. Here are some links for future searchers:
http://r.789695.n4.nabble.com/Read-shortcuts-of-MS-Excel-files-through-R-td4677020.html
http://r.789695.n4.nabble.com/Problem-with-xlsx-package-td3298470.html
sessionInfo():
locale:
[1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252 LC_MONETARY=Spanish_Spain.1252
[4] LC_NUMERIC=C LC_TIME=Spanish_Spain.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] xlsx_0.5.5 xlsxjars_0.6.0 RJDBC_0.2-3 rJava_0.9-6
[5] DBI_0.2-7 slidifyLibraries_0.3.1 slidify_0.4 knitr_1.5
[9] devtools_1.4.1 scales_0.2.3 ggplot2_0.9.3.1 data.table_1.8.11
[13] reshape2_1.2.2
loaded via a namespace (and not attached):
[1] colorspace_1.2-4 dichromat_2.0-0 digest_0.6.4 evaluate_0.5.1 formatR_0.10
[6] grid_3.0.2 gtable_0.1.2 httr_0.2 labeling_0.2 markdown_0.6.3
[11] MASS_7.3-29 memoise_0.1 munsell_0.4.2 parallel_3.0.2 plyr_1.8
[16] proto_0.3-10 RColorBrewer_1.0-5 RCurl_1.95-4.1 stringr_0.6.2 tools_3.0.2
[21] whisker_0.3-2 yaml_2.1.10
Martin,
I believe the issue is that the file you are reading in is not a valid .xlsx file. Here is a code example to reproduce your problem. You can also modify the example to solve the problem. The example uses an example data set from the web (Speed Camera locations baltimore :-)).
In essence line 16 is the culprit of the error triggered on line 26 that generates the error you see.
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
`java.lang.IllegalArgumentException: Your InputStream was neither an OLE2 stream, nor an OOXML stream
to reproduce the error download the file "rows.csv", when you invoke read.xlsx on line 26 it triggers the error you see. To fix change line 16 to download "rows.xlsx" and rerun the script below:
#!/usr/bin/env Rscript
# Ensure Clean Setup...
# Unload packages
if (require(xlsx)) {
detach("package:xlsx", unload=TRUE)
}
if (require(xlsxjars)) {
detach("package:xlsxjars", unload=TRUE)
}
# Delete Environment...
rm(list = ls())
# Delete directory
if (file.exists("data")) {
unlink("./data", recursive = TRUE)
}
# OK - we should be in a base state setup test...
if (!require(xlsx)) {
install.packages("xlsx")
}
if (!file.exists("data")) {
dir.create("data")
}
# Download the file as a CSV file (Deliberate mistake) not a XLSX file
# This causes the error seen when read.xlsx is invoked...
# To fix replace rows.csv with rows.xlsx
if (!file.exists("data/cameras.xlsx")) {
fileUrl <- "https://data.baltimorecity.gov/api/views/dz54-2aru/rows.csv?accessType=DOWNLOAD"
download.file(fileUrl, destfile = "./data/cameras.xlsx", method = "curl")
}
list.files("./data")
# Now we check the file exists and read in the data...
# read.xlsx will throw the java error as the file downloaded is not a valid excel file...
if (!file.exists(".data/cameraData.xlsx")) {
cameraData.xlsx <- read.xlsx("./data/cameras.xlsx", sheetIndex=1, header = TRUE)
}
head(cameraData.xlsx)
Here is the example output:
Load rows.csv...
source('test.R')
Loading required package: xlsx
Loading required package: xlsxjars
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0100 9294 100 9294 0 0 33870 0 --:--:-- --:--:-- --:--:-- 33796
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
java.lang.IllegalArgumentException: Your InputStream was neither an OLE2 stream, nor an OOXML stream
now we replace rows.csv with rows.xlsx...
> source('test.R', echo=TRUE)
> #!/usr/bin/env Rscript
>
> # Ensure Clean Setup...
> # Unload packages
> if (require(xlsx)) {
+ detach("package:xlsx", unload=TRUE)
+ }
> if (require(xlsxjars)) {
+ detach("package:xlsxjars", unload=TRUE)
+ }
> # Delete Environment...
> rm(list = ls())
> # Delete directory
> if (file.exists("data")) {
+ unlink("./data", recursive = TRUE)
+ }
> # OK - we should be in a base state setup test...
>
> if (!require(xlsx)) {
+ install.packages("xlsx")
+ }
Loading required package: xlsx
Loading required package: xlsxjars
> if (!file.exists("data")) {
+ dir.create("data")
+ }
> # Download the file as a CSV file (Deliberate mistake) not a XLSX file
> # This causes the error seen when read.xlsx is invoked...
> # To fix replac .... [TRUNCATED]
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0100 9923 100 9923 0 0 48559 0 --:--:-- --:--:-- --:--:-- 48642
> list.files("./data")
[1] "cameras.xlsx"
> # Now we check the file exists and read in the data...
> # read.xlsx will throw the java error as the file downloaded is not a valid excel file...
> .... [TRUNCATED]
> head(cameraData.xlsx)
address direction street crossStreet intersection Location.1
1 S CATON AVE & BENSON AVE N/B Caton Ave Benson Ave Caton Ave & Benson Ave (39.2693779962, -76.6688185297)
2 S CATON AVE & BENSON AVE S/B Caton Ave Benson Ave Caton Ave & Benson Ave (39.2693157898, -76.6689698176)
3 WILKENS AVE & PINE HEIGHTS AVE E/B Wilkens Ave Pine Heights Wilkens Ave & Pine Heights (39.2720252302, -76.676960806)
4 THE ALAMEDA & E 33RD ST S/B The Alameda 33rd St The Alameda & 33rd St (39.3285013141, -76.5953545714)
5 E 33RD ST & THE ALAMEDA E/B E 33rd The Alameda E 33rd & The Alameda (39.3283410623, -76.5953594625)
6 ERDMAN AVE & N MACON ST E/B Erdman Macon St Erdman & Macon St (39.3068045671, -76.5593167803)
>
It is possible the problem is with Java, not XLConnect. Be sure you have Java installed by taking the test on the Java site -- it will confirm Java is correctly installed. Then make sure R knows the path to find the jre.dll or something like that file name for what is crucial.
Second, here is the code I have been using for a year, without the error message you got.
If it helps you ....
read.xls <- function(filename, sheetnumber=1, sheetname=NULL, forceConversion=TRUE, startCol=0, stringsAsFactors=TRUE) {
wb <- loadWorkbook(filename)
if (is.null(sheetname)) sheetname = getSheets(wb)[sheetnumber]
df <- readWorksheet(wb, sheet=sheetname, forceConversion=forceConversion, startCol=startCol)
if (stringsAsFactors) {
ischar <- sapply(df, class) == "character"
for (i in 1:length(df)) {
if (ischar[i]) df[,i] <- factor(df[,i])
}
}
df
}

Why do I get "Error in rbind.zoo(...) : indexes overlap" when merging two zoo objects?

I have two seemingly identical zoo objects created by the same commands from csv files for different time periods. I try to combine them into one long zoo but I'm failing with "indexes overlap" error. ('merge' 'c' or 'rbind' all produce variants of the same error text.) As far as I can see there are no duplicates and the time periods do not overlap. What am I doing wrong? Am using R version 3.0.1 on Windows 7 64bit if that makes a difference.
> colnames(z2)
[1] "Amb" "HWS" "Diff"
> colnames(t.tmp)
[1] "Amb" "HWS" "Diff"
> max(index(z2))
[1] "2012-12-06 02:17:45 GMT"
> min(index(t.tmp))
[1] "2012-12-06 03:43:45 GMT"
> anyDuplicated(c(index(z2),index(t.tmp)))
[1] 0
> c(z2,t.tmp)
Error in rbind.zoo(...) : indexes overlap
>
UPDATE: In trying to make a reproducible case I've concluded this is an implementation error due to the large number of rows I'm dealing with: it fails if the final result is more than 311434 rows long.
> nrow(c(z2,head(t.tmp,n=101958)))
Error in rbind.zoo(...) : indexes overlap
> nrow(c(z2,head(t.tmp,n=101957)))
[1] 311434
# but row 101958 inserts fine on its own so its not a data problem.
> nrow(c(z2,tail(head(t.tmp,n=101958),n=2)))
[1] 209479
I'm sorry but I dont have the R scripting skills to produce a zoo of the critical length, hopefully someone might be able to help me out..
UPDATE 2- Responding to Jason's suggestion.. : The problem is in the MATCH but my R skills arent sufficient to know how to interpret it- does it mean MATCH finds a duplicate value in x.t whereas anyDuplicated does not?
> x.t <- c(index(z2),index(t.tmp));
> length(x.t)
[1] 520713
> ix <- ORDER (x.t)
> length(ix)
[1] 520713
> x.t <- x.t[ix]
> length(ix)
[1] 520713
> length(x.t)
[1] 520713
> tx <- table(MATCH(x.t,x.t))
> max(tx)
[1] 2
> tx[which(tx==2)]
311371 311373 311378 311383 311384 311386 311389 311392 311400 311401
2 2 2 2 2 2 2 2 2 2
> anyDuplicated(x.t)
[1] 0
After all the testing and head scratching it seems that the problem I'm having is timezone related. Setting the environment to the same time zone as the original data makes it work just fine.
Sys.setenv(TZ="GMT")
> z3<-rbind(z2,t.tmp)
> nrow(z3)
[1] 520713
Thanks to how to guard against accidental time zone conversion for the inspiration to look in that direction.

Resources