RevisionManagementError #264

Closed
evildmp opened this Issue Nov 21, 2009 · 13 comments

Comments

Projects
None yet
4 participants
@evildmp
Contributor

evildmp commented Nov 21, 2009

http://dpaste.com/123343/

Sequence of events: had a page requiring approval, clicked Unbind moderation for descendants on its parent, tried to edit the page

@digi604

This comment has been minimized.

Show comment Hide comment
@digi604

digi604 Nov 21, 2009

Contributor

added the exception for later reference:

Environment:

Request Method: GET
Request URL: http://v026.medcn.uwcm.ac.uk:8000/admin/cms/page/4/
Django Version: 1.1.1
Python Version: 2.6.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.admindocs.urls',
'cms',
'publisher',
'cms.plugins.text',
'cms.plugins.picture',
'cms.plugins.file',
'cms.plugins.flash',
'cms.plugins.link',
'cms.plugins.snippet',
'cms.plugins.googlemap',
'cms.plugins.teaser',
'cms.plugins.video',
'cms.plugins.twitter',
'mptt',
'reversion',
'south',
'image_filer',
'sorl.thumbnail',
'typogrify',
'django.contrib.humanize',
'semanticeditor',
'contacts_and_people',
'news_and_events',
'vacancies_and_studentships',
'links',
'arkestra_utilities.admin_tabs_extension',
'hr_bo_compel',
'publications',
'symplectic',
'research_grant_applications']
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.multilingual.MultilingualURLMiddleware')

Traceback:
File "/home/django/modules/django/core/handlers/base.py" in get_response

  1.             response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/home/django/modules/django/contrib/admin/options.py" in wrapper
  2.             return self.admin_site.admin_view(view)(_args, *_kwargs)
    
    File "/home/django/modules/django/views/decorators/cache.py" in _wrapped_view_func
  3.     response = view_func(request, _args, *_kwargs)
    
    File "/home/django/modules/django/contrib/admin/sites.py" in inner
  4.         return view(request, _args, *_kwargs)
    
    File "/home/django/modules/cms/admin/pageadmin.py" in change_view
  5.     response = super(PageAdmin, self).change_view(request, object_id, extra_context)
    
    File "/home/django/modules/django/db/transaction.py" in _commit_on_success
  6.             res = func(_args, *_kw)
    
    File "/home/django/modules/reversion/revisions.py" in _create_on_success
  7.             self.end()
    
    File "/home/django/modules/reversion/revisions.py" in end
  8.     self.assert_active()
    
    File "/home/django/modules/reversion/revisions.py" in assert_active
  9.         raise RevisionManagementError, "There is no active revision for this thread."
    

Exception Type: RevisionManagementError at /admin/cms/page/4/
Exception Value: There is no active revision for this thread.

Contributor

digi604 commented Nov 21, 2009

added the exception for later reference:

Environment:

Request Method: GET
Request URL: http://v026.medcn.uwcm.ac.uk:8000/admin/cms/page/4/
Django Version: 1.1.1
Python Version: 2.6.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.admindocs.urls',
'cms',
'publisher',
'cms.plugins.text',
'cms.plugins.picture',
'cms.plugins.file',
'cms.plugins.flash',
'cms.plugins.link',
'cms.plugins.snippet',
'cms.plugins.googlemap',
'cms.plugins.teaser',
'cms.plugins.video',
'cms.plugins.twitter',
'mptt',
'reversion',
'south',
'image_filer',
'sorl.thumbnail',
'typogrify',
'django.contrib.humanize',
'semanticeditor',
'contacts_and_people',
'news_and_events',
'vacancies_and_studentships',
'links',
'arkestra_utilities.admin_tabs_extension',
'hr_bo_compel',
'publications',
'symplectic',
'research_grant_applications']
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.multilingual.MultilingualURLMiddleware')

Traceback:
File "/home/django/modules/django/core/handlers/base.py" in get_response

  1.             response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/home/django/modules/django/contrib/admin/options.py" in wrapper
  2.             return self.admin_site.admin_view(view)(_args, *_kwargs)
    
    File "/home/django/modules/django/views/decorators/cache.py" in _wrapped_view_func
  3.     response = view_func(request, _args, *_kwargs)
    
    File "/home/django/modules/django/contrib/admin/sites.py" in inner
  4.         return view(request, _args, *_kwargs)
    
    File "/home/django/modules/cms/admin/pageadmin.py" in change_view
  5.     response = super(PageAdmin, self).change_view(request, object_id, extra_context)
    
    File "/home/django/modules/django/db/transaction.py" in _commit_on_success
  6.             res = func(_args, *_kw)
    
    File "/home/django/modules/reversion/revisions.py" in _create_on_success
  7.             self.end()
    
    File "/home/django/modules/reversion/revisions.py" in end
  8.     self.assert_active()
    
    File "/home/django/modules/reversion/revisions.py" in assert_active
  9.         raise RevisionManagementError, "There is no active revision for this thread."
    

