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

Run as Windows Service #6433

Closed
elitistphoenix opened this issue Oct 27, 2022 · 10 comments · Fixed by #6431
Closed

Run as Windows Service #6433

elitistphoenix opened this issue Oct 27, 2022 · 10 comments · Fixed by #6431
Labels
bug Something isn't working

Comments

@elitistphoenix
Copy link

When running as a windows service installed by new-service (PS) or sc.exe I get

Error from windows event logs
The OpenTelemetry service terminated with the following error:
An exception occurred in the service when handling the control request.

I know this was added
#1119

What is the correct way to add + run + run with config file as a windows service

Sample code:
New-Service -Name "OpenTelemetry" -BinaryPathName '"C:\OpenTelemetry\otelcol-contrib.exe --config otel-iis.yaml"'
New-Service -Name "OpenTelemetry" -BinaryPathName '"C:\OpenTelemetry\otelcol-contrib.exe --config C:\OpenTelemetry\otel-iis.yaml"'

Neither works with obviously bin an config file in that location.

Windows event logs
EventData
param1 OpenTelemetry
param2 %%1064
4F00700065006E00540065006C0065006D0065007400720079000000

@tomasmota
Copy link
Contributor

I am having the same issue. Have been running and upgrading otel as service many times, but upgrading from 0.61.0 to 0.63.0 results in failing at startup, complaining that at least one config file must be provided. My command for setting up the service, which has always worked before, is the following:

sc.exe create otelcol displayname= otelcol start= delayed-auto binPath= "C:\bin\otelcol\otelcol-contrib.exe --config C:\bin\otelcol\otel-config.yaml"

@TylerHelmuth
Copy link
Member

/cc @open-telemetry/collector-approvers @open-telemetry/collector-maintainers

@TylerHelmuth TylerHelmuth added the bug Something isn't working label Oct 28, 2022
@mx-psi
Copy link
Member

mx-psi commented Oct 28, 2022

but upgrading from 0.61.0 to 0.63.0 results in failing at startup

Could you try 0.62.1 and see if the issue also happens there?

@tomasmota
Copy link
Contributor

Sure, I'll try that tomorrow.

@mx-psi
Copy link
Member

mx-psi commented Oct 28, 2022

If someone wants to give it a try, I built a binary reverting a PR that seemed suspicious based on the info we have so far, you can download it from here: https://github.com/open-telemetry/opentelemetry-collector/actions/runs/3346624945

@codeboten
Copy link
Contributor

I just tested the core collector from that revert and was able to see the service start

@bogdandrutu
Copy link
Member

This should be fixed, we are doing a patch release now.

@elitistphoenix
Copy link
Author

This works. Thank you!

@kooshan
Copy link

kooshan commented Jun 24, 2023

Hello there! I still have this issue with contrib distribution on version 0.80.0. Are there any workarounds to get this to work?

@mx-psi
Copy link
Member

mx-psi commented Jun 26, 2023

Hello there! I still have this issue with contrib distribution on version 0.80.0. Are there any workarounds to get this to work?

@kooshan can you file a new issue for this? It is likely that the problem you are facing is not the same as the one on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants