Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows winrm: cannot install using internal install method #72

Open
sparrc opened this issue Sep 14, 2016 · 7 comments
Open

windows winrm: cannot install using internal install method #72

sparrc opened this issue Sep 14, 2016 · 7 comments

Comments

@sparrc
Copy link

sparrc commented Sep 14, 2016

When installing a windows service via WinRM (via ansible), we get an error saying that "The service process could not connect to the service controller."

This was originally reported in Telegraf: influxdata/telegraf#1760

and here is the issue text:

System info:

Win2012R2

Steps to reproduce:

Running in powershell/console works OK (both interactive and installing the service)
Deploying via winrm (ansible) on the same box rc:0, no stdout or stderr output + eventlog error.

  1. execute telegraf.exe via ansible's raw module (powershell via winrm)
  2. check output (rc:0, no err/stdout) + eventID3 in eventlog

Expected behavior:

installing/running telegraf
rc:0, stderr NOT "" and/or stdout NOT "" and no eventID

Actual behavior:

"rc": 0, "stderr": "", "stdout": "", "stdout_lines": [] + eventID:3 "The service process could not connect to the service controller."

Use case:

testing telegraf on windows works fine, mass-deploying it using ansible (or any other deployment method that uses winrm) doesn't, and this is a blocker for using telegraf on windows.

@kardianos
Copy link
Owner

Does winrm and Ansible have full admin rights? It sounds like a fine grain
permission problem to me.

On Wed, Sep 14, 2016, 02:57 Cameron Sparr notifications@github.com wrote:

When installing a windows service via WinRM (via ansible), we get an error
saying that "The service process could not connect to the service
controller."

This was originally reported in Telegraf: influxdata/telegraf#1760
influxdata/telegraf#1760

and here is the issue text:
System info:

Win2012R2
Steps to reproduce:

Running in powershell/console works OK (both interactive and installing
the service)
Deploying via winrm (ansible) on the same box rc:0, no stdout or stderr
output + eventlog error.

  1. execute telegraf.exe via ansible's raw module (powershell via winrm)
  2. check output (rc:0, no err/stdout) + eventID3 in eventlog

Expected behavior:

installing/running telegraf
rc:0, stderr NOT "" and/or stdout NOT "" and no eventID
Actual behavior:

"rc": 0, "stderr": "", "stdout": "", "stdout_lines": [] + eventID:3 "The
service process could not connect to the service controller."
Use case:

testing telegraf on windows works fine, mass-deploying it using ansible
(or any other deployment method that uses winrm) doesn't, and this is a
blocker for using telegraf on windows.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#72, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAuFsdkS_W99BFqbVWujS_sb-lpKkFATks5qp8UYgaJpZM4J8mNC
.

@sparrc
Copy link
Author

sparrc commented Sep 14, 2016

That's a good question, @one1zero1one any idea if this could just be a permissions issue?

I'm not very familiar with the stack, but maybe there is a way to give ansible heightened permissions for this operation.

@one1zero1one
Copy link

one1zero1one commented Sep 14, 2016

Ansible connects to the host via winrm - with the same user (local admin). No issues otherwise, session is running elevated:

EXEC ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
WINRM RESULT u' Response code 0, out "True\r\n", err ""'

however when running telegraf:

EXEC CMD /C "c:/telegraf/telegraf.exe -config c:/telegraf/telegraf.conf -service install"
WINRM RESULT u'Response code 0, out "", err ""'

no out, no err, just the eventID 3 in eventlog.

@kardianos
Copy link
Owner

@one1zero1one Please try to install telegraf.exe by using the windows provided tool "sc.exe" under winrm. If sc works and the internal install fails, then it is a service package problem.

Having the windows role Administrator does not guarantee the appropriate rights.

@one1zero1one
Copy link

@kardianos thanks for the suggestion, sc.exe seems to do the job, both in console and under winrm. Internal install works only from console, fails from winrm.

@kardianos
Copy link
Owner

@one1zero1one Feel free to use sc.exe for now to install telegraf in your deployments. I'll need to examine what can be done differently for both methods to work.

@peter-murray
Copy link

@kardianos kardianos changed the title Windows: The service process could not connect to the service controller. windows winrm: cannot install using internal install method Sep 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants