Reply
Explorer
Posts: 22
Registered: ‎12-09-2015
Accepted Solution

Hue OperationalError: no such column: search_collection.owner_id error

I'm following the instructions: http://www.cloudera.com/documentation/enterprise/5-5-x/topics/cdh_ig_hue_database.html

 

When dumping the sqlite database, I get the following error:

 

sudo -u hue /opt/cloudera/parcels/CDH-5.7.0-1.cdh5.7.0.p0.45/lib/hue/build/env/bin/hue dumpdata > /tmp/huedump.json
CommandError: Unable to serialize database: no such column: search_collection.owner_id

We started on version 5.3.3, upgraded to 5.4.7, and have now completed an upgrade to 5.7.0. 

 

Can anyone tell me how to fix/get around this?

 

Explorer
Posts: 22
Registered: ‎12-09-2015

Re: Hue OperationalError: no such column: search_collection.owner_id error

For reference, the table in the database looks like this:

 


CREATE TABLE "search_collection" (
"properties" text NOT NULL,
"sorting_id" integer NOT NULL,
"name" varchar(40) NOT NULL,
"facets_id" integer NOT NULL,
"enabled" bool NOT NULL,
"label" varchar(100) NOT NULL,
"is_core_only" bool NOT NULL,
"result_id" integer NOT NULL,
"cores" text NOT NULL,
"id" integer NOT NULL PRIMARY KEY);

 

and the create table command in hue looks like this:

 

db.create_table('search_collection', (
('properties', self.gf('django.db.models.fields.TextField')(default='{}')),
('sorting', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['search.Sorting'])),
('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
('facets', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['search.Facet'])),
('enabled', self.gf('django.db.models.fields.BooleanField')(default=True, blank=True)),
('label', self.gf('django.db.models.fields.CharField')(max_length=100)),
('is_core_only', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True)),
('result', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['search.Result'])),
('cores', self.gf('django.db.models.fields.TextField')(default='{}')),
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
))

 

So the field "owner_id" is definitely not there, and it looks like it shouldn't be, so why is it an error? Can I just create an owner_id field with some default value, or will that mess up something worse?

Explorer
Posts: 22
Registered: ‎12-09-2015

Re: Hue OperationalError: no such column: search_collection.owner_id error

This issue was corrected by using the sqlite3 command line interface and

 

(alter table search_collection add column owner_id int NULL)

 

No issues were seen after that.