Exception Type: RevisionManagementError at /admin/cms/page/4/
Exception Value: There is no active revision for this thread.

@digi604

This comment has been minimized.

Show comment Hide comment
@digi604

digi604 Nov 21, 2009

Contributor

you had a page requiring approval for what?

Contributor

digi604 commented Nov 21, 2009

you had a page requiring approval for what?

@digi604

This comment has been minimized.

Show comment Hide comment
@digi604

digi604 Nov 21, 2009

Contributor

i can not reproduce

Contributor

digi604 commented Nov 21, 2009

i can not reproduce

@smal

This comment has been minimized.

Show comment Hide comment
@smal

smal Nov 24, 2009

have the same bug with example application

some bug info:
Environment:

Request Method: GET
Request URL: http://localhost:8000/admin/cms/page/add/
Django Version: 1.1
Python Version: 2.6.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'cms',
'publisher',
'cms.plugins.text',
'cms.plugins.picture',
'cms.plugins.file',
'cms.plugins.flash',
'cms.plugins.link',
'cms.plugins.snippet',
'cms.plugins.googlemap',
'cms.plugins.teaser',
'cms.plugins.video',
'cms.plugins.twitter',
'mptt',
'reversion',
'example.categories',
'example.sampleapp']
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.multilingual.MultilingualURLMiddleware')

Traceback:
File "/usr/local/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/core/handlers/base.py" in get_response

  1.             response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/usr/local/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/contrib/admin/options.py" in wrapper
  2.             return self.admin_site.admin_view(view)(_args, *_kwargs)
    
    File "/usr/local/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/views/decorators/cache.py" in _wrapped_view_func
  3.     response = view_func(request, _args, *_kwargs)
    
    File "/usr/local/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/contrib/admin/sites.py" in inner
  4.         return view(request, _args, *_kwargs)
    
    File "/home/smal/Projects/Django/django-cms-2.0/cms/admin/pageadmin.py" in add_view
  5.     return super(PageAdmin, self).add_view(request, form_url, extra_context)
    
    File "/usr/local/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/db/transaction.py" in _commit_on_success
  6.             res = func(_args, *_kw)
    
    File "/usr/local/lib/python2.6/site-packages/reversion/revisions.py" in _create_on_success
  7.             self.end()
    
    File "/usr/local/lib/python2.6/site-packages/reversion/revisions.py" in end
  8.     self.assert_active()
    
    File "/usr/local/lib/python2.6/site-packages/reversion/revisions.py" in assert_active
  9.         raise RevisionManagementError, "There is no active revision for this thread."
    

Exception Type: RevisionManagementError at /admin/cms/page/add/
Exception Value: There is no active revision for this thread.

smal commented Nov 24, 2009

have the same bug with example application

some bug info:
Environment:

Request Method: GET
Request URL: http://localhost:8000/admin/cms/page/add/
Django Version: 1.1
Python Version: 2.6.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'cms',
'publisher',
'cms.plugins.text',
'cms.plugins.picture',
'cms.plugins.file',
'cms.plugins.flash',
'cms.plugins.link',
'cms.plugins.snippet',
'cms.plugins.googlemap',
'cms.plugins.teaser',
'cms.plugins.video',
'cms.plugins.twitter',
'mptt',
'reversion',
'example.categories',
'example.sampleapp']
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.multilingual.MultilingualURLMiddleware')

Traceback:
File "/usr/local/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/core/handlers/base.py" in get_response

  1.             response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/usr/local/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/contrib/admin/options.py" in wrapper
  2.             return self.admin_site.admin_view(view)(_args, *_kwargs)
    
    File "/usr/local/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/views/decorators/cache.py" in _wrapped_view_func
  3.     response = view_func(request, _args, *_kwargs)
    
    File "/usr/local/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/contrib/admin/sites.py" in inner
  4.         return view(request, _args, *_kwargs)
    
    File "/home/smal/Projects/Django/django-cms-2.0/cms/admin/pageadmin.py" in add_view
  5.     return super(PageAdmin, self).add_view(request, form_url, extra_context)
    
    File "/usr/local/lib/python2.6/site-packages/Django-1.1-py2.6.egg/django/db/transaction.py" in _commit_on_success
  6.             res = func(_args, *_kw)
    
    File "/usr/local/lib/python2.6/site-packages/reversion/revisions.py" in _create_on_success
  7.             self.end()
    
    File "/usr/local/lib/python2.6/site-packages/reversion/revisions.py" in end
  8.     self.assert_active()
    
    File "/usr/local/lib/python2.6/site-packages/reversion/revisions.py" in assert_active
  9.         raise RevisionManagementError, "There is no active revision for this thread."
    

Exception Type: RevisionManagementError at /admin/cms/page/add/
Exception Value: There is no active revision for this thread.

@smal

This comment has been minimized.

Show comment Hide comment
@smal

smal Nov 24, 2009

additional system info
Linux travezio 2.6.31.5-0.1-default #1 SMP 2009-10-26 15:49:03 +0100 i686 i686 i386 GNU/Linux

