解决HUE报错MultipleObjectsReturned: get() returned more than one Document2 -- it returned 2!
表现:界面上报错:
,刚登陆进去就能看到,点击执行也会出现。日志里报:
Traceback (most recent call last):
File "/home/work/hue-3.10.0/desktop/libs/notebook/src/notebook/decorators.py", line 81, in decorator
return func(*args, **kwargs)
File "/home/work/hue-3.10.0/desktop/libs/notebook/src/notebook/api.py", line 124, in execute
history = _historify(notebook, request.user)
File "/home/work/hue-3.10.0/desktop/libs/notebook/src/notebook/api.py", line 319, in _historify
is_history=True
File "/home/work/hue-3.10.0/build/env/local/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/models/manager.py", line 157, in create
return self.get_queryset().create(**kwargs)
File "/home/work/hue-3.10.0/build/env/local/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/models/query.py", line 322, in create
obj.save(force_insert=True, using=self.db)
File "/home/work/hue-3.10.0/desktop/core/src/desktop/models.py", line 1138, in save
home_dir = Document2.objects.get_home_directory(self.owner)
File "/home/work/hue-3.10.0/desktop/core/src/desktop/models.py", line 935, in get_home_directory
return self.get(owner=user, parent_directory=None, name=Document2.HOME_DIR, type='directory')
File "/home/work/hue-3.10.0/build/env/local/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/models/manager.py", line 151, in get
return self.get_queryset().get(*args, **kwargs)
File "/home/work/hue-3.10.0/build/env/local/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/models/query.py", line 313, in get
(self.model._meta.object_name, num))
MultipleObjectsReturned: get() returned more than one Document2 -- it returned 2!
复现步骤:已账号xxxx登录hue,即可看到异常.
ps: 有人在官网报此问题,http://gethue.com/how-to-fix-the-multipleobjectsreturned-error-in-hue/ 但官方没有给出解决方法.
def get_home_directory(self, user):
try:
return self.get(owner=user, parent_directory=None, name=Document2.HOME_DIR, type='directory')
except Document2.DoesNotExist:
return self.create_user_directories(user)
是class Document2Manager的方法,怀疑是用户表中存的用户记录多了一条,所以查到两个home directory,查了auth_user表和useradmin_userprofile表,都正常。后又查表desktop_document2,按self.get()中的查询条件果然查到两行:

解决HUE报错MultipleObjectsReturned: get() returned more than one Document2 -- it returned 2!的更多相关文章
- 解决hue报错:timed out (code THRIFTSOCKET): None
报错栈: [/Jun/ :: +] decorators ERROR error running <function execute at 0x7fba2804ecf8> Tracebac ...
- Idea使用记录--添加Problems&&解决Autowired报错could not autowire
今天在使用Idea的时候,发现Idea在整个每次找到错误代码非常不方便(Idea如果类中有错误,没有打开过类并不会提示,比如构建工程后缺少jar包问题).我想快速看到工程哪里出问题类似于eclipse ...
- [转]解决Maven报错"Plugin execution not covered by lifecycle configuration"
[转]解决Maven报错"Plugin execution not covered by lifecycle configuration" 导入Myabtis源码后,POM文件会报 ...
- 解决MySQL报错ERROR 2002 (HY000)【转】
今天在为新的业务线搭架数据库后,在启动的时候报错 root@qsbilldatahis-db01:/usr/local/mysql/bin# ./mysql ERROR 2002 (HY000): C ...
- vue解决启动报错cjs loader.js Error: Cannot find module '../config'问题
vue解决启动报错cjs loader.js Error: Cannot find module '../config'问题 今天下载了一个开源项目一直运行不了,折腾了半天才找到问题所在,config ...
- 解决 php 报错 open_basedir restriction in effect或者nginx提示No input file specified怎么办
解决 php 报错 open_basedir restriction in effect或者nginx提示No input file specified怎么办 问题是出现在了PHP.INI上面了 ,原 ...
- 解决MySQL报错:1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'informat
解决MySQL报错:1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'informat ...
- eclips中maven解决jsp报错的问题
加入如下的pom依赖: <!-- 解决jsp报错的依赖包第一个 --> <dependency> <groupId>javax.servlet</groupI ...
- 不修改系统日期和时间格式,解决Delphi报错提示 '****-**-**'is not a valid date and time
假如操作系统的日期格式不是yyyy-MM-dd格式,而是用strtodate('2014-10-01')) 来转换的话,程序会提示爆粗 '****-**-**'is not a valid date ...
随机推荐
- 借助svn进行半自动多台服务器上线部署
传统简单保留 如果web服务器就那么几台,大致可以在测试服务器上测试好以后,直接在正式的web服务器 压缩拷贝一个,然后再覆盖下,进行简单暴力的发布. 这种纯手工发布往往会带来几个问题 压缩一不小心把 ...
- js 获取定位信息
1.百度账号 申请一个key http://developer.baidu.com/map/index.php?title=lbscloud 2.开发下面demo代码 <!DOCTYPE htm ...
- pymongo的一些操作
参考:http://www.yiibai.com/mongodb/mongodb_drop_collection.html http://www.cnblogs.com/zhouxuchen/p/55 ...
- yum使用
一.使用yum安装和卸载软件,有个前提是yum安装的软件包都是rpm格式的.安装的命令是,yum install ~,yum会查询数据库,有无这一软件包,如果有,则检查其依赖冲突关系,如果没有依赖冲突 ...
- Java Integer Cache
Java Integer Cache Java 代码 public class IntegerDemo { public static void main(String[] args) { Integ ...
- Scrollify – jQuery全屏滚动插件
和 fullPage.js 一样,Scrollify 也是一款基于 jQuery 的全屏滚动插件.跟 fullPage.js 相比,Scrollify 更加小巧,压缩后不足 4KB.但功能上不如 fu ...
- 转: kali msfvenom生成木马
kali msfvenom生成木马 转:https://blog.csdn.net/qq_33391644/article/details/79266724 msfvenom是msfpayload,m ...
- MYSQL注入天书之开天辟地
MYSQL注入天书 在线版本:xianzhi.aliyun.com 第一篇地址:https://xianzhi.aliyun.com/forum/read/314.html第二篇地址:https:// ...
- 【BZOJ 3218】 3218: a + b Problem(最小割+可持久化线段树)
3218: a + b Problem Time Limit: 20 Sec Memory Limit: 40 MBSubmit: 1440 Solved: 545 Description Inp ...
- dalvik 基于 jvm 的改进
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha 几个class 变成一个dex.constant pool 省内存 zygote ,co ...