Closed elliotxin closed 4 years ago
Probably some record is deleted. You need to remove such attachment records manually.
I cannot help you more.
almost one hour, the Odoo browser was still running now.
So I really don't know what records deleted before, because the database size now was 10GB, so it's very difficult for me to manually check the records, by the way, thanks for your replay.
Traceback (most recent call last):
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/fields.py", line 944, in __get__
value = record.env.cache.get(record, self)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/api.py", line 967, in get
value = self._data[key][field][record._ids[0]]
KeyError: 48419
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/elliot/OrcaNation-dev/OrcaNation11/orca11/attachment_large_object/ir_attachment.py", line 72, in _compute_datas
attach.datas = self._lobject_read(attach.store_fname, bin_size)
File "/home/elliot/OrcaNation-dev/OrcaNation11/orca11/attachment_large_object/ir_attachment.py", line 62, in _lobject_read
lobj = self.lobject(self.env.cr, int(fname), 'rb')
File "/home/elliot/OrcaNation-dev/OrcaNation11/orca11/attachment_large_object/ir_attachment.py", line 24, in lobject
return cr._cnx.lobject(*args)
psycopg2.OperationalError: ERROR: current transaction is aborted, commands ignored until end of transaction block
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/fields.py", line 944, in __get__
value = record.env.cache.get(record, self)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/api.py", line 967, in get
value = self._data[key][field][record._ids[0]]
KeyError: 264
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/http.py", line 653, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/http.py", line 312, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/tools/pycompat.py", line 87, in reraise
raise value
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/http.py", line 695, in dispatch
result = self._call_function(**self.params)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/http.py", line 344, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/http.py", line 337, in checked_call
result = self.endpoint(*a, **kw)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/http.py", line 939, in __call__
return self.method(*args, **kw)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/http.py", line 517, in response_wrap
response = f(*args, **kw)
File "/home/elliot/OrcaNation-dev/OrcaNation11/addons/web/controllers/main.py", line 934, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/home/elliot/OrcaNation-dev/OrcaNation11/addons/web/controllers/main.py", line 926, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/api.py", line 689, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/api.py", line 680, in call_kw_multi
result = method(recs, *args, **kwargs)
File "/home/elliot/OrcaNation-dev/OrcaNation11/orca11/ir_attachment_force_storage/models.py", line 36, in write
self._attachment_force_storage(storage_value)
File "/home/elliot/OrcaNation-dev/OrcaNation11/orca11/ir_attachment_force_storage/models.py", line 14, in _attachment_force_storage
self.env['ir.attachment'].force_storage_previous(previous_value=previous_value)
File "/home/elliot/OrcaNation-dev/OrcaNation11/orca11/ir_attachment_force_storage/models.py", line 73, in force_storage_previous
attach.write({'datas': attach.datas, 'url': attach.url})
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/fields.py", line 948, in __get__
self.determine_value(record)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/fields.py", line 1061, in determine_value
self.compute_value(recs)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/fields.py", line 1015, in compute_value
self._compute_value(records)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/fields.py", line 1006, in _compute_value
getattr(records, self.compute)()
File "/home/elliot/OrcaNation-dev/OrcaNation11/orca11/attachment_large_object/ir_attachment.py", line 74, in _compute_datas
super(IrAttachment, attach)._compute_datas()
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/addons/base/ir/ir_attachment.py", line 192, in _compute_datas
attach.datas = attach.db_datas
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/fields.py", line 948, in __get__
self.determine_value(record)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/fields.py", line 1051, in determine_value
record._prefetch_field(self)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/models.py", line 2657, in _prefetch_field
result = records.read([f.name for f in fs], load='_classic_write')
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/addons/base/ir/ir_attachment.py", line 426, in read
self.check('read')
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/addons/base/ir/ir_attachment.py", line 333, in check
self._cr.execute('SELECT res_model, res_id, create_uid, public FROM ir_attachment WHERE id IN %s', [tuple(self.ids)])
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/sql_db.py", line 155, in wrapper
return f(self, *args, **kwargs)
File "/home/elliot/OrcaNation-dev/OrcaNation11/OrcaNation/sql_db.py", line 232, in execute
res = self._obj.execute(query, params)
psycopg2.InternalError: current transaction is aborted, commands ignored until end of transaction block
this is the final errors.
After I install this module in ODOO 11, a few months late, the database size becomes more than 10GB, because everything is storen in PostgreSQL now, If I want to make some database backup, it will take me so long time to do this, so I decided to roll back everything to filestore methods. After I change ir_attachment.location to file, the errors come out, like this:
This error will come and continued run in Odoo log one hour, after the error stop, the Odoo browse will prompt put another error message. So anyone can tell me how to fix these issues? Thanks a lot.