Troubleshoot a Remote Repository Configuration
Troubleshoot remote repositories in Cortex XSOAR 6.13.
You can troubleshoot the following issues:
FAQs
Troubleshoot a Remote Repository Definition
The following instructions describe how to troubleshoot when defining a remote repository.
dial TCP Error Message
If a **dial tcp...**error message appears when defining your remote repository and loading the list of repository branches, contact your system administrator to enable connectivity. This may occur due to connectivity issues, such as a closed port or a proxy that is not enabling the connection.
Invalid HTTP/SSH URL Error
If an Invalid SSH URL error label appears when defining your remote repository and entering the Repository URL, ensure the URL ends with `.git` such as `ssh://git@content.demisto.com:20017/~/my-project.git`.
Permission Denied Error
If a permission denied error occurs when attempting to fetch the repository branches:
Ensure you have set the correct passphrase and are using the correct key type.
Navigate to the directory in which you saved the private key file.
Open the private key file in a text editor and verify that the file begins with
-----BEGIN RSA PRIVATE KEY-----.If the file does not begin with this text, regenerate the private key and add the -m pem flag. For example:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com" -m pem(This is because Cortex XSOAR currently supports only RSA PRIVATE KEY.)
If the key and permissions are confirmed as correct and you still get a permission denied error:
Stop the server.
Delete all git-cached folders under /var/lib/demisto/temp/cached_git_repositories
Restart the server.
Internal Server Error
If the internal server error. Something went wrong. error message appears when attempting to fetch the repository branches:
In the server log files, search for
Host keyverification failederror message.Connect to the server by SSH.
Run the following command:
ssh-agent bash -c "ssh-add PATH/TO/PRIVATE/KEY; git clone GIT_SSH_URL"For example:
ssh-agent bash -c "ssh-add ~/.ssh/my_id_rsa; git clone ssh://git@ssh.github.com:443/myusername/myreponame.git"Copy the file
~/.ssh/known_hosts to /var/lib/demisto/.
Troubleshoot Editing and Pushing Content
The following instructions describe how to troubleshoot when editing and pushing your content to the remote repository.
Invalid Signatures When Committing
When you push your content to the remote repository, you might receive the following error message: Error: Commits musthave valid signatures.
This occurs when your Git server configuration requires that every commit must have a signature.
Connect to the remote repository server using SSH.
Run the following commands:
git--global config user.signingKey KEYIDwhere KEYID is your key ID.git --global config commit.gpgSign true
GIT Version Out-of-Date
When you push your content to the remote repository, you might receive the following error message: error GIT: failedexecuting [rebase [--exec=git log --max-count=1 --pretty=format:%H;printf'>';grep -o "\w\{40\}" .git/rebase-merge/done | tail -n 1 --strategyrecursive --strategy-option theirs --onto stag --root stag_workspace]]
This occurs when you have an outdated Git version on your server. You must have at least version 2.21.0.
To update your Git version:
Export the custom content by going to Settings → About → Troubleshooting → Custom content → Export.
This exports the state of the current content.
Turn off the remote repository feature on the dev server.
On your server, either download and install an updated RPM package of the Git client, or run the Demsito installer again.
Turn on the remote repository feature on the dev server.
Import the previously exported content.
This restores the local content.
Troubleshoot Content Issues
The following instructions describe how to troubleshoot issues with your content.
Missing Content
After enabling the remote repository feature or updating content, some content is missing. To resolve this issue, restore the content backup package that was created when you enabled the feature or updated content.
Copy the content package from the server to your local machine using the
scpcommand.The backup is located at
/var/lib/demisto/backup/content-backup-*In Cortex XSOAR, navigate to Settings → About → Troubleshooting → Custom content → Import and upload the content package.
Missing Content History
When using characters that are not UTF-8, the version history is not available.
Connect to the environment on which you are experiencing the issue using SSH.
Run the following
git config --global core.quotepath offcommand.
Repository Connection Error
When attempting to commit content to the remote repository, the following error appears:
Another git process seems to be running in this repository, e.g.an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git processmay have crashed in this repository earlier:remove the file manually to continue.) 2020-09-15 15:34:15.9433 error VC: failed to add objects files 'automation-GetMLModelEvaluation.yml, automation-DBotMLFetchData.yml, automation-DBotBuildPhishingClassifier.yml, automation-DBotPreProcessTextData.yml, automation-SanePdfReports.yml, automation-CommonServerPowerShell.yml, automation-GetIndicatorsByQuery.yml, automation-GetIncidentsByQuery.yml, automation-SaneDocReports.yml, automation-DBotSuggestClassifierMapping.yml, automation-DBotTrainTextClassifierV2.yml' to index (source: /home/circleci/.go_workspace/src/github.com/demisto/server/util/versioncontrol/versioncontrol.go:1631)(error: exit status 128fatal: Unable to create '/var/lib/demisto/versionControlRepo/.git/index.lock': File exists.
This can occur if the server was stopped during git execution.
Delete the index.lock file located in the /var/lib/demisto/versionControlRepo/.git/ directory to solve the issue.
Content Installation Error
When installing content from the content repo, a message similar to the following appears:
Could not create incidenttype with ID 'Phishing' and name 'Phishing'. Version (oldVersionNumber) is not compatible with environment version (versionNumber) [Content Pack: <contentPackName>] (100018)]
Note
Before implementing the following solution, ensure that the content item from the error message is not detached. If the item is detached, after you re-attach it, the change will show up in the local changes under items and not packs.
In your development environment, upgrade the relevant content pack, or re-install the content pack from Marketplace → Installed content packs → Version history.
Push the content pack that was updated as well as the relevant items from the Items tab in local changes in the development environment.
In your production environment, pull your content.
Troubleshoot a Remote Repository with an HTTP Proxy
The following commands enable you to troubleshoot issues that might occur when using a remote repository with an HTTP or HTTPS proxy. To use a remote repository with an HTTP or HTTPS proxy, the proxy must be defined in the git system configuration.
Show all configurations
git config --list --system
If you see the error fatal: unable to read config file '/etc/gitconfig': No such file or directory, this means there is no git system configuration file.
Verify if there is a proxy defined in the git system configuration
git config --system --get-regexp "http.*"
Define a proxy and also create the git system configuration file, if needed
sudo git config --system http.proxy http://my-proxy-ip
sudo git config --system https.proxy http://my-proxy-ip
Configure the proxy authentication method to Basic
git config --system https.proxyAuthMethod basic
git config --system http.proxyAuthMethod basic
If your proxy uses Basic authentication, you may need to run these commands to instruct git to use the Basic authentication method when connecting to the proxy.
Disable the Cortex XSOAR git
sudo mv /usr/local/demisto/git /usr/local/demisto/git_copy.
After verifying that the proxy is defined in the git system configuration, if there are still issues with the remote repository, confirm which git is used by Cortex XSOAR. Cortex XSOAR provides its own git, but can also use the operating system git. To force Cortex XSOAR to work with the operating system git, you must disable the Cortex XSOAR git.
Confirm git version
git version.
The git version must be at least 2.21.0.
Last updated
Was this helpful?
