Page 1 of 1

Apple Brew Manager - Rescan Host Error

Posted: Sat Jan 30, 2021 3:18 pm
by argyris
I installed Homebrew successfully and also verified that i can install a package ( google chrome ) on the local agent by running brew install --cask google-chrome on the terminal.

When i try to RESCAN HOST on the automate agent console i am getting the following error:

The Script(6055) failed in the Then section at step 7. The reason: Script String Manipulation Failed. I tested this on two different machines and the out come is the same.

Am i missing something? Can you please assist to troubleshoot.

Thank you

Agent OS: MaCOS 11.1
Automate Version: 21.0.27
Habitat 1.0.0.59

Re: Apple Brew Manager - Rescan Host Error

Posted: Mon Feb 01, 2021 1:23 pm
by Cubert
sure can,

Please send us the command logs you have for agent during the install. Also the script logs for that install.

Screenshots will be fine. We need to see where it is failing and what the return was.

Re: Apple Brew Manager - Rescan Host Error

Posted: Wed Feb 10, 2021 9:49 pm
by argyris
SCRIPT LOG:

The Script(6055) failed in the Then section at step 7. The reason: Script String Manipulation Failed

Script: Maintenance\Habitat Apple Brew Manager- Starting at Server Time: Wednesday, February 10, 2021 4:35:49 PM
IF Variable CheckValueOne (P1): CMD Comparer (P2): 2 ValueTwo (P3): SCAN T: 0.7594238
L1 IF Console Logged OnUser (P1): T: 0.7594238
L4 Script NoteNote (P1): :ONCONSOLE T: 0.7594238
L5 Console ShellCommand (P1): '/usr/local/bin/brew leaves | awk '{ print "(1007,||" $1 "||)...' ConsoleNumber (P2): 0 T: 0.7594238
L6 Script String FunctionsValueOne (P1): 8 Operator (P2): OK ValueTwo (P3): , Variable (P4): T: 207.6786686
L7 Script String FunctionsValueOne (P1): 0 Operator (P2): OK ValueTwo (P3): -1 Variable (P4): 0 T: 207.6786686


COMMAND LOG:
*%2fusr%2flocal%2fbin%2fbrew+leaves+%7c+awk+%27%7b+print+%22(1007%2c%7c%7c%22+%241+%22%7c%7c)%2c%22%7d%27|0-OK

Re: Apple Brew Manager - Rescan Host Error

Posted: Thu Feb 11, 2021 2:14 pm
by Cubert
What it looks like is that when you execute

Code: Select all

 '/usr/local/bin/brew leaves 
the return is just an "OK" so the string manipulation function failed to parse any usable data from "OK".


The second odd thing I see that I've not see before is the special characters being converted like so

Code: Select all

*%2fusr%2flocal%2fbin%2fbrew+leaves+%7c+awk+%27%7b+print+%22(1007%2c%7c%7c%22+%241+%22%7c%7c)%2c%22%7d%27|0


Try running this manually at the command prompt or in a terminal on the Apple agent and see if it executes as desired.

Code: Select all

%2fusr%2flocal%2fbin%2fbrew+leaves+%7c+awk+%27%7b+print+%22(1007%2c%7c%7c%22+%241+%22%7c%7c)%2c%22%7d%27
If not try running just "/usr/local/bin/brew leaves" as it is.


Does that return any data? If so have a look at the command log again to see if it converted "/usr/local/bin/brew leaves" before execution or did it execute like "/usr/local/bin/brew leaves"

Re: Apple Brew Manager - Rescan Host Error

Posted: Thu Feb 11, 2021 10:05 pm
by argyris
Running on Mac terminal:
Running %2fusr%2flocal%2fbin%2fbrew+leaves+%7c+awk+%27%7b+print+%22(1007%2c%7c%7c%22+%241+%22%7c%7c)%2c%22%7d%27 gives and error " Command not found"
Running /usr/local/bin/brew leaves see picture below
HBrew-Running on Mac Terminal.png
HBrew-Running on Mac Terminal.png (29.7 KiB) Viewed 3553 times
Running on Automate:
I first run %2fusr%2flocal%2fbin%2fbrew+leaves+%7c+awk+%27%7b+print+%22(1007%2c%7c%7c%22+%241+%22%7c%7c)%2c%22%7d%27
and then
/usr/local/bin/brew leaves
HBrew-Running on Automate.png
HBrew-Running on Automate.png (10.76 KiB) Viewed 3553 times
Let me know if you need more info and thank you for the quick response!!

Re: Apple Brew Manager - Rescan Host Error

Posted: Thu Apr 15, 2021 8:42 pm
by argyris
Is there an update on this or any other troubleshooting steps i should do?