:thread: having an issue with the a custom plugin....
# plugins
w
đŸ§” having an issue with the a custom plugin. details in thread
The plugin is supposed to run the following command:
/usr/local/bin/bamc squirl publish -q --squirl-config squirl.yaml -p Environment=dev -p App=datasources -p Job=snowflake -f src/snowflake_squirlconf
when i got to the local process execution dir, the following is present:
Copy code
➄ find /var/folders/h6/wdlp8f0x4f12z50_y2y87v_h0vjpfs/T/process-executionl1A8ab
/var/folders/h6/wdlp8f0x4f12z50_y2y87v_h0vjpfs/T/process-executionl1A8ab
/var/folders/h6/wdlp8f0x4f12z50_y2y87v_h0vjpfs/T/process-executionl1A8ab/squirl.yaml
/var/folders/h6/wdlp8f0x4f12z50_y2y87v_h0vjpfs/T/process-executionl1A8ab/src
/var/folders/h6/wdlp8f0x4f12z50_y2y87v_h0vjpfs/T/process-executionl1A8ab/src/snowflake_squirlconf
yet things are erroring with:
Exception: Failed to execute process: Error launching process: Os { code: 2, kind: NotFound, message: "No such file or directory" }
Having trouble understanding which file or directory is not present b/c AFAICT everything is in the execution context Any help getting more info would be appreciated
w
getting a “not found” like that is from the OS, rather than from the process itself
w
i should note that
cd
into the process execution dir and running the command works
w
which means that it can essentially only be the process that you are trying to run
w
getting a “not found” like that is from the OS, rather than from the process itself
oh interesting
w
/usr/local/bin/bamc
w
Copy code
➄ which bamc
/usr/local/bin/bamc
this is present in my environment
w
one thing to check: are you passing the args as a single string, or as a sequence of strings?
w
sequence
Screen Shot 2021-02-19 at 1.15.12 PM.png
w
so, when you get that low level “failed to launch” error, it should render more details than it usually does
the error output should have a full description of the process
 maybe you can share a sanitized version of that?
(editted a few times: you don’t need to run in debug mode: the “failed to launch process” should just dump more information automatically)
w
yeah i got a larget stack trace
w
it’s just the
Process {..}
struct that is interesting
w
Untitled
(i should note that im still on 1.30 since we have quite a few custom plugins that we're translating
w

ah, oops.
um, could you log the resulting
Process
python object, perhaps?
e
Is bamc an executable or a script, and if a script is it's
head -1
on the PATH of the process executuion?
w
executable
um, could you log the resulting 
Process
 python object, perhaps?
the result of the MultiGet? or should i construct it, log it and then put it in the await statement?
w
the latter
thanks!
and yea
 John’s question is good. the OS is responsible for interpreting the shebang in a script, so you could get this error for any issue there. worth running
file /usr/local/bin/bamc
to confirm
w
output of process:
Copy code
[_Get(product_type=<class 'pants.engine.process.ProcessResult'>, subject_declared_type=<class 'pants.engine.process.Process'>, subject=Process(argv=('/usr/local/bin/bamc sq
uirl', 'publish', '-q', '--squirl-config', './squirl.yaml', '-p', 'Environment=dev', '-p', 'App=datasources', '-p', 'Job=snowflake', '-f', 'src/snowflake_squirlconf'), desc
ription='Squirl Publish for squirl_config(address="src:squirl_snowflake", job=snowflake, sources=(\'snowflake_squirlconf/**/*.yaml\', \'snowflake_squirlconf/*.yaml\'), squirl_dir=snowflake_squirlconf, dependencies=None, no_cache=False, description=None, tags=None, _transitive=False, scope=None)', input_digest=Digest(fingerprint='4a1a7263165d6
80533d6aaf69f7e86828ca1b2bdaff09f5f6b092e2054475a5f', serialized_bytes_length=163), working_directory=None, env=(), append_only_caches=(), output_files=(), output_directori
es=(), timeout_seconds=-1, jdk_home=None, is_nailgunnable=False))]
Copy code
➄ file /usr/local/bin/bamc
/usr/local/bin/bamc: Mach-O 64-bit executable x86_64
e
eh, my question was bad - the PATH bit - since shebangs must be absolute paths.
w
its not a script
its a compiled go binary i think
e
For kicks - just what is a bamc and a squirl
w
ah i see the issue 🙈
proprietary tools 😂 squirl is an inhouse secret management solutiojn
e
ah embedded space
w
yup
well thanks for giving me a sounding board
w
ah, yea: i see it.
Copy code
argv=('/usr/local/bin/bamc squirl', 'publish', ..)
w
yup buried in a property in the subsystem
sad!
w
there are good reasons for the independent arg lists (avoiding lexing things in process specific ways), but they’re definitely a pain in the butt!
w
i mean the subprocess module in python does it too, so imo that's just a language pattern regardless of the justification
w
iirc, windows gives a process its arguments as a single list which it then needs to parse. maybe better than forcing the caller to do it
 *shrug
(
oh. but that wouldn’t have avoided this problem, so nevermind!)