python 2.6.2
DB - PostgreSQL 8.4.1
using latest stable versions of django-cms2 and reversion 1.2

I think something wrong when doing transactions

smal commented Nov 24, 2009

additional system info
Linux travezio 2.6.31.5-0.1-default #1 SMP 2009-10-26 15:49:03 +0100 i686 i686 i386 GNU/Linux

python 2.6.2
DB - PostgreSQL 8.4.1
using latest stable versions of django-cms2 and reversion 1.2

I think something wrong when doing transactions

@smal

This comment has been minimized.

Show comment Hide comment
@smal

smal Nov 24, 2009

and this bug has gone and I can't reproduce it when I restart django development server.
maybe something wrong with django threads or something other?

smal commented Nov 24, 2009

and this bug has gone and I can't reproduce it when I restart django development server.
maybe something wrong with django threads or something other?

@digi604

This comment has been minimized.

Show comment Hide comment
@digi604

digi604 Nov 24, 2009

Contributor

is this reversion 1.2 or trunk?

Contributor

digi604 commented Nov 24, 2009

is this reversion 1.2 or trunk?

@smal

This comment has been minimized.

Show comment Hide comment
@smal

smal Nov 24, 2009

reversion 1.2

smal commented Nov 24, 2009

reversion 1.2

@digi604

This comment has been minimized.

Show comment Hide comment
@digi604

digi604 Nov 24, 2009

Contributor

can't reproduce... need more details

Contributor

digi604 commented Nov 24, 2009

can't reproduce... need more details

@smal

This comment has been minimized.

Show comment Hide comment
@smal

smal Nov 24, 2009

now I can't reproduce too, but that bug was in system.Main question - in what conditions it appears. If I have more details or this bug appears again I'll write.

smal commented Nov 24, 2009

now I can't reproduce too, but that bug was in system.Main question - in what conditions it appears. If I have more details or this bug appears again I'll write.

@specialunderwear

This comment has been minimized.

Show comment Hide comment
@specialunderwear

specialunderwear Nov 24, 2009

Contributor

I found this bug lots and lots of times. eventually i had to comment out the line that sets the revisions to -10000 in publisher models.py. What exactly is this line for? i understand it has something to do with adding history for published items, but since you never visit the published page in the cms unless you manually alter the url, it is not much overhead when compared to millions of error messages.

Any time a revision is sealed and end is called this bug can show up if the reversion _state.depth is still at -10000 or something lower then 1. It can even show up when just viewing a page because the commit on succes is called also when a get request is sent to change_view. the error on the get request will often pop up after the error first occurred on a save. I could not in any way determine the difference between a flawed page, (that showed the error) and a working page. I had one page that would always produce the error but even when inspecting the database i couldn't find any clue to the cause.

I suggest finding some other way to make the version not recorded, because setting _state.depth to -10000 is very very brittle and prone to breakage.

Contributor

specialunderwear commented Nov 24, 2009

I found this bug lots and lots of times. eventually i had to comment out the line that sets the revisions to -10000 in publisher models.py. What exactly is this line for? i understand it has something to do with adding history for published items, but since you never visit the published page in the cms unless you manually alter the url, it is not much overhead when compared to millions of error messages.

Any time a revision is sealed and end is called this bug can show up if the reversion _state.depth is still at -10000 or something lower then 1. It can even show up when just viewing a page because the commit on succes is called also when a get request is sent to change_view. the error on the get request will often pop up after the error first occurred on a save. I could not in any way determine the difference between a flawed page, (that showed the error) and a working page. I had one page that would always produce the error but even when inspecting the database i couldn't find any clue to the cause.

I suggest finding some other way to make the version not recorded, because setting _state.depth to -10000 is very very brittle and prone to breakage.

@digi604

This comment has been minimized.

Show comment Hide comment
@digi604

digi604 Nov 24, 2009

Contributor

if this fixes the error i will comment it out... I hope no other bugs are introduced with that.

Contributor

digi604 commented Nov 24, 2009

if this fixes the error i will comment it out... I hope no other bugs are introduced with that.

@digi604

This comment has been minimized.

Show comment Hide comment
@digi604

digi604 Nov 24, 2009

Contributor

closed by 0471d78 revision history depth is not set to -10000 anymore if a model under publisher is saved

Contributor

digi604 commented Nov 24, 2009

closed by 0471d78 revision history depth is not set to -10000 anymore if a model under publisher is saved

christianbertschy pushed a commit to christianbertschy/django-cms-2.0 that referenced this issue Oct 1, 2012

christianbertschy pushed a commit to christianbertschy/django-cms-2.0 that referenced this issue Oct 1, 2012

christianbertschy pushed a commit to christianbertschy/django-cms-2.0 that referenced this issue Oct 1, 2012

christianbertschy pushed a commit to christianbertschy/django-cms-2.0 that referenced this issue Oct 1, 2012

fixes issue #264
Conflicts:

	publisher/models.py

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment