Metricbeat windows service does not startup

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.

And when i try to manually start the service from the server too, i get this error

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

Why does metric beats does not start?

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).

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:

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

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

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

Please Help. What else can i try?

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.

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.

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 for 5.2.0.

3 Likes

Hey Andrew

installing 5.2.0 metricbeat solved the issue. Thank you :slight_smile:

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.

@alexandrul Please start a new topic for your issue.