service.running error under Windows

1,121 views
Skip to first unread message

John R. Baskwill

unread,
Nov 4, 2013, 3:51:32 PM11/4/13
to salt-...@googlegroups.com
I have a state file that is failing with the following contents to check if the Symantec AntiVirus service is running"

server-SepMasterService:
  service.running:
    - name: SepMasterService


Under debug, an error is returned:

[INFO    ] Executing command 'sc qc "SepMasterService"' in directory 'C:\\Documents and Settings\\Administrator'
[DEBUG   ] output: [SC] QueryServiceConfig FAILED 122:

The data area passed to a system call is too small.

[SC] GetServiceConfig needs 600 bytes


The sc qc command needs a bigger buffer with the bufsize parameter.



--
John R. Baskwill, jr...@psu.edu
Systems Analyst, Information Technology Services
Penn State Harrisburg
W303 Olmsted Building
777 West Harrisburg Pike
Middletown, PA 17057-4898
Phone: 717-948-6268
Fax: 717-948-6535

John R. Baskwill

unread,
Nov 5, 2013, 11:02:40 AM11/5/13
to salt-...@googlegroups.com
I have two other services where the sc command fails because the buffer isn't large enough.



[INFO    ] Executing command 'sc qc "vmware-converter-server-vc"' in directory '
C:\\Users\\admin_jrb28.ACCESS'
[DEBUG   ] output: [SC] QueryServiceConfig FAILED 122:

The data area passed to a system call is too small.

[SC] GetServiceConfig needs 612 bytes
[INFO    ] Executing command 'sc qc "vmware-converter-worker-vc"' in directory '
C:\\Users\\admin_jrb28.ACCESS'
[DEBUG   ] output: [SC] QueryServiceConfig FAILED 122:

The data area passed to a system call is too small.

[SC] GetServiceConfig needs 578 bytes

David Boucha

unread,
Nov 5, 2013, 11:53:31 PM11/5/13
to salt users list
I don't think Salt is doing anything to set the buffer size or anything. Do you know what option or buffer it is referring to?


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Dave Boucha  |  Sr. Engineer


5272 South College Drive, Suite 301 | Murray, UT 84123

office 801-305-3563
da...@saltstack.com | www.saltstack.com

John R. Baskwill

unread,
Nov 11, 2013, 1:37:44 PM11/11/13
to salt-...@googlegroups.com
The usage for the 'sc' command is:

sc <server> qc [service name] <bufferSize>



Currently, Salt is running the command:

sc qc "SepMasterService"

This command fails, saying '[SC] GetServiceConfig needs 732 bytes'



The command 'sc qc "SepMasterService" 1000' is successful.


David Boucha

unread,
Nov 11, 2013, 2:47:19 PM11/11/13
to salt users list

John, do you think defaulting to always using 1000 for the buffer would be a problem? Or should we make the buffer size configurable?

John R. Baskwill

unread,
Nov 11, 2013, 3:02:10 PM11/11/13
to salt-...@googlegroups.com
All of the problems I've seen would be solved with a buffer size of 1000.  If it's just as easy to make it configurable, though, it might prevent some headaches in the future.

David Boucha

unread,
Nov 11, 2013, 10:01:11 PM11/11/13
to salt users list
As seen here: https://github.com/saltstack/salt/pull/8422

After doing a little googling I've push a pull req setting the buffer size to 5000

I think this should fix the problem. If we need to revisit this later to allow for this to be set in the windows service module and the state module, then we'll do that if this continues to be a problem.

What do you think John?

John R. Baskwill

unread,
Nov 12, 2013, 1:05:45 PM11/12/13
to salt-...@googlegroups.com
The new code produces the command:

sc qc "SepMasterService 5000"

which gives the error message "The specified service does not exist as an installed service."


The command needs to be:

sc qc "SepMasterService" 5000

David Boucha

unread,
Nov 12, 2013, 4:07:24 PM11/12/13
to salt users list
Gah, thank!  I'll fix that immediately.
Dave Boucha  |  Sr. Engineer

Join us at SaltConf, Jan. 28-30, 2014 in Salt Lake City. www.saltconf.com

David Boucha

unread,
Nov 12, 2013, 4:15:05 PM11/12/13
to salt users list
OK, made some fixes here: https://github.com/saltstack/salt/pull/8463

Can you test that, John?  Thanks for your help!

John R. Baskwill

unread,
Nov 12, 2013, 5:21:08 PM11/12/13
to salt-...@googlegroups.com
It works!  Thanks very much.

David Boucha

unread,
Nov 12, 2013, 5:35:36 PM11/12/13
to salt users list
You're welcome!  Thanks for helping diagnose and find the solution!
Reply all
Reply to author
Forward
0 new messages