mirror of
https://github.com/amidaware/tacticalrmm.git
synced 2026-04-26 15:05:57 +03:00
[GH-ISSUE #154] Bug: Fire and Forget Script Forgets to Fire #2033
Labels
No labels
In Process
bug
bug
dev-triage
documentation
duplicate
enhancement
fixed
good first issue
help wanted
integration
invalid
pull-request
question
requires agent update
security
ui tweak
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tacticalrmm#2033
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bradhawkins85 on GitHub (Oct 29, 2020).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/154
I am having issues with Right Click > Run Script as Fire and Forget.
Nothing happens on the client machine.
If I run the same script as Wait for output the action is performed on the client machine and the script returns the expected result.
Debug log does not show anything for the script.
Audit log shows the job regardless fo the method used and both return Before and After values of 'null'
@wh1te909 commented on GitHub (Oct 29, 2020):
that's weird, am not able to reproduce. the fire and forget runs the exact same command as the wait for output just with background=True instead of False.
This is handled by salt currently.
Can you run salt minion in debug mode on the agent please, that way we can see in real time if the command is even reaching the agent and if any errors.
from elevated command prompt:
first do the wait for output and you will see in real time the output in the cmd window, then do same for fire and forget
@bradhawkins85 commented on GitHub (Oct 29, 2020):
Looks like the command is getting to the agent.
Both methods bombard me with the following:
('C:\salt\bin\lib\site-packages\salt-3001rc1_16_ge92daf88a2-py3.7.egg\salt\modules\zcbuildout.py', '.py', 0)),
('zenoss', ('C:\salt\bin\lib\site-packages\salt-3001rc1_16_ge92daf88a2-py3.7.egg\salt\modules\zenoss.py',
'.py', 0)), ('zfs',
('C:\salt\bin\lib\site-packages\salt-3001rc1_16_ge92daf88a2-py3.7.egg\salt\modules\zfs.py', '.py', 0)),
('zk_concurrency',
('C:\salt\bin\lib\site-packages\salt-3001rc1_16_ge92daf88a2-py3.7.egg\salt\modules\zk_concurrency.py', '.py',
0)), ('znc', ('C:\salt\bin\lib\site-packages\salt-3001rc1_16_ge92daf88a2-py3.7.egg\salt\modules\znc.py',
'.py', 0)), ('zoneadm',
('C:\salt\bin\lib\site-packages\salt-3001rc1_16_ge92daf88a2-py3.7.egg\salt\modules\zoneadm.py', '.py', 0)),
('zonecfg', ('C:\salt\bin\lib\site-packages\salt-3001rc1_16_ge92daf88a2-py3.7.egg\salt\modules\zonecfg.py',
'.py', 0)), ('zookeeper',
('C:\salt\bin\lib\site-packages\salt-3001rc1_16_ge92daf88a2-py3.7.egg\salt\modules\zookeeper.py', '.py', 0)),
('zpool', ('C:\salt\bin\lib\site-packages\salt-3001rc1_16_ge92daf88a2-py3.7.egg\salt\modules\zpool.py', '.py',
0)), ('zypperpkg',
('C:\salt\bin\lib\site-packages\salt-3001rc1_16_ge92daf88a2-py3.7.egg\salt\modules\zypperpkg.py', '.py', 0))])
Then
Wait for output:
[DEBUG ] LazyLoaded file.remove
[DEBUG ] Minion return retry timer set to 8 seconds (randomized)
[INFO ] Returning information for job: 20201029065913992650
[DEBUG ] Initializing new AsyncZeroMQReqChannel for ('c:\salt\conf\pki\minion', 'DESKTOP-PQ3CI8L-43',
'tcp://mywanip:4506', 'aes')
[DEBUG ] Initializing new AsyncAuth for ('c:\salt\conf\pki\minion', 'DESKTOP-PQ3CI8L-43',
'tcp://mywanip:4506')
[DEBUG ] Connecting the Minion to the Master URI (for the return server): tcp://mywanip:4506
[DEBUG ] Trying to connect to: tcp://mywanip:4506
[DEBUG ] Closing AsyncZeroMQReqChannel instance
[DEBUG ] minion return: {'success': True, 'return': {'pid': 13100, 'retcode': 0, 'stdout': 'Starting ScreenConnect
Client (12992950a8ccf0a6)', 'stderr': "Start-Service : Service 'ScreenConnect Client (12992950a8ccf0a6) (ScreenConnect
Client (12992950a8ccf0a6))' cannot be \r\nstarted due to the following error: Cannot start service ScreenConnect
Client (12992950a8ccf0a6) on computer '.'.\r\nAt
C:\Users\administrator\AppData\Local\Temp\__salt.tmp.kr9cpflf.ps1:28 char:9\r\n+ Start-Service
$serviceName\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : OpenError:
(System.ServiceProcess.ServiceController:ServiceController) [Start-Service], \r\n ServiceCommandException\r\n +
FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand"}, 'retcode': 0, 'jid':
'20201029065913992650', 'fun': 'win_agent.run_script', 'fun_args': [{'filepath':
'salt://scripts//userdefined//ScreenConnectAIO.ps1', 'filename': 'ScreenConnectAIO.ps1', 'shell': 'powershell',
'timeout': 30, 'args': []}]}
[DEBUG ] Subprocess ProcessPayload-Job-20201029065913992650 cleaned up
vs Fire and Forget
[DEBUG ] LazyLoaded file.remove
[DEBUG ] Minion return retry timer set to 6 seconds (randomized)
[INFO ] Returning information for job: 20201029065711285464
[DEBUG ] Initializing new AsyncZeroMQReqChannel for ('c:\salt\conf\pki\minion', 'DESKTOP-PQ3CI8L-43',
'tcp://mywanip:4506', 'aes')
[DEBUG ] Initializing new AsyncAuth for ('c:\salt\conf\pki\minion', 'DESKTOP-PQ3CI8L-43',
'tcp://mywanip:4506')
[DEBUG ] Connecting the Minion to the Master URI (for the return server): tcp://mywanip:4506
[DEBUG ] Trying to connect to: tcp://mywanip:4506
[DEBUG ] Closing AsyncZeroMQReqChannel instance
[DEBUG ] minion return: {'success': True, 'return': {'pid': 24440, 'retcode': None, 'stdout': '', 'stderr': ''},
'retcode': 0, 'jid': '20201029065711285464', 'fun': 'win_agent.run_script', 'fun_args': [{'filepath':
'salt://scripts//userdefined//ScreenConnectAIO.ps1', 'filename': 'ScreenConnectAIO.ps1', 'shell': 'powershell',
'timeout': 30, 'args': [], 'bg': True}]}
C:\Users\ADMINI
1\AppData\Local\Temp__salt.tmp.ak05vblk.ps1 : The term1\AppData\Local\Temp__salt.tmp.ak05vblk.ps1' is not recognized as the name of a cmdlet, function,'C:\Users\ADMINI
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
[DEBUG ] Subprocess ProcessPayload-Job-20201029065711285464 cleaned up
@bradhawkins85 commented on GitHub (Oct 29, 2020):
The first thing that jumps out at me is the Wait for output file path is \ where the Fire and forget is only single \
@wh1te909 commented on GitHub (Oct 29, 2020):
ok i was able to reproduce, I was just using python scripts originally to test, not batch or powershell
so clearly a bug with salt, passing bg=True to salt's cmd.script module messes up the filepath
I would open a ticket with salt but not worth it since i already have this implemented in the go agent so will be moving to that shortly.
I worked around the salt bug for now in
8d33b4b099so please update and should work