You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Path for lint: /Users/beno/.pyenv/shims/ansible-lint
Validating using ansible-lint
[ansible-lint] ERROR: Ansible requires the locale encoding to be UTF-8; Detected None.
Traceback (most recent call last):
File "/Users/beno/.pyenv/versions/pypy3.10-7.3.17/bin/ansible-lint", line 8, in <module>
sys.exit(_run_cli_entrypoint())
^^^^^^^^^^^^^^^^^^^^^
File "/Users/beno/.pyenv/versions/pypy3.10-7.3.17/lib/pypy3.10/site-packages/ansiblelint/__main__.py", line 400, in _run_cli_entrypoint
sys.exit(main(sys.argv))
^^^^^^^^^^^^^^
File "/Users/beno/.pyenv/versions/pypy3.10-7.3.17/lib/pypy3.10/site-packages/ansiblelint/__main__.py", line 336, in main
app = get_app(
File "/Users/beno/.pyenv/versions/pypy3.10-7.3.17/lib/pypy3.10/site-packages/ansiblelint/app.py", line 405, in get_app
app = App(options=options)
^^^^^^^^^^^^^^^^^^^^
File "/Users/beno/.pyenv/versions/pypy3.10-7.3.17/lib/pypy3.10/site-packages/ansiblelint/app.py", line 51, in __init__
self.runtime = Runtime(
File "/Users/beno/.pyenv/versions/pypy3.10-7.3.17/lib/pypy3.10/site-packages/ansible_compat/runtime.py", line 213, in __init__
self.config = AnsibleConfig(cache_dir=self.cache_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/beno/.pyenv/versions/pypy3.10-7.3.17/lib/pypy3.10/site-packages/ansible_compat/config.py", line 416, in __init__
config_dump = subprocess.check_output( # noqa: S603
File "/Users/beno/.pyenv/versions/pypy3.10-7.3.17/lib/pypy3.10/subprocess.py", line 421, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/Users/beno/.pyenv/versions/pypy3.10-7.3.17/lib/pypy3.10/subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ansible-config', 'dump']' returned non-zero exit status 1.
I don't understand where the problem lays, because launching Zed via logged in terminal session (both zed and open /Applications/Zed.app commands) does not cause this issue. Launching Zed not from logged in zsh session does cause the problem.
In both cases (launch it from shell or not), I do get the same log in Zed about set environment variables from shell:/bin/zsh, path:... and using project environment variables shell launched in "...", and both logged envs are 1:1 same - I'm lost, because if captured env are identical, why ansible-language-server performs like they are not?
open any project from repo via zed ./ansible-examples - works as intended 👍
open Zed via app icon and proceed to the same project - works as intended 👍
The part of ansible-compat==24.10.0 python code that triggers fail is https://github.com/ansible/ansible-compat/blob/ba624e9511a76f29fd12cff3e01feef1458d3acf/src/ansible_compat/config.py#L416, it doesn't look like there is any code that may fail like this.
Setting "lsp.ansible-language-server.settings.validation.lint.path": "LC_ALL=en_US.UTF-8 ansible-lint" in global Zed config fixes the issue for me; there appears to be another following env issue (actually of same kind) when hovering over any part of Ansible YAML code in the editor window, and it can't be fixed with plugin settings:
Command failed: ansible-config dump
ERROR: Ansible requires the locale encoding to be UTF-8; Detected None.
I don't know for sure if there's a problem with Zed specifically, or with pypy and it's env propagation, but they seem to work bad together. Is there anything I miss or doing incorrect?
Check for existing issues
Describe the bug / provide steps to reproduce it
Using ansible-language-server
v0.1.0
in Zed0.168.2
and getting this error:I don't understand where the problem lays, because launching Zed via logged in terminal session (both
zed
andopen /Applications/Zed.app
commands) does not cause this issue. Launching Zed not from logged in zsh session does cause the problem.In both cases (launch it from shell or not), I do get the same log in Zed about
set environment variables from shell:/bin/zsh, path:...
andusing project environment variables shell launched in "..."
, and both logged envs are 1:1 same - I'm lost, because if captured env are identical, whyansible-language-server
performs like they are not?Steps to reproduce:
curl -fsSL https://pyenv.run | bash
https://github.com/pyenv/pyenv?tab=readme-ov-file#linuxunix.zshrc
or .zprofile
https://github.com/pyenv/pyenv?tab=readme-ov-file#zsh:pyenv install pypy3.10-7.3.17
, performpyenv global pypy3.10-7.3.17
and installpip3 install ansible ansible-lint jmespath
python3 --version
ansible --version
ansible-language-server
extension to Zedgit clone https://github.com/ansible/ansible-examples.git
zed ./ansible-examples
- works as intended 👍Also, noticed that everything works fine with python
3.10.14
:pyenv install 3.10.14
, performpyenv global 3.10.14
and installpip3 install ansible ansible-lint jmespath
python3 --version
ansible --version
zed ./ansible-examples
- works as intended 👍The part of
ansible-compat==24.10.0
python code that triggers fail is https://github.com/ansible/ansible-compat/blob/ba624e9511a76f29fd12cff3e01feef1458d3acf/src/ansible_compat/config.py#L416, it doesn't look like there is any code that may fail like this.Setting
"lsp.ansible-language-server.settings.validation.lint.path": "LC_ALL=en_US.UTF-8 ansible-lint"
in global Zed config fixes the issue for me; there appears to be another following env issue (actually of same kind) when hovering over any part of Ansible YAML code in the editor window, and it can't be fixed with plugin settings:I don't know for sure if there's a problem with Zed specifically, or with
pypy
and it's env propagation, but they seem to work bad together. Is there anything I miss or doing incorrect?My
locale
output:Zed Version and System Specs
Zed: v0.168.2 (Zed)
OS: macOS 15.2.0
Memory: 48 GiB
Architecture: aarch64
If applicable, add screenshots or screencasts of the incorrect state / behavior
No response
If applicable, attach your Zed.log file to this issue.
Zed.log
The text was updated successfully, but these errors were encountered: