Rasa X can pull from Github but not push/create branch

Hello! I have an issue connecting my Rasa X installation running on Azure to a Github repo:

Steps taken:

  1. Installed Rasa X on Azure VM
  2. Connected to Github using a deployment key, Target branch develop
  3. Updated NLU files and committed
  4. Synced to Rasa X, Works :white_check_mark:
  5. Updated NLU data from within Rasa X
  6. Added changes to git server on a new branch

Expected result:

  • A new branch exists on Github containing the changes

Actual result:

  • no branch on Github :x:

Logs show the following:

[2020-11-30 16:14:37 +0000] - (sanic.access)[INFO][10.42.0.8:59488]: PUT http://myvm.westeurope.cloudapp.azure.com/api/projects/default/git_repositories/2/branches/develop?force=true  204 0

...

[2020-11-30 16:15:49 +0000] - (sanic.access)[INFO][10.42.0.8:60456]: GET http://myvm.westeurope.cloudapp.azure.com/api/projects/default/git_repositories/2/status  200 261

**[2020-11-30 16:15:56 +0000] - (sanic.access)[INFO][10.42.0.8:60530]: POST http://myvm.westeurope.cloudapp.azure.com/api/projects/default/git_repositories/2/branches/Rasa-x-Nov-30th-20--4-41-44-pm-8c8b34d0-3322-11eb-b059-032c9d57845e/commits  409 195**

[2020-11-30 16:16:15 +0000] - (sanic.access)[INFO][10.42.0.8:60718]: GET http://myvm.westeurope.cloudapp.azure.com/api/projects/default/git_repositories/2/status  200 261

From a local multipass installation of Rasa X it works. So the problem must be something up there in the cloud. The network security group allows ALL outbound traffic from and to ANY port from and to ANYwhere, to rule out that it is a permission issue.

Has anybody ever been at this point or can point me in a direction how to further narrow down the potential cause of this issue? How to get more logs?

Hi @Simon,

When you created your deploy key on GitHub, did you ensure that you checked the box that says “allow write access”?

Hello Will, thank you for your suggestion. Yes the deploy key has read/write access to the repository.

Ok, problem SOLVED

As one can read here Rasa X Documentation, the 409 error indicates that there is another commit operation in progress. Disconnecting the repo and reconnecting did not help. I threw away the entire VM and reinstalled from scratch. then it worked.

How did I get to this messed up state? When I first connected the git repo, I choose the develop branch as target. develop didn’t exist at this point. this seemed to cause some trouble which did not go away when I created develop and reconnected the repo.

It would still be helpful for the future if

  • such issues with non existing branches would be handles more gracefully.
  • someone could explain how one gets out of this messed up state causing the “409 There is another commit operation in progress” error, e.g. how to abort the operation.

Greetings!

Simon

For completeness, here are the logs when the repo was connected with nonexisting target branch:

[2020-11-30 15:06:22 +0000] - (sanic.access)[INFO][10.42.0.8:45608]: GET http://myvm.westeurope.cloudapp.azure.com/api/projects/default/git_repositories/1/status  404 209
Job "run_background_synchronization (trigger: cron[minute='*'], next run at: 2020-11-30 15:07:00 UTC)" raised an exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site- packages/rasax/community/services/integrated_version_control/git_service.py", line 284, in checkout_branch
for branch in self._repository.refs
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/apscheduler/executors/base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
  File "/usr/local/lib/python3.7/site- packages/rasax/community/services/integrated_version_control/git_service.py", line 131, in run_background_synchronization
loop.run_until_complete(git_service.synchronize_project(force_data_injection))
  File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
  File "/usr/local/lib/python3.7/site- packages/rasax/community/services/integrated_version_control/git_service.py", line 1060, in synchronize_project
if self.clone():
  File "/usr/local/lib/python3.7/site- 
packages/rasax/community/services/integrated_version_control/git_service.py", line 671, in clone
self._clone()
  File "/usr/local/lib/python3.7/site-packages/rasax/community/services/integrated_version_control/git_service.py", line 742, in _clone
