-
Notifications
You must be signed in to change notification settings - Fork 167
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
win_service - Cannot find an overload for "ToString" and the argument count: "0". #125
Comments
Spent some time looking at this and I'm not sure, but I think the Current code:
Modified (potential fix):
|
@cruscio I'm not the most familiar with this code but the fix looks sound. Why not put in a PR? Even if you can't run the tests locally, they will be run via the PR so that should help. I'd recommend trying to add a test to catch this before committing the fix, to see if you can get a test executing that properly catches the condition, then hopefully you'll see that test pass after adding the fix to the PR |
I can't remember why I had it converting to a string, maybe it was just the line length. But your changes seem sound so happy to accept a PR with them and get them merged in. |
I was only able to replicate this issue when running against WMF 5.0 and seems like a bonafide bug with PowerShell itself at that version. A quick reproducer of this bug is the following [IO.FileAttributes]$a = 'Archive'
([IO.FileAttributes]$a).ToString() There seems to be a problem trying to group a cast to an enum type then call |
SUMMARY
win_service failures trying to stop and remove a service.
The below error happened on 41 of the first 1500 servers I ran the playbook against.
I reran it on just those servers and it kept happening.
The issue is infrequent, but consistent.
ISSUE TYPE
COMPONENT NAME
ansible.windows.win_service
module file /usr/local/lib/python3.6/site-packages/ansible_collections/ansible/windows/plugins/modules/win_service.ps1
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Target:
STEPS TO REPRODUCE
Run a playbook with a single task to remove the SaltStack minion service
EXPECTED RESULTS
On this server, the named service existed and was running.
The win_service task should have stop the service, removed it, and reported a change
ACTUAL RESULTS
Task failed
The text was updated successfully, but these errors were encountered: