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] Relenv OneDir Salt fails to start #64897

Closed
twangboy opened this issue Aug 1, 2023 · 0 comments
Closed

[BUG] Relenv OneDir Salt fails to start #64897

twangboy opened this issue Aug 1, 2023 · 0 comments
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Windows

Comments

@twangboy
Copy link
Contributor

twangboy commented Aug 1, 2023

Description
On some machines, PythonNet fails to load. This is presented in Salt by unzipping a Relenv OneDir build and then running .\salt-call.exe --version. You will see the following stacktrace:

PS C:\Temp\salt> .\salt-call.exe --version
Traceback (most recent call last):
  File "C:\Temp\salt\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Temp\salt\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Temp\salt\salt-call.exe\__main__.py", line 7, in <module>
  File "C:\Temp\salt\lib\site-packages\salt\scripts.py", line 438, in salt_call
    import salt.cli.call
  File "C:\Temp\salt\lib\site-packages\salt\cli\call.py", line 3, in <module>
    import salt.cli.caller
  File "C:\Temp\salt\lib\site-packages\salt\cli\caller.py", line 12, in <module>
    import salt.channel.client
  File "C:\Temp\salt\lib\site-packages\salt\channel\client.py", line 13, in <module>
    import salt.crypt
  File "C:\Temp\salt\lib\site-packages\salt\crypt.py", line 26, in <module>
    import salt.payload
  File "C:\Temp\salt\lib\site-packages\salt\payload.py", line 12, in <module>
    import salt.loader.context
  File "C:\Temp\salt\lib\site-packages\salt\loader\__init__.py", line 15, in <module>
    import salt.config
  File "C:\Temp\salt\lib\site-packages\salt\config\__init__.py", line 22, in <module>
    import salt.utils.network
  File "C:\Temp\salt\lib\site-packages\salt\utils\network.py", line 32, in <module>
    import salt.utils.win_network
  File "C:\Temp\salt\lib\site-packages\salt\utils\win_network.py", line 56, in <module>
    import clr
  File "C:\Temp\salt\lib\site-packages\clr.py", line 6, in <module>
    load()
  File "C:\Temp\salt\lib\site-packages\pythonnet\__init__.py", line 143, in load
    if func(b"") != 0:
  File "C:\Temp\salt\lib\site-packages\clr_loader\types.py", line 64, in __call__
    return self._callable(ffi.cast("void*", buf_arr), len(buf_arr))
RuntimeError: cannot call null pointer pointer from cdata 'int(*)(void *, int)'

You can also see a simpler stack trace by starting the Python from the OneDir build and trying to import clr:

PS C:\Temp\salt> .\Scripts\python.exe
Python 3.10.11 (heads/main:408ea86, May  5 2023, 02:40:17) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import clr
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Temp\salt\lib\site-packages\clr.py", line 6, in <module>
    load()
  File "C:\Temp\salt\lib\site-packages\pythonnet\__init__.py", line 143, in load
    if func(b"") != 0:
  File "C:\Temp\salt\lib\site-packages\clr_loader\types.py", line 64, in __call__
    return self._callable(ffi.cast("void*", buf_arr), len(buf_arr))
RuntimeError: cannot call null pointer pointer from cdata 'int(*)(void *, int)'
@twangboy twangboy added Bug broken, incorrect, or confusing behavior needs-triage Windows Confirmed Salt engineer has confirmed bug/feature - often including a MCVE and removed needs-triage labels Aug 1, 2023
@twangboy twangboy added this to the Sulfur v3006.2 milestone Aug 1, 2023
@twangboy twangboy closed this as completed Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Windows
Projects
None yet
Development

No branches or pull requests

1 participant