devkube
devkube

Reputation: 61

"Bad marshal data" Django development server error

Got this error while insterting data into my MySQL database

ValueError at /admin/arbkdb/arbkcompany/
bad marshal data (unknown type code)
Request Method: GET
Request URL:    http://[2001:6f8:1c00:18b::2]:9000/admin/arbkdb/arbkcompany/
Django Version: 1.3
Exception Type: ValueError
Exception Value:    
bad marshal data (unknown type code)
Exception Location: /usr/lib/python2.7/dist-packages/simplejson/__init__.py in <module>, line 111
Python Executable:  /usr/bin/python
Python Version: 2.7.2
Python Path:    
['/home/ardian/.experiments/arbk',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PIL',
 '/usr/lib/python2.7/dist-packages/gst-0.10',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/pymodules/python2.7',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
 '/usr/lib/python2.7/dist-packages/ubuntuone-installer',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
Server time:    Tue, 8 May 2012 16:15:19 -050

Trackback

Environment:


Request Method: GET
Request URL: http://[2001:6f8:1c00:18b::2]:9000/admin/arbkdb/arbkcompany/

Django Version: 1.3
Python Version: 2.7.2
Installed Applications:
['admin_tools',
 'admin_tools.theming',
 'admin_tools.menu',
 'admin_tools.dashboard',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'arbkdb',
 'south',
 'django.contrib.admin']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/usr/lib/pymodules/python2.7/django/core/handlers/base.py" in get_response
  89.                     response = middleware_method(request)
File "/usr/lib/pymodules/python2.7/django/contrib/messages/middleware.py" in process_request
  11.         request._messages = default_storage(request)
File "/usr/lib/pymodules/python2.7/django/contrib/messages/storage/__init__.py" in <lambda>
  31. default_storage = lambda request: get_storage(settings.MESSAGE_STORAGE)(request)
File "/usr/lib/pymodules/python2.7/django/contrib/messages/storage/__init__.py" in get_storage
  17.         mod = import_module(module)
File "/usr/lib/pymodules/python2.7/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/usr/lib/pymodules/python2.7/django/contrib/messages/storage/user_messages.py" in <module>
  8. from django.contrib.messages.storage.fallback import FallbackStorage
File "/usr/lib/pymodules/python2.7/django/contrib/messages/storage/fallback.py" in <module>
  2. from django.contrib.messages.storage.cookie import CookieStorage
File "/usr/lib/pymodules/python2.7/django/contrib/messages/storage/cookie.py" in <module>
  5. from django.utils import simplejson as json
File "/usr/lib/pymodules/python2.7/django/utils/simplejson/__init__.py" in <module>
  111.     import simplejson
File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py" in <module>
  111. from decoder import JSONDecoder, JSONDecodeError

Exception Type: ValueError at /admin/arbkdb/arbkcompany/
Exception Value: bad marshal data (unknown type code)

Ps. I am not sure how to describe why it came to this error because it appeard while inserting a lot of data and I don't know why

This is my model data https://github.com/ardian/arbk/blob/master/arbkdb/models.py

Upvotes: 6

Views: 4040

Answers (2)

Siva Tumma
Siva Tumma

Reputation: 1701

Normally in-memory operation crashes give you this kind of value error, bad marshal errors. That happens when power fails, and the appengine config files get corrupted.

For me, this problem is common, and I just directly uninstall (delete ) and re-install appengine and get back to work. Deleting .pyc files don't work sometimes.

Upvotes: 0

n3storm
n3storm

Reputation: 746

Looks like is not a database problem but a corrupted files message. Removing *.pyc and *.pyo files solves this.

Upvotes: 5

Related Questions