self.checkout_branch(repository_info.target_branch, inject_changes=False)
  File "/usr/local/lib/python3.7/site-packages/rasax/community/services/integrated_version_control/git_service.py", line 289, in checkout_branch
raise ValueError(f"Branch '{branch_name}' does not exist.")
ValueError: Branch 'develop' does not exist.
[2020-11-30 15:06:26 +0000] - (sanic.access)[INFO][10.42.0.4:58082]: GET http://rasa-rasa-x-rasa-x.rasa.svc:5002/api/projects/default/models/tags/production?token=rasaXToken  404 160
[2020-11-30 15:06:26 +0000] - (sanic.access)[INFO][10.42.0.6:36340]: GET http://rasa-rasa-x-rasa-x.rasa.svc:5002/api/projects/default/models/tags/production?token=rasaXToken  404 160
...
[2020-11-30 15:06:56 +0000] - (sanic.access)[INFO][10.42.0.4:58372]: GET http://rasa-rasa-x-rasa-x.rasa.svc:5002/api/projects/default/models/tags/production?token=rasaXToken  404 160
[2020-11-30 15:06:56 +0000] - (sanic.access)[INFO][10.42.0.6:36630]: GET http://rasa-rasa-x-rasa-x.rasa.svc:5002/api/projects/default/models/tags/production?token=rasaXToken  404 160
[2020-11-30 15:06:57 +0000] - (sanic.access)[INFO][10.42.0.1:52264]: GET http://10.42.0.28:5002/  200 3217
[2020-11-30 15:06:58 +0000] - (sanic.access)[INFO][10.42.0.1:52282]: GET http://10.42.0.28:5002/  200 3217
Job "run_background_synchronization (trigger: cron[minute='*'], next run at: 2020-11-30 15:08:00 UTC)" raised an exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/apscheduler/executors/base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
  File "/usr/local/lib/python3.7/site-packages/rasax/community/services/integrated_version_control/git_service.py", line 131, in run_background_synchronization
loop.run_until_complete(git_service.synchronize_project(force_data_injection))
  File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
  File "/usr/local/lib/python3.7/site-packages/rasax/community/services/integrated_version_control/git_service.py", line 1070, in synchronize_project
is_target_branch_ahead = self._update_and_return_is_remote_branch_ahead()
  File "/usr/local/lib/python3.7/site-packages/rasax/community/services/integrated_version_control/git_service.py", line 883, in _update_and_return_is_remote_branch_ahead
is_remote_branch_ahead = self._is_remote_branch_ahead(branch)
  File "/usr/local/lib/python3.7/site-packages/rasax/community/services/integrated_version_control/git_service.py", line 909, in _is_remote_branch_ahead
number_of_commits_behind = sum(1 for _ in commits_behind)
  File "/usr/local/lib/python3.7/site-packages/rasax/community/services/integrated_version_control/git_service.py", line 909, in <genexpr>
number_of_commits_behind = sum(1 for _ in commits_behind)
  File "/usr/local/lib/python3.7/site-packages/git/objects/commit.py", line 277, in _iter_from_process_or_stream
finalize_process(proc_or_stream)
  File "/usr/local/lib/python3.7/site-packages/git/util.py", line 329, in finalize_process
proc.wait(**kwargs)
  File "/usr/local/lib/python3.7/site-packages/git/cmd.py", line 408, in wait
raise GitCommandError(self.args, status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git rev-list main..origin/develop --
  stderr: 'fatal: bad revision 'main..origin/develop'
'
[2020-11-30 15:07:06 +0000] - (sanic.access)[INFO][10.42.0.4:58472]: GET http://rasa-rasa-x-rasa-x.rasa.svc:5002/api/projects/default/models/tags/production?token=rasaXToken  404 160
[2020-11-30 15:07:06 +0000] - (sanic.access)[INFO][10.42.0.6:36730]: GET http://rasa-rasa-x-rasa-x.rasa.svc:5002/api/projects/default/models/tags/production?token=rasaXToken  404 160
1 Like