pypsexec
pypsexec copied to clipboard
All instances of the designated named pipe are busy. - UNKNOWN_ENUM
Hi @jborean93
Opening another ticket to see if you could help. I am trying to spawn N Procceses per host and fire off to all run the same exe at the same time. It works majority of the time, but randomly I get this error. Just want to see if you have come across it or not.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\multiprocessing\spawn.py", line 114, in _main
prepare(preparation_data)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\multiprocessing\spawn.py", line 225, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\multiprocessing\spawn.py", line 277, in _fixup_main_from_path
run_name="__mp_main__")
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\jas.rowinski\Documents\cluster_display.py", line 125, in <module>
exe = list_things(config)
File "C:\Users\jas.rowinski\Documents\cluster_display.py", line 80, in list_things
c.connect()
File "C:\Users\jas.rowinski\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\pypsexec\client.py", line 64, in connect
self._service.open()
File "C:\Users\jas.rowinski\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\pypsexec\scmr.py", line 247, in open
self._scmr.open()
File "C:\Users\jas.rowinski\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\pypsexec\scmr.py", line 373, in open
CreateOptions.FILE_NON_DIRECTORY_FILE)
File "C:\Users\jas.rowinski\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\smbprotocol\open.py", line 1211, in create
return self._create_response(request)
File "C:\Users\jas.rowinski\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\smbprotocol\open.py", line 1217, in _create_response
response = self.connection.receive(request)
File "C:\Users\jas.rowinski\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\smbprotocol\connection.py", line 763, in wrapped
return func(self, *args, **kwargs)
File "C:\Users\jas.rowinski\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\smbprotocol\connection.py", line 1075, in receive
raise SMBResponseException(response, status)
smbprotocol.exceptions.SMBResponseException: Received unexpected status from the server: (3221225644) UNKNOWN_ENUM: 0xc00000ac
As per MS error codes: UNKNOWN_ENUM = All instances of the designated named pipe are busy
It sounds like the host might be under load and isn't creating the named pipe in time. When you are saying you are spawning N processes, are you creating N connections and N services as well? IIRC PAExec doesn't play well with multiple processes under the same spawned service but it's unfortunately not something I've played around with too much.
Hey @jborean93
I dont believe the host is under load. I have 2 Workstations I'm testing on. For each workstation I spawn a process to create the connection, connect, create service and run executable. Thats it. I just wanted to spawn processes to be ran at the same time for all my workstations.
Here is a snippet of what I'm doing, reading a json config to get specific params and execute the function
class MyProcesses():
def __init__(self, config, args):
self.config = config
self.args = args
def start_cluster(self):
for host in self.config['servers']:
h = host.get('hostname')
h_cmd = host.get('command')
if "master" in h:
cluster_args = self.config['node_extra_args']
else:
cluster_args = self.config['extra_args']
print("Starting Thread for %s" % h)
p = Process(target=start, args=(self.config, h, cluster_args, self.args))
Pros.append(p)
p.start()
# block until all the threads finish
for t in Pros:
t.join()
def start(config, h, cluster_args, exeN):
try:
c = Client(h, username=config['username'], password=config['password'])
c.connect()
c.create_service()
stdout, stderr, rc = c.run_executable(exeN[0], asynchronous=True, use_system_account=True, interactive=True, interactive_session=1, arguments=cluster_args)
finally:
c.remove_service()
c.disconnect()