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

MSI Installer fails to install & start service #1838

Open
tmfksoft opened this issue Jan 16, 2025 · 14 comments
Open

MSI Installer fails to install & start service #1838

tmfksoft opened this issue Jan 16, 2025 · 14 comments
Labels

Comments

@tmfksoft
Copy link

tmfksoft commented Jan 16, 2025

Current Behavior

Attepmting to run the latest MSI installer (0.30.0-amd64) the installer fails to start the service:

Image
The installer requested admin permissions which I approved.

The service shows in services.msc but also won't start:

Image

Theres no useful logs in Event Viewer and I don't see a logs file or folder anywhere.

Running the installed windows_exporter.exe with the same command-line as the Windows service works perfectly fine:

Image
Metrics can be accessed at http://localhost:9182/metrics without issue.

Expected Behavior

Installer should succeed in installing and starting the Windows Service.

Steps To Reproduce

1. Run installer
2. Proceed through installer as normal leaving default values/options.

Environment

  • windows_exporter Version: 0.30.0
  • Windows Server Version: Windows 11 Pro 24H2

windows_exporter logs

There are no logs, running the .exe manually works fine and behaves as expected.

Anything else?

N/A

@jkroepke
Copy link
Member

Hi,

  1. please provide the config.yaml
  2. Please double check, if there are any logs in the event log
  3. Please provide the logs, after running msiexec with verbose logs: msiexec /i "C:\MyPackage\Example.msi" /L*V "example.log"

@tmfksoft
Copy link
Author

tmfksoft commented Jan 17, 2025

Hi,

  1. The config.yaml file is empty -- Though this doesn't appear to affect running the .exe manually.

  2. Theres no events in the event log other than the service failed to install error:
    Image
    Attempting to start the service will log the same message as services.msc

  3. I've attached the log to this reply.
    example.log

@jkroepke
Copy link
Member

Does it ever worked on older versions?

@tmfksoft
Copy link
Author

No idea, I've never used windows_exporter before. But I'll check with some older versions and let you know.

@tmfksoft
Copy link
Author

I've tried multiple versions up till 0.23.1 but no luck.

@jkroepke
Copy link
Member

It seems that the msi installer has issues to create the services.

Error 1923. Service 'windows_exporter' (windows_exporter) could not be installed. Verify that you have sufficient privileges to install system services.

And if you look for this error, there are various google results for the error code.

It seems something windows specific. The error Verify that you have sufficient privileges to install system services. is misleading here, since it appears with admin permission as well. It looks like that Windows deny the creation of the service. This can be various reasons.

That what I found:

The Log on as Service right applies to the Local Security Policy of the machine where the DPX client is installed. This right can be applied using ‘Administrative Tools’ -> ‘Local Security Policy’ ->‘Local Policy’ -> ‘User Rights Assignment’ -> ‘Log on as a service’. Also make sure the user is not listed in the Deny Log as a service security policy.

But windows_exporter is using the default system user here.

@jkroepke
Copy link
Member

Are you are using a normal system or domain managed?

@tmfksoft
Copy link
Author

Yeah, I'm a local admin on this machine and it doesn't have any policies that deny service creation.
Though the service does appear in services.msc while the installer is running.

It's a domain managed machine, though no policies prevent service creation.

@jkroepke
Copy link
Member

jkroepke commented Jan 17, 2025

It seems that Windows 11 has a new features called "Smart App Control" which does not like unsigned binaries (like windows_exporter).

Could you check, if Smart App Control is enabled on your Windows 11? Since I'm still on Windows 10, I don't have much info about Smart App Control.

I see, that windows_exporter is running on your cmd terminal, but without admin permission. Thats a difference between the cmd.exe and start as a service.

@tmfksoft
Copy link
Author

I have Smart App Control turned off already.
Are you referring to the CMD running the installer?

@jkroepke
Copy link
Member

jkroepke commented Jan 17, 2025

I have Smart App Control turned off already. Are you referring to the CMD running the installer?

Image

No this one.

About the installer, I saw that UAC screen was accepted.


Could you post the "Log ON" tab of the windows_exporter service?

@tmfksoft
Copy link
Author

Running windows_exporter manually, under admin gives the following:

Image

Here's the log on tab, its just the default settings:
Image

@jkroepke
Copy link
Member

Sorry, but everything looks fine from my point of view. I have no more idea yet.

@ady28
Copy link

ady28 commented Jan 17, 2025

I'm having the same issue on a Windows Server 2025 machine. On Windows Server 2022 everything works fine but on 2025 I see in the logs that the service cannot be started.

I tried multiple versions of windows_exporter but I get the same behavior.

Also tried running the exporter directly from an administrative CMD and it is working. Seems like something in the installer may not be compatible with Windows Server 2025 and Windows 11 24H2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants