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

Fix LIB env var conflicts #354

Closed
cosminlof opened this issue Sep 9, 2022 · 2 comments
Closed

Fix LIB env var conflicts #354

cosminlof opened this issue Sep 9, 2022 · 2 comments

Comments

@cosminlof
Copy link

cosminlof commented Sep 9, 2022

SUMMARY
The issue is similar to the one that was already fixed in ansible.windows (here)

ISSUE TYPE

  • Bug Report

COMPONENT NAME
win_stat

Unfortunately I don't have much access to our infra to give you the entire details as in the issue provided as a reference.

ansible-playbook 2.10.17
  config file = /opt/vsts_agent/_work/1/s/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 3.9.7 (default, Sep 13 2021, 08:18:39) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]

The pywinrm version used is 0.4.3 (which is also the latest, based on this)

Our environment
Red Hat 8.5.0 machines from where we use ansible to manage the windows boxes.
Windows 2016

The previous task, which was a win_shell, executed successfully, but then, when the win_stat task was reached we received the error from below.

The full traceback is:

(0) : Warning as Error: Invalid search path 'System.Collections.DictionaryEntry' specified in 'LIB environment variable' -- 'The system cannot find the path specified. '

(1) : using Microsoft.Win32.SafeHandles;

At line:408 char:5
+     Add-Type -TypeDefinition $link_util
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Power...peCompilerError:AddTypeCompilerError) [Add-Type], Exception
    + FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand

ScriptStackTrace:
at Load-LinkUtils, <No file>: line 408
at <ScriptBlock>, <No file>: line 76
fatal: [machine_name]: FAILED! => {
    "changed": false,
@cosminlof
Copy link
Author

@jborean93 Do you think this can also be fixed by applying the same fix as in the mentioned issue above?

@jborean93
Copy link
Collaborator

This is a question for Ansible/the collections and not pywinrm. The problem should be fixed as per the issue you've linked. Do ansible-galaxy collection list to make sure you have a new enough ansible.windows collection version as the error message shows it is still using older code before the bugfix was added (1.8.0 or newer)

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