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

I am getting "System error 1067" when I try to run telegraf with a remote config file #4235

Closed
itolevy opened this issue Jun 5, 2018 · 25 comments
Labels
bug unexpected problem or unintended behavior platform/windows

Comments

@itolevy
Copy link

itolevy commented Jun 5, 2018

I am installing telegraf service on Windows 10 Enterprise x64 using the following command:

telegraf.exe --config \\xxx.xxx.xxx.xxx\library\telegraf.conf --service install

But when I try to run the service (net start telegraf), I am getting the following error message: (nothing in the log)

net start telegraf

The Telegraf Data Collector Service service is starting.
The Telegraf Data Collector Service service could not be started.

A system error has occurred.

System error 1067 has occurred.

The process terminated unexpectedly.

Any idea why or how to overcome this?

  • I am running cmd as admin
  • I am able to access the remote directory
@danielnelson danielnelson added bug unexpected problem or unintended behavior platform/windows labels Jun 5, 2018
@itolevy
Copy link
Author

itolevy commented Jun 11, 2018

Reproduces with today's nightly on Windows x86.
Nothing in the logs.

@danielnelson
Copy link
Contributor

@vlastahajek Can you look into this one?

@vlastahajek
Copy link
Contributor

Sure..
@itolevy, does it work when you have config locally?

@vlastahajek
Copy link
Contributor

vlastahajek commented Jun 12, 2018

Telegraf, as a Windows service, runs under the Local System account by default and it probably doesn't have privileges for the remote file. Try changing Telegraf's service account:

Win+X->Computer Management->Services and Applications->Services->Telegraf Data Collector Service:
image

@suraganijanakiram
Copy link

Hi All,

I have tried with the latest version of the telegraf i.e 1.12.5 with the below command and there is no issue if we provide the full path of the configuration file like below.

PLEASE FOLLOW THE BELOW STEPS.
step 1:-
extract the zip file and copy the telegraf folder to the "Program Files" and run the below command
step 2:-
C:\Program Files\telegraf>telegraf.exe -service install -config "C:\Program Files\telegraf\telegraf.conf"

I also got the server error issue when i used the command like below.

C:\Program Files\telegraf>telegraf.exe -service install -config telegraf.conf

also if you are using some different directory please make sure that telegraf have the permission to access the config file.

Hope this helps you.

@TheSilverHawkx
Copy link

@vlastahajek is it possible to add an option to provide a different RunAs account while installing the service?

That way you can run telegraf as a different user or as systemlocal by default.

@vlastahajek
Copy link
Contributor

This is basically possible. What is your main installation use case? Installing Telegraf using scripts?
In other cases, manual setting is also easy..

@TheSilverHawkx
Copy link

This is basically possible. What is your main installation use case? Installing Telegraf using scripts?
In other cases, manual setting is also easy..

In my case, I have my own powershell module for installing agents and adding configuration, but what it does is essentially open cmd and type "telegraf.exe --service install --config folder --config-directory other_folder"

Adding a flag for the telegraf.exe would be optimal, but the same could be done with a few lines of powershell

@SoloWinf
Copy link

Trying to install Telegraf as a Windows Service on Windows Server 2012 R2 Standard

Snag_33dc1aad

Before installing the service, I ensured the test was successful. It doesn't seem to be a problem with the config.

Snag_33dde396

I tried to install the service in different ways and none of them made a difference.
telegraf.exe -service install -config "C:\Program Files\telegraf\telegraf.conf"
"c:\program files\telegraf\telegraf.exe" --service install -config "c:\program files\telegraf\telegraf.conf"
C:\"Program Files"\Telegraf\telegraf.exe --service install

It installed the registry key correctly though

Snag_33e24838
Snag_33e56140

Does anyone have any idea?

@TheSilverHawkx
Copy link

TheSilverHawkx commented Feb 13, 2020

Trying to install Telegraf as a Windows Service on Windows Server 2012 R2 Standard

Snag_33dc1aad

Before installing the service, I ensured the test was successful. It doesn't seem to be a problem with the config.

Snag_33dde396

I tried to install the service in different ways and none of them made a difference.
telegraf.exe -service install -config "C:\Program Files\telegraf\telegraf.conf"
"c:\program files\telegraf\telegraf.exe" --service install -config "c:\program files\telegraf\telegraf.conf"
C:\"Program Files"\Telegraf\telegraf.exe --service install

It installed the registry key correctly though

Snag_33e24838
Snag_33e56140

Does anyone have any idea?

Try these things:

  • If you haven't, check if there's anything written about it the telegraf.log
  • Try to target the problems source, is it happening on multiple servers or only on specific server?
  • From reading the lines you tried to install with there are some syntax error with '-', try installing this way:
1. Open cmd as administrator
2. "C:\Progra\~1\Telegraf\telegraf.exe --service install --config "C:\Progra~1\Telegraf\telegraf.conf"

Error 1607 means that the service could not be start due to corrupt files / corrupt service registry key / anything related to windows trying to run the service by itself and failing

Hope it helps

@SoloWinf
Copy link

Thanks for your response.

The telegraf.log doesn't get created
Snag_3421ea42

I tried this on 3 Windows Servers (all are Server 2012 R2) out of which, it worked only on one server. I compared the permissions (Registry, Folder, Files) between these servers and I couldn't find a difference though.

Here it is,
Snag_340d0542

It installed the service
Snag_340ddb6f

Test was successful
Snag_340f7299

But the service failed to start
Snag_340fdeb1

@TheSilverHawkx
Copy link

@SoloWinf
I installed the new version 1.13.2 on a test server and didn't experience the same error.

Did you try to install an older version? I use 1.11 in my production.

It might sound silly, but did you restart your server during the process, windows operating system have a tendency to "solve themselves" after restarting.

Comparing what you posted to what i have everything seems to be the same.

@SoloWinf
Copy link

I didn't restart the servers yet, believing it'd be unnecessary as it worked on one of 3 servers with 1.13.3

I also tried with 1.13.2 but still the service failed to start
Snag_346f7ff4

@SoloWinf
Copy link

1.11

I just tried with 1.11.0, still doesn't work.

@SoloWinf
Copy link

It works with version 1.13.3 (i386) on a couple of Windows 2012 R2 Standard x64 servers.
I'll try to install it on a couple of more servers to see if it works and keep the thread updated.

Thanks @TheSilverHawkx for your time.

@vlastahajek
Copy link
Contributor

@SoloWinf, When you experience an error during the start of Telegraf, check log entries in Event Viewer->Application, please. There should be an error reported by Telegraf

@0x5nc
Copy link

0x5nc commented Feb 14, 2020

So I kept running into posts, same as this one, where people suggest messing with your registries, deleting telegraf, re-installing, etc.
These are all solutions that assume you didn't edit your telegraf.conf file.
99% of the time, if not 100%, the issue is that you forgot to add quotes or brackets around URLs or something alike ( I mentionned URLs because they're tricky ones ).
Just go double check your edits inside the .conf file. It is mainly the reason why the error keeps popping up whenever you start the service.
If you restart it or reinstall it with a conf file that has errors, it will simply keep rejecting without saying so.

@vlastahajek
Copy link
Contributor

@0x5nc Indeed, this could be the most often issue of config file problem.
However, in this case, when running Telegraf in the test mode, with the same config as in the service mode, without any problem, this is not a problem of config file.

@SoloWinf
Copy link

It works with version 1.13.3 (i386) on a couple of Windows 2012 R2 Standard x64 servers.
I'll try to install it on a couple of more servers to see if it works and keep the thread updated.

Thanks @TheSilverHawkx for your time.

As I mentioned earlier, I've been able to deploy 1.13.3 (i386) on several Windows 2012 R2 Standard x64 servers without a problem. The version that did not work on any of those servers was telegraf-1.13.3_windows_amd64.

@yashcs
Copy link

yashcs commented Feb 24, 2020

Can you please share me the config file. Mostly issue will be there in config..

@evollution
Copy link

I have the same Issue, windows server 2016, half servers works but the other half does not

@evollution
Copy link

i tried with the latest version but getting same error, I can start it with
telegraf --config telegraf.conf

but when I try to start as a service I get error 1067

@vlastahajek
Copy link
Contributor

@evollution , could you, please, check for the Telegraf service error in the Windows Event Log? https://github.com/influxdata/telegraf/blob/master/docs/WINDOWS_SERVICE.md#troubleshooting

@danielnelson
Copy link
Contributor

I'm going to close this issue since this is a generic error message, there is no particular bug to fix for this issue. If you experience this error, the advice from @vlastahajek check the Windows Event Log is correct.

@evollution
Copy link

It seems this was caused by our antivirus, since the exe is not signed the service start is blocked by our AV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior platform/windows
Projects
None yet
Development

No branches or pull requests

9 participants