我创建了一个docker openerp容器。从浏览器首次启动是好的,我可以创建新的数据库,或者恢复以前的数据库。
然后我执行docker stop openerp
后跟docker start openerp
。
再次从浏览器访问不再起作用。我得到了后台界面但是有了openerpserver错误。
我使用我自己的docker图像尝试了它,这些图像是从github yvnicolas/docker-openerp repo上找到的源码构建的,以及使用来自Dockerhub的tinyerp / ubuntu-openerp repo具有类似的效果。
以下是我得到的错误跟踪:
Client Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/openerp/addons/web/http.py", line 204, in dispatch
response["result"] = method(self, **self.params)
File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 1427, in load
action = req.session.model(action_type).read([action_id], False, ctx)
File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 42, in proxy
result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 30, in proxy_method
result = self.session.send(self.service_name, method, *args)
File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 103, in send
raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)
Server Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 89, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 296, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 626, in dispatch
res = fn(db, uid, *params)
File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 190, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 132, in wrapper
return f(self, dbname, *args, **kwargs)
File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 199, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 187, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 3679, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 3800, in _read_flat
res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
File "/usr/lib/pymodules/python2.7/openerp/osv/fields.py", line 1145, in get
result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_actions.py", line 211, in _search_view
'search', context=context)
File "/usr/lib/pymodules/python2.7/openerp/addons/account/account_invoice.py", line 363, in fields_view_get
res = super(account_invoice,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 2278, in fields_view_get
xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx)
File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 1930, in __view_look_dom_arch
fields = self.fields_get(cr, user, None, context)
File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 3597, in fields_get
res_trans = translation_obj._get_source(cr, user, self._name + ',' + f, 'field', context['lang'])
File "/usr/lib/pymodules/python2.7/openerp/tools/cache.py", line 18, in lookup
r = self.lookup(self2, cr, *args)
File "/usr/lib/pymodules/python2.7/openerp/tools/cache.py", line 46, in lookup
value = d[key] = self.method(self2, cr, *args)
File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_translation.py", line 336, in _get_source
(lang or '', types, tools.ustr(name)))
File "/usr/lib/pymodules/python2.7/openerp/sql_db.py", line 161, in wrapper
return f(self, *args, **kwargs)
File "/usr/lib/pymodules/python2.7/openerp/sql_db.py", line 226, in execute
res = self._obj.execute(query, params)
InternalError: current transaction is aborted, commands ignored until end of transaction block
答案 0 :(得分:0)
当您开始和停止时,您期望会发生什么?停止正在运行的容器将丢失所有内存数据和所有进程。您需要重新启动正在运行的任何进程,例如:再次发出开始CMD / ENTRYPOINT。但是你创建的所有数据库都将消失。如果要保留进程和数据,可以尝试新的暂停/取消暂停命令,0.12.0中的新命令。这是一个快照机制,可能会按照您的想法开始和停止应该这样做。
答案 1 :(得分:0)
我想知道是否存在某种状态保留。您执行docker run并启动所有操作,但docker stop将保持容器状态,docker start会重新启动相同的容器,而不是创建新映像。如果你做了一个docker rm然后运行docker来创建一个新的容器吗?