gjanders / SplunkVersionControl

Version Control application for Splunk
Apache License 2.0
30 stars 10 forks source link

Cannot Connect to Git #27

Closed squared-aweigh closed 2 years ago

squared-aweigh commented 2 years ago

I am getting the below error when attempting to Add Data for splunkversioncontrol-backup modular input:
Screen Shot 2022-08-18 at 4 12 47 PM

I have attempted with several different repos on both github and bitbucket, error is the same. Output of splunkversioncontrol_backup.log:

Screen Shot 2022-08-18 at 4 33 55 PM

When I run the <git ls-remote .> command from the server the app is on, output is what you would expect:

Screen Shot 2022-08-18 at 4 38 01 PM

I also viewed network traffic using tcpdump, and when attempting to save the Data Input, where this validation occurs, there is no network request to the remote repository when receiving this error, so the issue is something with my configuration on the server, I think...

I would so greatly appreciate any thoughts on resolving this issue!

gjanders commented 2 years ago

I suspect there is something in the shell profile that might help it work on the command line.

I assume you tested as the user running splunk?

I think I just need to write some python that just runs this command, I just need to find some time.

gjanders commented 2 years ago

Ok so I built a quick test command: https://github.com/gjanders/SplunkVersionControl/blob/testing/bin/test_git.py

If you are in $SPLUNK_HOME/etc/apps/ you should be able to run: splunk cmd python SplunkVersionControl/bin/test_git.py -gitRepoURL "git@github..."

With the repo URL you are using...and let me know what that shows

squared-aweigh commented 2 years ago

Sorry it took me so long to get back to you and respond! I really appreciate you taking the time to look at this and help! Here's the whole output: Screen Shot 2022-08-25 at 4 13 30 PM

The part that matters I /think/ is:

git ls-remote ssh://git@bitbucket.dwolla.net:7999/splun/splunk_backup.git results in stdout: '', stderrout: 'ssh: /opt/splunk/lib/libcrypto.so.1.0.0: versionOPENSSL_1.0.1' not found (required by ssh) ssh: /opt/splunk/lib/libcrypto.so.1.0.0: version OPENSSL_1.0.0' not found (required by ssh)

This is interesting that it has issue with OPENSSL version, as I am able to access the repo using SSH with the user running Splunk (and all other users on the vm running Splunk).

Here's the current OpenSSL version:

Screen Shot 2022-08-25 at 4 16 32 PM
squared-aweigh commented 2 years ago

I found in the README that this issue has been addressed previously. Thanks again for the help! I'm using Ubuntu, so had the issue with OPENSSL and had to add the line to in python scripts to unset LD_LIBRARY_PATH

gjanders commented 2 years ago

Thanks for solving it.

I had planned to try a python git library but I haven't found time to rewrite the code