Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Check command exited with non-zero return code: 126. #819

Open
michealroberts opened this issue Mar 12, 2024 · 1 comment
Open

[BUG] Check command exited with non-zero return code: 126. #819

michealroberts opened this issue Mar 12, 2024 · 1 comment

Comments

@michealroberts
Copy link

Check command exited with non-zero return code: 126.

Bug description

When running pyre check which has been installed via poetry, with poetry run pyre check I am getting the following error code:

Check command exited with non-zero return code: 126.

Without any other debug information.

Reproduction steps

Simply pyre init inside a project, with watchman installed with the following configuration:

poetry run pyre init

.pyre-configuraiton:

{
  "debug": true,
  "site_package_search_strategy": "pep561",
  "source_directories": [
    "./packages*",
    "./apps*"
  ]
}
poetry run pyre --noninteractive check

Expected behavior

It should run against the code, and exit safely.

Logs

2024-03-12 16:26:04,336 [PID 13083] WARNING Unrecognized configuration item: debug
2024-03-12 16:26:04,337 [PID 13083] INFO No binary specified, looking for `pyre.bin` in PATH
2024-03-12 16:26:04,337 [PID 13083] INFO Pyre binary is located at `/usr/src/app/.venv/bin/pyre.bin`
2024-03-12 16:26:04,339 [PID 13083] INFO Could not determine the number of Pyre workers from configuration. Auto-set the value to 7.
2024-03-12 16:26:04,342 [PID 13083] INFO No typeshed specified, looking for it...
2024-03-12 16:26:04,343 [PID 13083] INFO Found: `/usr/src/app/.venv/lib/pyre_check/typeshed`
2024-03-12 16:26:04,345 [PID 13083] INFO Writing arguments into /tmp/pyre_arguments_b1gd3ra6.json...
2024-03-12 16:26:04,346 [PID 13083] DEBUG Arguments:
{
  "source_paths": {
    "kind": "simple",
    "paths": [
      "/usr/src/app/packages",
      "/usr/src/app/apps"
    ]
  },
  "search_paths": [
    "/usr/src/app/.venv/lib/python3.12/site-packages$packaging",
    "/usr/src/app/.venv/lib/python3.12/site-packages$libcst",
    "/usr/src/app/.venv/lib/python3.12/site-packages$marshmallow",
    "/usr/src/app/.venv/lib/python3.12/site-packages$platformdirs",
    "/usr/src/app/.venv/lib/python3.12/site-packages$pip",
    "/usr/src/app/.venv/lib/python3.12/site-packages$testslide",
    "/usr/src/app/.venv/lib/python3.12/site-packages$identify",
    "/usr/src/app/.venv/lib/python3.12/site-packages$filelock",
    "/usr/src/app/.venv/lib/python3.12/site-packages$click",
    "/usr/src/app/.venv/lib/python3.12/site-packages$dataclasses_json",
    "/usr/src/app/.venv/lib/python3.12/site-packages$typeguard",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stdlib",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/D3DShot",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/DateTimeRange",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/Deprecated",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/ExifRead",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/Flask-Cors",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/Flask-Migrate",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/Flask-SQLAlchemy",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/JACK-Client",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/Markdown",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/Pillow",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/PyAutoGUI",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/PyMySQL",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/PyScreeze",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/PyYAML",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/Pygments",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/SQLAlchemy",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/Send2Trash",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/aiofiles",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/annoy",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/appdirs",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/aws-xray-sdk",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/babel",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/backports.ssl_match_hostname",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/beautifulsoup4",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/bleach",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/boto",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/braintree",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/cachetools",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/caldav",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/cffi",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/chardet",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/chevron",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/click-spinner",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/colorama",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/commonmark",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/console-menu",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/contextvars",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/croniter",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/dateparser",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/decorator",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/dj-database-url",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/dockerfile-parse",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/docopt",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/docutils",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/editdistance",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/emoji",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/entrypoints",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/first",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/flake8-2020",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/flake8-bugbear",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/flake8-builtins",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/flake8-docstrings",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/flake8-plugin-utils",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/flake8-rst-docstrings",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/flake8-simplify",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/flake8-typing-imports",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/fpdf2",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/gdb",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/google-cloud-ndb",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/hdbcli",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/html5lib",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/httplib2",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/humanfriendly",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/ibm-db",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/influxdb-client",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/invoke",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/jmespath",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/jsonschema",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/keyboard",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/ldap3",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/mock",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/mypy-extensions",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/mysqlclient",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/netaddr",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/oauthlib",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/openpyxl",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/opentracing",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/paho-mqtt",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/paramiko",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/parsimonious",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/passlib",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/passpy",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/peewee",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pep8-naming",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pika",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/playsound",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/polib",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/prettytable",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/protobuf",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/psutil",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/psycopg2",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pyOpenSSL",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pyRFC3339",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pyasn1",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pyaudio",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pycocotools",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pycurl",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pyfarmhash",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pyflakes",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pyinstaller",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pynput",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pyserial",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pysftp",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pytest-lazy-fixture",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/python-crontab",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/python-datemath",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/python-dateutil",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/python-gflags",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/python-jose",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/python-nmap",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/python-slugify",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/python-xlib",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pytz",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pyvmomi",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/pywin32",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/redis",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/regex",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/requests",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/retry",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/setuptools",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/simplejson",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/singledispatch",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/six",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/slumber",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/stdlib-list",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/stripe",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/tabulate",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/tensorflow",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/termcolor",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/toml",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/toposort",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/tqdm",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/tree-sitter",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/tree-sitter-languages",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/ttkthemes",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/typed-ast",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/tzlocal",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/ujson",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/untangle",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/urllib3",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/vobject",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/waitress",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/whatthepatch",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/xmltodict",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/xxhash",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/zstd",
    "/usr/src/app/.venv/lib/pyre_check/typeshed/stubs/zxcvbn"
  ],
  "excludes": [],
  "checked_directory_allowlist": [
    "/usr/src/app/packages",
    "/usr/src/app/apps"
  ],
  "checked_directory_blocklist": [],
  "extensions": [],
  "log_path": "/usr/src/app/.pyre",
  "global_root": "/usr/src/app",
  "debug": false,
  "python_version": {
    "major": 3,
    "minor": 12,
    "micro": 2
  },
  "shared_memory": {},
  "parallel": true,
  "number_of_workers": 7,
  "additional_logging_sections": [
    "-progress"
  ],
  "show_error_traces": false,
  "strict": false
}
2024-03-12 16:26:04,352 [PID 13083] ERROR Check command exited with non-zero return code: 126.

