【问题标题】:Artifactory service not starting on WindowsArtifactory 服务未在 Windows 上启动
【发布时间】:2018-01-18 23:24:30
【问题描述】:

我正在尝试在 Windows Server 上运行 Artifactory,但 Artifactory 服务无法启动。我在 Hyper-V 的 VM 中运行 Windows Server 2016 Datacenter。我尝试过使用和不使用 Windows GUI 的服务器安装。 Artifactory 是通过 Chocolatey 安装的:

choco install Artifactory -y

当我尝试使用 PowerShell 启动服务时:

Start-Service Artifactory

我立即在 PowerShell 中收到此错误:

由于以下错误无法启动服务“artifactory (Artifactory)”:无法在计算机“.”上启动服务 Artifactory。

Windows 事件日志按以下顺序显示这两个错误:

  • 等待 Artifactory 服务连接时超时(30000 毫秒)。
  • 由于以下错误,Artifactory 服务无法启动: 服务未及时响应启动或控制请求。

同样,这些错误会立即发生,因此超时错误是完全错误的。

但我可以手动启动 Artifactory 进程:

C:\Program Files\artifactory\bin\artifactory.bat

人工记录

commons-daemon.2017-08-10.log

[2017-08-10 10:02:53] [info]  [ 2344] Commons Daemon procrun (1.0.11.0 64-bit) started
[2017-08-10 10:02:53] [info]  [ 2344] Service Artifactory name Artifactory
[2017-08-10 10:02:53] [info]  [ 2344] Service 'Artifactory' installed
[2017-08-10 10:02:53] [info]  [ 2344] Commons Daemon procrun finished
[2017-08-10 10:02:54] [info]  [ 3420] Commons Daemon procrun (1.0.11.0 64-bit) started
[2017-08-10 10:02:54] [info]  [ 3420] Updating service...
[2017-08-10 10:02:54] [info]  [ 3420] Service 'Artifactory' updated
[2017-08-10 10:02:54] [info]  [ 3420] Update service finished.
[2017-08-10 10:02:54] [info]  [ 3420] Commons Daemon procrun finished
[2017-08-10 10:02:54] [info]  [ 1468] Commons Daemon procrun (1.0.11.0 64-bit) started
[2017-08-10 10:02:54] [info]  [ 1468] Updating service...
[2017-08-10 10:02:54] [info]  [ 1468] Service 'Artifactory' updated
[2017-08-10 10:02:54] [info]  [ 1468] Update service finished.
[2017-08-10 10:02:54] [info]  [ 1468] Commons Daemon procrun finished
[2017-08-10 10:02:54] [info]  [ 1000] Commons Daemon procrun (1.0.11.0 64-bit) started
[2017-08-10 10:02:54] [info]  [ 1000] Updating service...
[2017-08-10 10:02:54] [info]  [ 1000] Service 'Artifactory' updated
[2017-08-10 10:02:54] [info]  [ 1000] Update service finished.
[2017-08-10 10:02:54] [info]  [ 1000] Commons Daemon procrun finished
[2017-08-10 10:02:54] [info]  [ 5016] Commons Daemon procrun (1.0.11.0 64-bit) started
[2017-08-10 10:02:55] [info]  [ 5016] Updating service...
[2017-08-10 10:02:55] [info]  [ 5016] Service 'Artifactory' updated
[2017-08-10 10:02:55] [info]  [ 5016] Update service finished.
[2017-08-10 10:02:55] [info]  [ 5016] Commons Daemon procrun finished
[2017-08-10 10:02:55] [info]  [ 4308] Commons Daemon procrun (1.0.11.0 64-bit) started
[2017-08-10 10:02:55] [info]  [ 4308] Updating service...
[2017-08-10 10:02:55] [info]  [ 4308] Service 'Artifactory' updated
[2017-08-10 10:02:55] [info]  [ 4308] Update service finished.
[2017-08-10 10:02:55] [info]  [ 4308] Commons Daemon procrun finished
[2017-08-10 10:02:55] [info]  [ 1168] Commons Daemon procrun (1.0.11.0 64-bit) started
[2017-08-10 10:02:55] [info]  [ 1168] Updating service...
[2017-08-10 10:02:55] [info]  [ 1168] Service 'Artifactory' updated
[2017-08-10 10:02:55] [info]  [ 1168] Update service finished.
[2017-08-10 10:02:55] [info]  [ 1168] Commons Daemon procrun finished

