Timeout when trying to veriry connection to Github Repo on RasaX

Hello Rasa community,

I have installed RasaX using the docker-compose quick install option. However, when trying to setup the connection to my bot Github repository, I’m getting an error after clicking the Verify Connection button. By looking at the logs, I found the following Timeout error:

rasa-x_1           | /usr/local/lib/python3.6/site-packages/rasax/community/services/integrated_version_control/git_service.py:824: UserWarning: An error happened when trying to access 'git@github.com:santteegt/glpi_chatbot.git'. It seems you don't have to correct permissions for this repository. Please check if your credentials are correct and you have write permissions in the given repository. The error was: Cmd('git') failed due to: exit code(128)
rasa-x_1           |   cmdline: git clone --depth=1 -v git@github.com:santteegt/glpi_chatbot.git /tmp/tmp7gkor08g
rasa-x_1           |   stderr: 'Cloning into '/tmp/tmp7gkor08g'...
rasa-x_1           | ssh: connect to host github.com port 22: Connection timed out
rasa-x_1           | fatal: Could not read from remote repository.
rasa-x_1           | 
rasa-x_1           | Please make sure you have the correct access rights
rasa-x_1           | and the repository exists.
rasa-x_1           | '.
rasa-x_1           |   f"An error happened when trying to access '{repository_url}'. It seems "

This is a known issue when trying to clone Github repos using SSH. Here’s a recipe on how to avoid this problem. You just need to setup a Host Alias on the ssh config file to enforce the git command to connect to the 443 port. However, after configuring this on the rasa/rasa-x container (/root/.ssh/config), I’m still having the same issue. It looks like the process within the container is run by the rasa user so it can’t reach/use the config file I setup in the /root directory.

Any thoughts on how can I solve this issue?

Thanks for your help

When you added your SSH key to the git repo, I suspect you forgot to click the box to Allow Write Access.

That’s not the case. I have setup my deployment key as required. This is more related to firewall policy issues. That’s why an extra configuration on the SSH config file is required.

I don’t think it’s possible at the moment.

Rasa X doesn’t allow you to specify any additional SSH configuration, which means it always calls ssh with the default command-line options.

I think that this configuration just need to be added to the ~.ssh/config file of the exact OS user running the process. Then, doing the git clone with ssh is the same

Hi @alwx,

Finally found a solution for this. Within the rasa-x container I added the following changes:

  1. Added an ssh config file in /app/.ssh/config with the following:

    Host github.com
      Hostname ssh.github.com
      Port 443
  2. Added -F /app/.ssh/config as parameter on the ssh executable script:

     def _save_ssh_executable(path: Path, path_to_key: Path) -> None:
         command = f"""
             # Kubernetes tends to reset file permissions on restart. Hence, re-apply the required
             # permissions whenever using the key.
             chmod 600 $ID_RSA
             exec /usr/bin/ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i $ID_RSA -F /app/.ssh/config "$@"

Hope this could be added on a next release :slight_smile:

I have the exact same issue as this one and I know this is the solution for the problem, but I’ve installed my rasa-x using the one-line deployment script, any idea how I can do this with kubectl commands??

Could you maybe help me locating this ssh executable script?