one of our devs is on mac 11.2 and is getting the ...
# general
h
one of our devs is on mac 11.2 and is getting the following bash error when running pants tests:
Copy code
fallible_to_exec_result_or_raise
    raise ProcessExecutionFailure(
pants.engine.process.ProcessExecutionFailure: Process 'Searching for `bash` on PATH=/usr/bin:/bin:/usr/local/bin' failed with exit code -9.
stdout:
I’ve verified that he indeed does have bash installed:
Copy code
$ which bash
/bin/bash
Curiously this is what he sees when executing /usr/bin/env bash
Copy code
$ /usr/bin/env bash
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit <https://support.apple.com/kb/HT208050>.
bash-3.2$
However it appears that it is indeed a bash shell he’s entered into unless Mac 11.2 is doing something funky. Has anyone ran into this?
h
what does
echo $?
say after running
/bin/bash --version
?
h
Copy code
$ /usr/bin/env bash
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit <https://support.apple.com/kb/HT208050>.
bash-3.2$ echo $?
0
oh sorry
not exactly what you asked
one sec
Copy code
$ /bin/bash --version; echo $?
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)
Copyright (C) 2007 Free Software Foundation, Inc.
0
h
Thanks. What does
PATH=/usr/bin:/bin:/usr/local/bin which -a bash
show, followed by running that
/path/to/bash --version; echo $?
command for each of them?
h
Copy code
$ PATH=/usr/bin:/bin:/usr/local/bin which -a bash
/bin/bash
h
Okay weird. Can you please ask them to run with
--no-process-execution-cleanup-local-dirs
? Before it fails with the exit code -9, Pants should log the path to the chroot. Run
__run.sh
in it (This will remove the surface area, now we only need to do know why that particular script isn't working, vs. all of Pants)
h
gotcha
here you go:
Copy code
➜  process-executionzBlgsL  ./__run.sh
+ command -v which
+ command which -a bash
+ which -a bash
/bin/bash
➜  process-executionzBlgsL echo $?
0
Copy code
➜  process-executionzBlgsL cat __run.sh
#!/bin/bash
# This command line should execute the same process as pants did internally.
export PATH=$'/usr/bin:/bin:/usr/local/bin'
./find_binary.sh bash
➜  process-executionzBlgsL cat find_binary.sh
#!/usr/bin/env bash
set -euox pipefail
if command -v which > /dev/null; then
    command which -a $1 || true
else
    command -v $1 || true
fi
➜  process-executionzBlgsL
h
Huh. Taking a step back, in your original post, what is the full error message? The stdout and stderr parts were cut off
h
yah i’m trying to sort through the output he sent me
i think this is the main error:
Copy code
14:29:48.74 [ERROR] Exception caught: (pants.engine.internals.scheduler.ExecutionError)
  File "/Users/xiwei/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 276, in run
    engine_result = self._run_v2(goals)
  File "/Users/xiwei/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 190, in _run_v2
    return self._maybe_run_v2_body(goals, poll=False)
  File "/Users/xiwei/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 207, in _maybe_run_v2_body
    return self.graph_session.run_goal_rules(
  File "/Users/xiwei/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/init/engine_initializer.py", line 131, in run_goal_rules
    exit_code = self.scheduler_session.run_goal_rule(
  File "/Users/xiwei/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/engine/internals/scheduler.py", line 563, in run_goal_rule
    self._raise_on_error([t for _, t in throws])
  File "/Users/xiwei/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/engine/internals/scheduler.py", line 522, in _raise_on_error
    raise ExecutionError(
Exception message: 1 Exception encountered:
Engine traceback:
  in select
  in pants.core.goals.test.run_tests
  in pants.core.goals.test.enrich_test_result (api_e2e_test/tests/python/api_e2e_test/action_api_summary_test.py)
  in pants.backend.python.goals.pytest_runner.run_python_test (api_e2e_test/tests/python/api_e2e_test/action_api_summary_test.py)
  in pants.backend.python.goals.pytest_runner.setup_pytest_for_target
  in pants.backend.python.util_rules.pex.create_pex
  in pants.backend.python.util_rules.pex.find_interpreter (CPython~=3.8)
  in pants.engine.process.fallible_to_exec_result_or_raise
  in pants.engine.process.get_multi_platform_request_description
  in pants.engine.process.upcast_process
  in pants.backend.python.util_rules.pex_cli.setup_pex_cli_process
  in pants.backend.python.util_rules.pex_environment.find_pex_python
  in pants.engine.process.find_binary
  in pants.engine.process.find_binary
  in pants.engine.process.fallible_to_exec_result_or_raise
Traceback (most recent call last):
  File "/Users/xiwei/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/engine/process.py", line 255, in fallible_to_exec_result_or_raise
    raise ProcessExecutionFailure(
pants.engine.process.ProcessExecutionFailure: Process 'Searching for `bash` on PATH=/usr/bin:/bin:/usr/local/bin' failed with exit code -9.
stdout:
stderr:
Traceback (most recent call last):
  File "/Users/xiwei/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 276, in run
    engine_result = self._run_v2(goals)
  File "/Users/xiwei/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 190, in _run_v2
    return self._maybe_run_v2_body(goals, poll=False)
  File "/Users/xiwei/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 207, in _maybe_run_v2_body
    return self.graph_session.run_goal_rules(
  File "/Users/xiwei/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/init/engine_initializer.py", line 131, in run_goal_rules
    exit_code = self.scheduler_session.run_goal_rule(
  File "/Users/xiwei/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/engine/internals/scheduler.py", line 563, in run_goal_rule
    self._raise_on_error([t for _, t in throws])
  File "/Users/xiwei/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/engine/internals/scheduler.py", line 522, in _raise_on_error
    raise ExecutionError(
pants.engine.internals.scheduler.ExecutionError: 1 Exception encountered:
Engine traceback:
  in select
  in pants.core.goals.test.run_tests
  in pants.core.goals.test.enrich_test_result (api_e2e_test/tests/python/api_e2e_test/action_api_summary_test.py)
  in pants.backend.python.goals.pytest_runner.run_python_test (api_e2e_test/tests/python/api_e2e_test/action_api_summary_test.py)
  in pants.backend.python.goals.pytest_runner.setup_pytest_for_target
  in pants.backend.python.util_rules.pex.create_pex
  in pants.backend.python.util_rules.pex.find_interpreter (CPython~=3.8)
  in pants.engine.process.fallible_to_exec_result_or_raise
  in pants.engine.process.get_multi_platform_request_description
  in pants.engine.process.upcast_process
  in pants.backend.python.util_rules.pex_cli.setup_pex_cli_process
  in pants.backend.python.util_rules.pex_environment.find_pex_python
  in pants.engine.process.find_binary
  in pants.engine.process.find_binary
  in pants.engine.process.fallible_to_exec_result_or_raise
Traceback (most recent call last):
  File "/Users/xiwei/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/engine/process.py", line 255, in fallible_to_exec_result_or_raise
    raise ProcessExecutionFailure(
pants.engine.process.ProcessExecutionFailure: Process 'Searching for `bash` on PATH=/usr/bin:/bin:/usr/local/bin' failed with exit code -9.
stdout:
stderr:
an update, the developer rebooted their machine and tests started working
👀 1
some admittedly haphazard googling on my part for exit code -9 seemed to indicate that it could have been a low memory issue
😅 1
h
Huh, thank you for the update! I guess we should start asking "Have you tried restarting your computer?" 🙈
🙅 1
h
lol