gpt4 book ai didi

r - VSTS 中的 SSH 任务显示错误,即使它只是日志

转载 作者:行者123 更新时间:2023-12-04 11:38:13 24 4
gpt4 key购买 nike

我目前正在致力于在 Azure 中自动配置 Ubuntu VM,并使用 shell 脚本、Rcode 和 VSTS 管道在其上自动部署 R-Studio。一切都很顺利,但是有一件事一直困扰着我,那就是 VSTS 发布管道中的输出。我正在运行 R 代码来安装 R 软件包,它们安装得很好,没有任何错误,但是 VSTS 中的输出日志显示以下内容(这是重新运行,其中 R 软件包已安装并且是所需的行为):

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

现在一切都会很好,除了它不断向我弹出 ##[error] 消息,而实际上这不是一个错误。如果日志将任何内容写入 STDERR,我可以取消选中失败选项,但我不认为这是一个解决方案,因为这样我可能会在发生真正的错误时忽略它。

还有其他人经历过这种情况吗?这是 SSH 任务中的错误还是我的 R 代码中的错误。

最佳答案

这些 ##error 标识您的命令在标准错误上打印的内容。

解决方案:

  • 首先通过清理您为正在使用的命令提供的输入来避免它们。也许您的输入脚本需要重新编写,而这些实际上是需要修复的错误;

  • 评估stderr的内容是“警告”还是“错误”。在前一种情况下,您可以尝试抑制这些警告(例如library(dplyr, warn.conflicts = FALSE);

  • 如果命令仍然成功,但在标准错误上打印任何内容,最后的办法是禁用 VSTS 任务上的“如果日志向 STDERR 写入任何内容则失败”选项;

关于r - VSTS 中的 SSH 任务显示错误,即使它只是日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47104486/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com