pyre rage > pyre_rage.log, Output:

pyre_rage.log

Additional context

All I can say is I have a minimal python project inside a container, setup with poetry, and pyre and pysa do not work. Both exit with code 126 with no other output.

Is there a verbose mode where I can check further logs?

@ebrahimsofi123
Copy link

Hi Michael,
Thank you for bringing up this issue.
Looking at the problem that you stated which said that "Check command exited with non-zero return code: 126," generally indicates an issue with permissions or an inability to execute a binary. When I look at the issue that you are facing, i see some steps that can be taken to rectify the problem namely:

  1. Check the executable permissions : As you are using a pyre in a container, there can be instances where the permissions can get mixed up. set the executable permission on the Pyre binary using "chmod +x /usr/src/app/.venv/bin/pyre.bin'

  2. Based on the logs you provided, Pyre seems to ignore the "debug" flag set in the configuration file. You can enforce verbose output directly via the command line to get a little bit more details on the log. Try to modify the pyre command in the following way "poetry run pyre --noninteractive --debug check"

  3. Try simplifying your .pyre-configuration temporarily to see if a particular configuration is causing the issue. Something like {
    "source_directories": ["."]
    }

  4. Try running pyre outside of poetry to isolate the issue. source /usr/src/app/.venv/bin/activate
    pyre check

I beilieve that going through these debugging steps, you might be able to figure out the reason why you are facing the error in line 126. I hope this helps :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants