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

Ansible failed to complete successfully. Build Error on WSL2 #1017

Open
jano247106 opened this issue Dec 9, 2024 · 7 comments
Open

Ansible failed to complete successfully. Build Error on WSL2 #1017

jano247106 opened this issue Dec 9, 2024 · 7 comments
Assignees

Comments

@jano247106
Copy link

jano247106 commented Dec 9, 2024

Hello,

I had encountered this error when trying to build. The machine is WSL2 on Windows 11.
I had tried this https://medium.com/@chengreid/building-splunk-attack-range-v3-0-on-wsl2-fedcfed93a6c manual for installation and build on WSL2.

RUNNING HANDLER [splunk_server : restart splunk] *******************************
fatal: [ar-splunk-attack-range-key-pair-ar]: FAILED! => {"changed": false, "msg": "Unable to restart service splunk: Job for splunk.service failed because a timeout was exceeded.\nSee \"systemctl status splunk.service\" and \"journalctl -xe\" for details.\n"}

PLAY RECAP *********************************************************************
ar-splunk-attack-range-key-pair-ar : ok=194  changed=99   unreachable=0    failed=1    skipped=13   rescued=0    ignored=0

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
2024-12-09 13:18:28,783 - ERROR - attack_range - vagrant failed to build

and

TASK [splunk_server : accept license and start splunk] *************************
fatal: [ar-splunk-attack-range-key-pair-ar]: FAILED! => {"changed": true, "cmd": "/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt --seed-passwd Pl3ase-k1Ll-me:p", "delta": "0:00:41.427606", "end": "2024-12-09 12:34:57.945436", "msg": "non-zero return code", "rc": 1, "start": "2024-12-09 12:34:16.517830", "stderr": "\n-- Migration information is being logged to '/opt/splunk/var/log/splunk/migration.log.2024-12-09.12-34-16' --\nCopying '/opt/splunk/etc/myinstall/splunkd.xml' to '/opt/splunk/etc/myinstall/splunkd.xml-migrate.bak'.\n\nHandling deprecated files...
.
. 
.
Splunk's installer will automatically", "update and alter your current configuration files. Deprecated configuration", "files will be renamed with a .deprecated extension.", "", "You can choose to preview the changes that will be made to your configuration", "files before proceeding with the migration and upgrade:", "", "If you want to migrate and upgrade without previewing the changes that will be", "made to your existing configuration files, choose 'y'.", "If you want to see what changes will be made before you proceed with the", "upgrade, choose 'n'.", "", "", "Perform migration and upgrade without previewing configuration changes? [y/n] y", "", "Migrating to:", "VERSION=9.3.0", "BUILD=51ccf43db5bd", "PRODUCT=splunk", "PLATFORM=Linux-x86_64", "", "", "ERROR: In order to migrate, Splunkd must not be running."]}

PLAY RECAP *********************************************************************
ar-splunk-attack-range-key-pair-ar : ok=13   changed=4    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0


Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
2024-12-09 13:35:00,968 - ERROR - attack_range - vagrant failed to build

Thank you for your help.

@P4T12ICK P4T12ICK self-assigned this Dec 9, 2024
@P4T12ICK
Copy link
Collaborator

P4T12ICK commented Dec 9, 2024

Can you please make sure that you have the latest version and please try it again. I did some development today with Windows 11 and WSL and didn't experience this issue.

@jano247106
Copy link
Author

jano247106 commented Dec 9, 2024

Hello, so I updated to the new version and after waiting for two hours new error occured:

    ar-win-attack-range-key-pair-ar-0: WinRM transport: plaintext
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
2024-12-09 16:40:54,541 - ERROR - attack_range - vagrant failed to build

In VirtualBox I have two machines running: ar-splunk and ar-win-dc, which I didn't have with the first error.

@jano247106
Copy link
Author

jano247106 commented Dec 9, 2024

Also, now I tried to build it again without destroying, I've got the first error again.

EDIT: Tried it 2 more times. Everytime it's problem Ansible failed to complete successfully error.

@P4T12ICK
Copy link
Collaborator

You always need to destroy before trying to build it again especially when it failed. Try to destroy and build it again.

@jano247106
Copy link
Author

You always need to destroy before trying to build it again especially when it failed. Try to destroy and build it again.

Yes, I did destroy it after some tries but it didn't help.

@jano247106
Copy link
Author

jano247106 commented Dec 10, 2024

Probably like 7th attempt, I tried to reinstall it and all. I got this

TASK [phantom : Change mirror to vault.centos.org] *****************************
[WARNING]: No python interpreters found for host ar-phantom-attack-range-key-
pair-ar (tried ['python3.12', 'python3.11', 'python3.10', 'python3.9',
'python3.8', 'python3.7', '/usr/bin/python3', 'python3'])
fatal: [ar-phantom-attack-range-key-pair-ar]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "module_stderr": "Shared connection to 172.19.112.1 closed.\r\n", "module_stdout": "/bin/sh: /usr/bin/python3: No such file or directory\r\n", "msg": "The module failed to execute correctly, you probably need to set the interpreter.\nSee stdout/stderr for the exact error", "rc": 127}

PLAY RECAP *********************************************************************
ar-phantom-attack-range-key-pair-ar : ok=1    changed=0    unreachable=0    failed=1    skipped=2    rescued=0    ignored=0

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
2024-12-10 09:59:42,214 - ERROR - attack_range - vagrant failed to build

Edit: Tried it 3 times, still same.

@jano247106
Copy link
Author

After 3 days, still didn't build successfuly. But at least I got new errors.

RUNNING HANDLER [splunk_server : restart splunk] *******************************
fatal: [ar-splunk-attack-range-key-pair-ar]: FAILED! => {"changed": false, "msg": "Unable to restart service splunk: Job for splunk.service failed because a timeout was exceeded.\nSee \"systemctl status splunk.service\" and \"journalctl -xe\" for details.\n"}

PLAY RECAP *********************************************************************
ar-splunk-attack-range-key-pair-ar : ok=196  changed=100  unreachable=0    failed=1    skipped=13   rescued=0    ignored=0

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
2024-12-11 23:04:06,982 - ERROR - attack_range - vagrant failed to build

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