nautobot / nautobot-app-version-control

Version Control App that uses and requires a Dolt Database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot switch Version Control from a non-main branch to main branch when Nautobot 1.2b is running

tim-fiola opened this issue · comments

When attempting to activate the main branch, a server error appears:

image

Here is a stack trace

16:44:44.355 ERROR   django.request :
  Internal Server Error: /plugins/dolt/branches/main/checkout/
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.9/site-packages/django/utils/deprecation.py", line 116, in __call__
    response = self.process_response(request, response)
  File "/usr/local/lib/python3.9/site-packages/django/contrib/sessions/middleware.py", line 63, in process_response
    request.session.save()
  File "/usr/local/lib/python3.9/site-packages/django/contrib/sessions/backends/db.py", line 84, in save
    using = router.db_for_write(self.model, instance=obj)
  File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 270, in _route_db
    chosen_db = method(model, **hints)
  File "/usr/local/lib/python3.9/site-packages/dolt/routers.py", line 49, in db_for_write
    raise DoltError(
dolt.utils.DoltError: Error writing model <strong>Session</strong>
                        on branch <strong>"test-branch"</strong>:
                        non-versioned models must be written on branch
                        <strong>"main"</strong>.

I am able to replicate this in one of our internal demo environments, but not when I run Version Control on Nautobot 1.2b in my local dev environment.

To recreate:

  • create a new branch
  • that new branch will automatically become active - now try to activate the main branch (Version Control --> branches --> select the Activate button by the main branch)
  • I can provide the specific internal environment url where I see this happening

I don't see this issue with a local development environment.