# Metricbeat windows service does not startup

**URL:** <https://discuss.elastic.co/t/metricbeat-windows-service-does-not-startup/76043>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [February 22, 2017, 1:39pm UTC](https://discuss.elastic.co/t/metricbeat-windows-service-does-not-startup/76043 "2017-02-22T13:39:38Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hussain\_Kothari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hussain_kothari/32/15739_2.png) [@Hussain\_Kothari](https://discuss.elastic.co/u/Hussain_Kothari)\
**Post date:** [February 22, 2017, 1:39pm UTC](https://discuss.elastic.co/t/metricbeat-windows-service-does-not-startup/76043/1 "2017-02-22T13:39:38Z")

</div>

Hi,  
I'm trying to install metrics beat agent using PS-DSC script on our servers. But the service does not start up.  
It gives this error.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/5/554f9e2b7b1ce05eaae644c01d6f97d0fc67b4f9.png)

And when i try to manually start the service from the server too, i get this error  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/f/febbbcdf1536cc84917c6d1f4ba3e4f72c9fda3a.png)

But when i try starting the metricbeats service from console, it starts but with a delay for few seconds.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/6/687689504b317d43acc2a5d2b25a3f94ce15d6b8.png)

Why does metric beats does not start?

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [February 22, 2017, 3:11pm UTC](https://discuss.elastic.co/t/metricbeat-windows-service-does-not-startup/76043/2 "2017-02-22T15:11:22Z")

</div>

Could you please try upgrading to the latest version and retesting.

If that doesn't fix it then please provide your configuration (as text, not as an image).

---

<div class="post-metadata">

**Author:** ![Hussain\_Kothari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hussain_kothari/32/15739_2.png) [@Hussain\_Kothari](https://discuss.elastic.co/u/Hussain_Kothari)\
**Post date:** [February 22, 2017, 3:32pm UTC](https://discuss.elastic.co/t/metricbeat-windows-service-does-not-startup/76043/3 "2017-02-22T15:32:08Z")

</div>

So im using the beats version 5.1. i can try upgrading to 5.2

But i get this issue on Windows Server 2008 R2 Enterprise whereas it works perfect on Windows Server 2012 R2 Standard, Do you think that is an issue??

This is the metricsbeats config that im using:

```auto
metricbeat.modules:
- module: system
  metricsets:
    - cpu
    - filesystem
    - fsstat
    - memory
    - network
    - process
  enabled: true
  period: 10s
  processes: ['.*']

fields:
  environment: ${GMIServer}
  platform: ${GMIPlatform}

output.kafka:
  hosts: ["kafkax:9092"]

  topic: 'AppData.Wecloud'

  partition.round_robin:
    reachable_only: false

  required_acks: 1
  compression: gzip
  max_message_bytes: 1000000

```

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [February 24, 2017, 10:00am UTC](https://discuss.elastic.co/t/metricbeat-windows-service-does-not-startup/76043/4 "2017-02-24T10:00:34Z")

</div>

So you are using the exact same config on 2008 and 2012, and only 2012 works? Could you try 5.2 on both?

---

<div class="post-metadata">

**Author:** ![Hussain\_Kothari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hussain_kothari/32/15739_2.png) [@Hussain\_Kothari](https://discuss.elastic.co/u/Hussain_Kothari)\
**Post date:** [March 6, 2017, 9:51am UTC](https://discuss.elastic.co/t/metricbeat-windows-service-does-not-startup/76043/5 "2017-03-06T09:51:33Z")

</div>

Yes i tried 5.2 but still facing the same issue. the service wont start up.

i still getting this error.

PowerShell DSC resource MSFT\_ServiceResource failed to execute Set-TargetResource functionality with error message: Failure starting service 'metricbeat'. Please check the path  
'"D:\Source\MetricBeat\metricbeat.exe" -c "D:\Source\metricBeat\metricbeat.yml"' provided for the service. Message: 'Exception calling "Start" with "0" argument(s): "Cannot start service  
metricbeat on computer '.'."'  
+ CategoryInfo : InvalidOperation: (: ) , CimException  
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure  
+ PSComputerName : [ABC.EXTRANET.COM](http://ABC.EXTRANET.COM)

Please Help. What else can i try?

 ![](https://us1.discourse-cdn.com/elastic/original/3X/a/6/a6e4d431c0e81af583cb32420d842f21fb2ba1c7.png)

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [March 11, 2017, 3:53pm UTC](https://discuss.elastic.co/t/metricbeat-windows-service-does-not-startup/76043/6 "2017-03-11T15:53:14Z")

</div>

Could you please provide the log output from the metricbeat log file with debug enabled.

So add `logging.level: debug` to your config file, start the service through the service manager, then after it fails, copy the output from the log file. You can paste it here or use [http://pastebin.com](http://pastebin.com).

---

<div class="post-metadata">

**Author:** ![Hussain\_Kothari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hussain_kothari/32/15739_2.png) [@Hussain\_Kothari](https://discuss.elastic.co/u/Hussain_Kothari)\
**Post date:** [March 14, 2017, 11:35am UTC](https://discuss.elastic.co/t/metricbeat-windows-service-does-not-startup/76043/7 "2017-03-14T11:35:53Z")

</div>

2017-03-14T06:30:10-05:00 DBG Disable stderr logging  
2017-03-14T06:30:10-05:00 INFO Home path: [D:\Source\MetricBeat] Config path: [D:\Source\MetricBeat] Data path: [D:\Source\MetricBeat\data] Logs path: [D:\Source\MetricBeat\logs]  
2017-03-14T06:30:10-05:00 INFO Metrics logging every 30s  
2017-03-14T06:30:10-05:00 INFO Setup Beat: metricbeat; Version: 5.1.1  
2017-03-14T06:30:10-05:00 DBG Processors:  
2017-03-14T06:30:10-05:00 DBG Initializing output plugins  
2017-03-14T06:30:10-05:00 DBG initialize kafka output  
2017-03-14T06:30:10-05:00 INFO Activated kafka as output plugin.  
2017-03-14T06:30:10-05:00 DBG Create output worker  
2017-03-14T06:30:10-05:00 DBG No output is defined to store the topology. The server fields might not be filled.  
2017-03-14T06:30:10-05:00 INFO Publisher name: abcd  
2017-03-14T06:30:10-05:00 INFO Flush Interval set to: 1s  
2017-03-14T06:30:10-05:00 INFO Max Bulk Size set to: 2048  
2017-03-14T06:30:10-05:00 DBG create bulk processing worker (interval=1s, bulk size=2048)  
2017-03-14T06:30:10-05:00 INFO Register [ModuleFactory:[docker, mongodb, mysql, postgresql, system], MetricSetFactory:[apache/status, docker/container, docker/cpu, docker/diskio, docker/info, docker/memory, docker/network, haproxy/info, haproxy/stat, kafka/partition, mongodb/status, mysql/status, nginx/stubstatus, postgresql/activity, postgresql/bgwriter, postgresql/database, redis/info, redis/keyspace, system/core, system/cpu, system/diskio, system/filesystem, system/fsstat, system/memory, system/network, system/process, zookeeper/mntr]]  
2017-03-14T06:30:10-05:00 INFO Metricbeat process and system info: {"OSVersion":{"Major":6,"Minor":2,"Build":9200},"Arch":"amd64","NumCPU":4,"User":{"SID":"S-1-5-18","Account":"SYSTEM","Domain":"NT AUTHORITY","Type":1},"ProcessPrivs":{"SeAssignPrimaryTokenPrivilege":{"enabled":false},"SeAuditPrivilege":{"enabled\_by\_default":true,"enabled":true},"SeBackupPrivilege":{"enabled":false},"SeChangeNotifyPrivilege":{"enabled\_by\_default":true,"enabled":true},"SeCreateGlobalPrivilege":{"enabled\_by\_default":true,"enabled":true},"SeCreatePagefilePrivilege":{"enabled\_by\_default":true,"enabled":true},"SeCreatePermanentPrivilege":{"enabled\_by\_default":true,"enabled":true},"SeCreateSymbolicLinkPrivilege":{"enabled\_by\_default":true,"enabled":true},"SeDebugPrivilege":{"enabled\_by\_default":true,"enabled":true},"SeImpersonatePrivilege":{"enabled\_by\_default":true,"enabled":true},"SeIncreaseBasePriorityPrivilege":{"enabled\_by\_default":true,"enabled":true},"SeIncreaseQuotaPrivilege":{"enabled":false},"SeIncreaseWorkingSetPrivilege":{"enabled\_by\_default":true,"enabled":true},"SeLoadDriverPrivilege":{"enabled":false},"SeLockMemoryPrivilege":{"enabled\_by\_default":true,"enabled":true},"SeManageVolumePrivilege":{"enabled":false},"SeProfileSingleProcessPrivilege":{"enabled\_by\_default":true,"enabled":true},"SeRestorePrivilege":{"enabled":false},"SeSecurityPrivilege":{"enabled":false},"SeShutdownPrivilege":{"enabled":false},"SeSystemEnvironmentPrivilege":{"enabled":false},"SeSystemProfilePrivilege":{"enabled\_by\_default":true,"enabled":true},"SeSystemtimePrivilege":{"enabled":false},"SeTakeOwnershipPrivilege":{"enabled":false},"SeTcbPrivilege":{"enabled\_by\_default":true,"enabled":true},"SeTimeZonePrivilege":{"enabled\_by\_default":true,"enabled":true},"SeUndockPrivilege":{"enabled":false}}}  
2017-03-14T06:30:10-05:00 INFO SeDebugPrivilege is enabled. SeDebugPrivilege=(Default, Enabled)  
2017-03-14T06:30:10-05:00 DBG Skip process pid=0: error getting process state for pid=0: getProcName failed: OpenProcess failed for pid=0: The parameter is incorrect.; getProcStatus failed: OpenProcess failed for pid=0: The parameter is incorrect.; getParentPid failed: OpenProcess failed for pid=0: The parameter is incorrect.; getProcCredName failed: OpenProcess failed for pid=0: The parameter is incorrect.  
2017-03-14T06:30:10-05:00 DBG Skip process pid=4: error getting process state for pid=4: getProcName failed: GetProcessImageFileName failed for pid=4: GetProcessImageFileName failed: invalid argument; getProcCredName failed: OpenProcess failed for pid=4: Access is denied.  
2017-03-14T06:30:10-05:00 DBG Skip process pid=248: error getting process state for pid=248: getProcCredName failed: OpenProcess failed for pid=248: Access is denied.  
2017-03-14T06:30:10-05:00 DBG Skip process pid=400: error getting process state for pid=400: getProcCredName failed: OpenProcess failed for pid=400: Access is denied.  
2017-03-14T06:30:10-05:00 DBG Skip process pid=456: error getting process state for pid=456: getProcCredName failed: OpenProcess failed for pid=456: Access is denied.  
2017-03-14T06:30:11-05:00 DBG Skip process pid=556: error getting process state for pid=556: getProcCredName failed: OpenProcess failed for pid=556: Access is denied.

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [March 15, 2017, 4:52pm UTC](https://discuss.elastic.co/t/metricbeat-windows-service-does-not-startup/76043/8 "2017-03-15T16:52:00Z")

</div>

> [@Hussain\_Kothari](#):
>
> 2017-03-14T06:30:10-05:00 INFO Setup Beat: metricbeat; Version: 5.1.1

Based on the log output, you didn't yet try 5.2. Please try 5.2 because there was an issue related to service timeouts that was fixed there. See the [changelog](https://www.elastic.co/guide/en/beats/libbeat/5.2/release-notes-5.2.0.html#_bugfixes_2) for 5.2.0.

---

<div class="post-metadata">

**Author:** ![Hussain\_Kothari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hussain_kothari/32/15739_2.png) [@Hussain\_Kothari](https://discuss.elastic.co/u/Hussain_Kothari)\
**Post date:** [March 16, 2017, 12:46pm UTC](https://discuss.elastic.co/t/metricbeat-windows-service-does-not-startup/76043/9 "2017-03-16T12:46:14Z")

</div>

Hey Andrew

installing 5.2.0 metricbeat solved the issue. Thank you 🙂

---

<div class="post-metadata">

**Author:** ![alexandrul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexandrul/32/12824_2.png) [@alexandrul](https://discuss.elastic.co/u/alexandrul)\
**Post date:** [March 28, 2017, 7:25am UTC](https://discuss.elastic.co/t/metricbeat-windows-service-does-not-startup/76043/10 "2017-03-28T07:25:09Z")

</div>

In my case the Metricbeat 5.2.2 service is failing only when starting my computer. I can manually start it without issues. Since I don't reboot that often, I will try to remember enabling the debug logging next time and upload the logs.

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [March 29, 2017, 4:48pm UTC](https://discuss.elastic.co/t/metricbeat-windows-service-does-not-startup/76043/11 "2017-03-29T16:48:38Z")

</div>

@alexandrul Please start a new topic for your issue.

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [March 29, 2017, 4:48pm UTC](https://discuss.elastic.co/t/metricbeat-windows-service-does-not-startup/76043/12 "2017-03-29T16:48:42Z")

</div>


