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

[Flaky Test]: TestRepeatedInstallUninstall – failed to set user elastic-agent-user password for service #4891

Open
rdner opened this issue Jun 10, 2024 · 8 comments
Labels
flaky-test Unstable or unreliable test cases. Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@rdner
Copy link
Member

rdner commented Jun 10, 2024

Failing test case

TestRepeatedInstallUninstall

Error message

Error: error installing package: error getting service installation options: failed to set user elastic-agent-user password for service: call to NetUserSetInfo failed: status=2245 error=4294967295

Build

https://buildkite.com/elastic/elastic-agent-extended-testing/builds/462#018ff4a0-ecda-424d-8dd8-6e7c41840e5f

OS

Windows

Stacktrace and notes

=   ] Installing service  [4s] 
                                       

[=   ] Failed to install service  [4s] Error uninstalling. Printing logs
        Error: error installing package: error getting service installation options: failed to set user elastic-agent-user password for service: call to NetUserSetInfo failed: status=2245 error=4294967295
        For help, please see our troubleshooting guide at https://www.elastic.co/guide/en/fleet/8.15/fleet-troubleshooting.html
    install_test.go:195: 
        	Error Trace:	C:/Users/windows/agent/testing/integration/install_test.go:195
        	Error:      	Received unexpected error:
        	            	error running agent install command: exit status 1
        	Test:       	TestRepeatedInstallUninstall/TestRepeatedInstallUninstall-37
--- FAIL: TestRepeatedInstallUninstall/TestRepeatedInstallUninstall-37 (12.49s)
@rdner rdner added Team:Elastic-Agent Label for the Agent team flaky-test Unstable or unreliable test cases. labels Jun 10, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@cmacknz
Copy link
Member

cmacknz commented Jun 10, 2024

#4686 (comment)

https://learn.microsoft.com/en-us/troubleshoot/windows-server/remote/terminal-server-error-messages-2200-to-2299#error-2245

Error 2245
The password is shorter than required.

Explanation: The password you specified isn't long enough.

Action: Use a longer password. See your network administrator to find the required length for passwords on your system.

Error 4294967295 is a weird one though, that's the max value of a uint32 (0xffffffff)

CC @blakerouse

@blakerouse
Copy link
Contributor

I don't understand how the password could not be long enough, its set to 127 characters long and cannot be any other size.

@leehinman
Copy link
Contributor

I don't understand how the password could not be long enough, its set to 127 characters long and cannot be any other size.

Is there any way that the characters used could be interpreted as NULL or some kind of terminator, so that when the Windows NetUserSetInfo takes the string it "sees" it as being too short?

@blakerouse
Copy link
Contributor

@leehinman Nothing stands out to me, unless Windows doesn't like one of those special characters? Look here and let me know if anything stands out to you.

https://github.com/elastic/elastic-agent/blob/main/internal/pkg/agent/install/user_windows.go#L222-L234

@leehinman
Copy link
Contributor

@leehinman Nothing stands out to me, unless Windows doesn't like one of those special characters? Look here and let me know if anything stands out to you.

Nothing leaps out, but we do convert the string to a UTF16 pointer. I don't know how that would cause problems, all those characters should map cleanly and not get into the surrogate halves. I'm just trying to come up with "something" that might account for the password appearing shorter than the length of the array.

For the short term, what about changing the error message so we dump the string password and the array pointed to by the UTF16 pointer? If nothing else that should give us the input that causes the problem.

@ycombinator ycombinator added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Jun 12, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@rdner
Copy link
Member Author

rdner commented Jun 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-test Unstable or unreliable test cases. Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

No branches or pull requests

6 participants