SSH task in VSTS shows error even though it's just log

Viewed 379

I'm currently working on automating the configuration of a Ubuntu VM in Azure and automated deployment of R-Studio on it using shell scripts, Rcode and VSTS pipelines. All went well, however one thing keeps bothering me and it is the output in the VSTS Release pipeline. I am running R-code to install the R-packages and they are installed fine without any error, however the output log in VSTS shows following (this is a rerun, where the R-packages are already installed and is a desired behavior):

Rscript /home/analytics/Final_process/r_setup.r
2017-11-03T19:17:54.9719684Z ##[error]------------------------------------------------------------------------------
2017-11-03T19:17:54.9719684Z Please library(dtplyr)!
2017-11-03T19:17:54.9719684Z ##[error]data.table + dplyr code now lives in dtplyr.
2017-11-03T19:17:54.9719684Z Please library(dtplyr)!
2017-11-03T19:17:54.9719684Z ##[error]------------------------------------------------------------------------------
2017-11-03T19:17:54.9719684Z Attaching package: ‘dplyr’
2017-11-03T19:17:54.9719684Z Attaching package: ‘dplyr’
2017-11-03T19:17:54.9719684Z     between, first, last
2017-11-03T19:17:54.9719684Z ##[error]The following objects are masked from ‘package:data.table’:
2017-11-03T19:17:54.9719684Z     between, first, last
2017-11-03T19:17:54.9719684Z     filter, lag
2017-11-03T19:17:54.9719684Z ##[error]The following objects are masked from ‘package:stats’:
2017-11-03T19:17:54.9719684Z     filter, lag
2017-11-03T19:17:54.9719684Z     intersect, setdiff, setequal, union
2017-11-03T19:17:54.9719684Z ##[error]The following objects are masked from ‘package:base’:
2017-11-03T19:17:54.9719684Z     intersect, setdiff, setequal, union
2017-11-03T19:17:55.4719651Z Attaching package: ‘lubridate’
2017-11-03T19:17:55.4719651Z Attaching package: ‘lubridate’
2017-11-03T19:17:55.4719651Z     hour, isoweek, mday, minute, month, quarter, second, wday, week,
2017-11-03T19:17:55.4719651Z     yday, year
2017-11-03T19:17:55.4719651Z ##[error]The following objects are masked from ‘package:data.table’:
2017-11-03T19:17:55.4719651Z     hour, isoweek, mday, minute, month, quarter, second, wday, week,
2017-11-03T19:17:55.4719651Z     yday, year
2017-11-03T19:17:55.4875612Z     date
2017-11-03T19:17:55.4875612Z ##[error]The following object is masked from ‘package:base’:
2017-11-03T19:17:55.4875612Z     date
2017-11-03T19:17:55.5344765Z ##[error]------------------------------------------------------------------------------
2017-11-03T19:17:55.5344765Z If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
2017-11-03T19:17:55.5344765Z library(plyr); library(dplyr)
2017-11-03T19:17:55.5344765Z 
2017-11-03T19:17:55.5344765Z ##[error]You have loaded plyr after dplyr - this is likely to cause problems.
2017-11-03T19:17:55.5344765Z If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
2017-11-03T19:17:55.5344765Z library(plyr); library(dplyr)
2017-11-03T19:17:55.5344765Z ##[error]------------------------------------------------------------------------------
2017-11-03T19:17:55.5344765Z Attaching package: ‘plyr’
2017-11-03T19:17:55.5344765Z Attaching package: ‘plyr’
2017-11-03T19:17:55.5344765Z     here
2017-11-03T19:17:55.5344765Z ##[error]The following object is masked from ‘package:lubridate’:
2017-11-03T19:17:55.5344765Z     here
2017-11-03T19:17:55.5500632Z     arrange, count, desc, failwith, id, mutate, rename, summarise,
2017-11-03T19:17:55.5500632Z     summarize
2017-11-03T19:17:55.5500632Z ##[error]The following objects are masked from ‘package:dplyr’:
2017-11-03T19:17:55.5500632Z     arrange, count, desc, failwith, id, mutate, rename, summarise,
2017-11-03T19:17:55.5500632Z     summarize
2017-11-03T19:17:55.5657235Z Attaching package: ‘sfsmisc’
2017-11-03T19:17:55.5657235Z Attaching package: ‘sfsmisc’
2017-11-03T19:17:55.5657235Z     last
2017-11-03T19:17:55.5657235Z ##[error]The following object is masked from ‘package:dplyr’:
2017-11-03T19:17:55.5657235Z     last
2017-11-03T19:17:55.5657235Z     last
2017-11-03T19:17:55.5657235Z ##[error]The following object is masked from ‘package:data.table’:
2017-11-03T19:17:55.5657235Z     last
2017-11-03T19:17:55.6594438Z Attaching package: ‘zoo’
2017-11-03T19:17:55.6594438Z Attaching package: ‘zoo’
2017-11-03T19:17:55.6594438Z     as.Date, as.Date.numeric
2017-11-03T19:17:55.6594438Z ##[error]The following objects are masked from ‘package:base’:
2017-11-03T19:17:55.6594438Z     as.Date, as.Date.numeric

Now everything would be fine, except it keeps popping me the ##[error] message when in fact it's not an error. I can uncheck the option to fail if log writes anything to STDERR, but I don't believe this is a solution because this way I may overlook a real error when it happens.

Does anyone else experienced this? Is it a bug in SSH task or a bug in my R-code.

1 Answers

Those ##error identify what your command is printing out on the standard error.

Solutions:

  • Avoid them in the first place by sanitizing the input you are providing to the command you are using. Perhaps your input script needs to be reworked, and those are actually errors to be fixed;

  • Evaluate whether the content of stderr are 'warning's or 'error's. In the former case you could try to suppress those warning (e.g. library(dplyr, warn.conflicts = FALSE);

  • If the command still succeeds but prints anything on the standard error, last resort is to disable "fail if log writes anything to STDERR" option on the VSTS task;

Related