Command Error Unable To Serialize Database
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the error unable to serialize database user matching query does not exist workings and policies of this site About Us Learn more about commanderror: unable to serialize database: user matching query does not exist. Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions
Django Dumpdata
Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up In Django, getting a “Error: Unable to serialize database” when trying to dump data? up vote 10 down vote favorite 1 I'm getting an error when I'm trying to dump data to a JSON fixture in Djanog 1.2.1 on my live server. On the live server it's running MySQL Server version 5.0.77 and I imported a lot of data to my tables using the phpMyAdmin interface. The website works fine and Django admin responds as normal. But when I try and actually dump the data of the application that corresponds to the tables I get this error: $ python manage.py dumpdata --indent=2 gigs > fixtures/gigs_100914.json /usr/local/lib/python2.6/site-packages/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated from sets import ImmutableSet Error: Unable to serialize database: Location matching query does not exist. My Django model for 'gigs' that I'm trying to dump from looks like this in the models.py file: from datetime import datetime from django.db import models class Location(models.Model): name = models.CharField(max_length=120, blank=True, null=True) class Meta: ordering = ['name'] def __unicode__(self): return "%s (%s)" % (self.name, self.pk) class Venue(models.Model): name = models.CharField(max_length=120, blank=True, null=True) contact = models.CharField(max_length=250, blank=True, null=True) url = models.URLField(max_length=60, verify_exists=False, blank=True, null=True) # because of single thread problems, I left this off (http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.URLField.verify_exists) class Meta: ordering = ['name'] def __unicode__(self): return "%s (%s)" % (self.name, self.pk) class Gig(models.Model): date = models.DateField(blank=True, null=True) details = models
Portal Partners Developers Community Community CommunityCategoryBoardKnowledge BaseUsers turn on suggestions Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type. Showing results for Search instead for Do you mean Browse Cloudera Community News News & Announcements Getting Started Hadoop 101 Beta Releases Configuring and Managing Cloudera Manager Cloudera Director CDH Topics (w/o CM) Using the Platform Batch (MR, YARN, Oozie) Data Ingest (Sqoop, Flume... Storage (HDFS, HBase... Hue Hive Impala Data http://stackoverflow.com/questions/3708119/in-django-getting-a-error-unable-to-serialize-database-when-trying-to-dump-d Science Search (SolrCloud) Spark Cloudera Labs Data Management Data Discovery, Optimization Security/Sentry Building on the Platform Kite SDK Suggestions Off Topic and Suggestions Cloudera AMA Cloudera Community : Using the Platform : Hue : Hue dumpdata returns "CommandError: Unable to seri... Register · Sign In · Help Reply Topic Options Subscribe to RSS Feed Mark Topic as New Mark https://community.cloudera.com/t5/Web-UI-Hue-Beeswax/Hue-dumpdata-returns-quot-CommandError-Unable-to-serialize/td-p/29818 Topic as Read Float this Topic to the Top Bookmark Subscribe Printer Friendly Page « Topic Listing « Previous Topic Next Topic » slavo Explorer Posts: 17 Registered: 05-02-2014 Hue dumpdata returns "CommandError: Unable to serialize database: no such table: desktop_document2" Options Mark as New Bookmark Subscribe Subscribe to RSS Feed Highlight Print Email to a Friend Report Inappropriate Content 07-20-2015 04:49 AM Hi,I want to migrate the Hue database from sqlite3 to MySQL and dump the data from sqlite to a JSON file:logged on as user "hue" (who is the "owner" of Hue)$ /opt/cloudera/parcels/CDH-5.4.4-1.cdh5.4.4.p0.4/lib/hue/build/env/bin/hue dumpdata >hue_dumpdata.2015-07-20.jsonCommandError: Unable to serialize database: no such table: desktop_document2When I use sqlite to display the list of tables, I can see it there:$ sqlite3 /var/hadoop/data/hue/desktop.dbSQLite version 3.6.20Enter ".help" for instructionsEnter SQL statements terminated with a ";"sqlite> .tables '%';auth_group oozie_datainputauth_group_permissions oozie_dataoutput...desktop_document oozie_genericdesktop_document2 oozie_historydesktop_document2_dependencies oozie_hive...What's wrong with this?Thanks in advance.Regards,Slavo Solved! Go to Solution. Report Inappropriate Content Message 1 of 2 (834 Views) Reply 0 Kudos Romainr Cloudera Employee Posts: 589 Registered: 07-30-2013 Re: Hue dumpdata returns "CommandError: Unable to serialize
Error: http://davedash.com/2009/09/13/resolving-django-dumpdata-errors/ Unable to serialize database: User matching query does not exist. I knew this might not work out since I was dealing with a legacy database, but the resolution is quite simple. First I had to unable to narrow it down to which app was causing this. Naturally I assumed it was one of the two apps I had, either common or restaurant. So I ran: ./manage.py dumpdata common and ./manage.py dumpdata restaurant. unable to serialize The latter had no problem whatsoever. This made sense, since my common application was the only one that made any reference to a User. By looking in my models.py for that application, I narrowed it down to my Profile object. Sure enough, commenting it out meant I could get my data. It ended up being a foreign key mismatch between the profile and user tables. Since this is legacy data, this mismatch made sense. A simple SELECT id,userid FROM profile WHERE userid NOT IN (SELECT id FROM auth_user) gave me a list of bad profiles. Removing them allowed me to create my Django fixtures.