artifactory-services.2017-08-10.log

[2017-08-10 10:02:56] [info]  [ 3172] Commons Daemon procrun (1.0.11.0 64-bit) started
[2017-08-10 10:02:56] [info]  [ 3172] Updating service...
[2017-08-10 10:02:56] [info]  [ 3172] Service 'Artifactory' updated
[2017-08-10 10:02:56] [info]  [ 3172] Update service finished.
[2017-08-10 10:02:56] [info]  [ 3172] Commons Daemon procrun finished
[2017-08-10 10:02:56] [info]  [  540] Commons Daemon procrun (1.0.11.0 64-bit) started
[2017-08-10 10:02:56] [info]  [  540] Updating service...
[2017-08-10 10:02:56] [info]  [  540] Service 'Artifactory' updated
[2017-08-10 10:02:56] [info]  [  540] Update service finished.
[2017-08-10 10:02:56] [info]  [  540] Commons Daemon procrun finished

更新

使用 procmon 我注意到当我尝试启动“artifactory”服务时,它正在启动“artifactory-service.exe”。尝试自己直接运行该程序导致以下错误:

系统找不到服务“artifactory-service”的注册表项 加载配置失败 该系统找不到指定的文件。 Commons Daemon procrun 失败,退出值:2(无法加载配置) 系统找不到指定的文件。

再次检查 procmon 显示,当我启动 'artifactory-service.exe' 时,它正在尝试访问注册表项 'HKLM\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\artifactory-service' 并没有找到它。我用 regedit 确认此注册表项不存在。我倾向于认为这是服务无法启动的部分原因。

【问题讨论】:

  • 您在 Tomcat 和 Artifactory 日志中看到了什么?
  • Artifactory 日志包含一些看起来与安装相关的内容。 Start-Service Artifactory 不会在日志中添加任何新内容。如果有帮助,我会在问题中添加内容。 Tomcat 日志为空。
  • 我指的是 Tomcat 日志:'catalina.out' & 'localhost.log' 文件和 Artifactory 日志:'artifactory.log' 文件。
  • @Ariel 那些文件不存在。
  • 你能找到 Artifactory 的主文件夹,看看里面是否有日志文件夹吗?

标签: windows-services artifactory windows-server-2016


【解决方案1】:

这似乎是由于 artifactory-service.exe 导致在服务定义中使用了不寻常的字符。在我检查服务时运行 installService.bat 后,“可执行文件的路径”有

...\artifactory-pro-5.5.1\bin\artifactory-service.exe ೴//RS//Artifactory

不寻常的字符是一些奇怪的 unicode 字符,例如: http://www.fileformat.info/info/unicode/char/0cf4/index.htm

这似乎是由 artifactory-service.exe 引起的,它只是“Commons Daemon Service Runner”prunsrv.exe v1.0.11.0 的旧版本。我找不到这个错误的文档,所以我不知道根本原因。

我解决这个问题的方法是从 Tomcat 8 安装 (tomcat8.exe) 中获取最新版本的 prunsrv.exe v1.0.15.0 并将其重命名为 artifactory-service.exe 并将其放回 %ARTIFACTORY_HOME %\bin 安装文件夹。这使它可以毫无问题地安装并开始运行。

【讨论】:

    【解决方案2】:

    太好了!您的程序对我有用,非常感谢。 gremlin 是我们在安装后在服务完整路径上看到的这个非法字符。我很困惑,因为人工服务在Windows 10下运行良好,但在Windows 2016下拒绝运行。尝试延长PipeServiceTimeout无济于事。

    如果有些人不清楚,只需将 tomcat8.exe 从最新的 tomcat 8.5.23 下载重命名为 artifactory-service.exe 。检查文件属性允许查看原始文件 prunsrv.exe v1.0.11.0prunsrv.exe v1.0.15.0

    File Property Snapshot -- click here

    【讨论】:

      猜你喜欢
      • 2014-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多