muk-it / muk_dms

MuK Document Management System
GNU Lesser General Public License v3.0
91 stars 143 forks source link

error with multiple files upload #105

Open ivbo opened 5 years ago

ivbo commented 5 years ago

It is really supported multiple files upload ? I tried to upload multiple files but everytime only one file was uploaded ...

In log file I found following errors:

2019-07-15 10:53:36,329 15515 INFO dms4test werkzeug: 127.0.0.1 - - [15/Jul/2019 10:53:36] "GET /web/content?model=muk_dms.file&filename=test_INV868208.pdf&filename_field=name&field=content&id=11&download=true HTTP/1.0" 304 -
2019-07-15 10:53:42,015 15515 INFO dms4test werkzeug: 127.0.0.1 - - [15/Jul/2019 10:53:42] "POST /config/muk_dms.max_upload_size HTTP/1.0" 200 -
2019-07-15 10:53:42,018 15515 INFO dms4test werkzeug: 127.0.0.1 - - [15/Jul/2019 10:53:42] "POST /config/muk_dms.forbidden_extensions HTTP/1.0" 200 -
2019-07-15 10:53:56,511 15515 INFO dms4test odoo.addons.muk_dms_file.models.dms_file: NOT SAVED: [{'id': 1, 'save_type': 'lobject', 'base_path': False}], lobject
2019-07-15 10:53:56,623 15515 ERROR dms4test odoo.sql_db: bad query: b'UPDATE "muk_dms_directory" SET "count_files"=4,"write_uid"=1,"write_date"=(now() at time zone \'UTC\') WHERE id IN (2)'
ERROR: could not serialize access due to concurrent update

2019-07-15 10:53:56,628 15515 INFO dms4test odoo.service.model: SERIALIZATION_FAILURE, retry 1/5 in 0.6905 sec...
2019-07-15 10:53:56,639 15515 INFO dms4test werkzeug: 127.0.0.1 - - [15/Jul/2019 10:53:56] "POST /dms/upload/file/2 HTTP/1.0" 200 -
2019-07-15 10:53:56,654 15515 INFO dms4test werkzeug: 127.0.0.1 - - [15/Jul/2019 10:53:56] "POST /longpolling/poll HTTP/1.0" 200 -

...
...

File "/opt/odoo/odoo11/odoo/http.py", line 337, in checked_call
  result = self.endpoint(*a, **kw)
File "/opt/odoo/odoo11/odoo/http.py", line 939, in __call__
  return self.method(*args, **kw)
File "/opt/odoo/odoo11/odoo/http.py", line 517, in response_wrap
  response = f(*args, **kw)
File "/opt/odoo/custom-addons/muk/muk_dms/controllers/main.py", line 53, in upload
  'content': content})
File "/opt/odoo/custom-addons/muk/muk_utils/models/model.py", line 149, in create
  result = super(BaseModelExtension, self).create(vals)
File "/opt/odoo/odoo11/addons/mail/models/mail_thread.py", line 238, in create
  thread = super(MailThread, self).create(values)
File "/opt/odoo/odoo11/odoo/models.py", line 3420, in create
  record._validate_fields(set(new_vals) - set(old_vals))
File "/opt/odoo/odoo11/odoo/models.py", line 1041, in _validate_fields
  raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))
odoo.exceptions.ValidationError: ("Error while validating constraint\n\nargument should be a bytes-like object or ASCII string, not 'NoneType'", None)
2019-07-15 10:57:14,506 15515 INFO dms4test werkzeug: 127.0.0.1 - - [15/Jul/2019 10:57:14] "POST /web/dataset/call_kw/muk_dms.directory/search_read HTTP/1.0" 200 -
keshrath commented 5 years ago

Can you give me more information: steps to reproduce? Odoo version?

ivbo commented 5 years ago

odoo version 11 on ubuntu 18.04, with latest muk_dms, muk_base and muk_base...

scenario A to upload 2 files:

Kerrim- commented 5 years ago

I managed to recreate the bug.

While I try to debug this you can use the drag and drop functionality of the tree view. That should work despite this bug (just tested it).

ivbo commented 5 years ago

yes, it works with much better results for many files (I tried folders with differents number of files up to 12 ..), but sometimes do not upload 2 or 3 files too ... (especially if have 6 and more files ...)

rm-jamotion commented 4 years ago

Same error here when uploading multiple files with drag&drop.

Best to reproduce is to upload a bunch of PNG files. Then I get the following error almost every time:

ERROR: could not serialize access due to concurrent update

2020-07-09 14:43:19,115 76 ERROR prod flectra.sql_db: bad query: b'UPDATE "muk_dms_directory" SET "count_files"=13,"write_uid"=78,"write_date"=(now() at time zone \'UTC\') WHERE id IN (85)'
ERROR: could not serialize access due to concurrent update

2020-07-09 14:43:19,115 6407 ERROR prod flectra.sql_db: bad query: b'UPDATE "muk_dms_directory" SET "count_files"=13,"write_uid"=78,"write_date"=(now() at time zone \'UTC\') WHERE id IN (85)
'
ERROR: could not serialize access due to concurrent update

2020-07-09 14:43:19,116 6407 INFO prod flectra.service.model: SERIALIZATION_FAILURE, retry 1/5 in 0.2726 sec... 
2020-07-09 14:43:19,116 76 INFO prod flectra.service.model: SERIALIZATION_FAILURE, retry 1/5 in 0.4091 sec... 
2020-07-09 14:43:19,117 80 INFO prod flectra.service.model: SERIALIZATION_FAILURE, retry 1/5 in 0.8733 sec... 
2020-07-09 14:43:19,137 6404 INFO prod werkzeug: 172.18.0.3 - - [09/Jul/2020 14:43:19] "POST /web/dataset/call_kw/muk_dms.file/create HTTP/1.1" 200 - 104 0.036 0.071
2020-07-09 14:43:19,557 6404 INFO prod werkzeug: 172.18.0.3 - - [09/Jul/2020 14:43:19] "GET /web/login HTTP/1.1" 200 - 28 0.019 0.056
2020-07-09 14:43:19,570 76 ERROR prod flectra.sql_db: bad query: b'UPDATE "muk_dms_directory" SET "count_files"=14,"write_uid"=78,"write_date"=(now() at time zone \'UTC\') WHERE id IN (85)'
ERROR: could not serialize access due to concurrent update

2020-07-09 14:43:19,571 76 INFO prod flectra.service.model: SERIALIZATION_FAILURE, retry 2/5 in 0.0244 sec... 
2020-07-09 14:43:19,586 6407 INFO prod werkzeug: 172.18.0.3 - - [09/Jul/2020 14:43:19] "POST /web/dataset/call_kw/muk_dms.file/create HTTP/1.1" 200 - 212 0.129 0.436
2020-07-09 14:43:19,611 76 ERROR prod flectra.sql_db: bad query: b'INSERT INTO "mail_followers" ("id", "res_model", "partner_id", "res_id") VALUES(nextval(\'mail_followers_id_seq\'), \'muk_d
ms.file\', 3274, 799) RETURNING id'
ERROR: duplicate key value violates unique constraint "mail_followers_mail_followers_res_partner_res_model_id_uniq"
DETAIL:  Key (res_model, res_id, partner_id)=(muk_dms.file, 799, 3274) already exists.

2020-07-09 14:43:19,615 76 INFO prod werkzeug: 172.18.0.3 - - [09/Jul/2020 14:43:19] "POST /web/dataset/call_kw/muk_dms.file/create HTTP/1.1" 200 - 85 0.065 0.526
2020-07-09 14:43:20,227 80 INFO prod werkzeug: 172.18.0.3 - - [09/Jul/2020 14:43:20] "POST /web/dataset/call_kw/muk_dms.file/create HTTP/1.1" 200 - 213 0.131 1.065
2020-07-09 14:43:21,134 6404 INFO prod werkzeug: 172.18.0.3 - - [09/Jul/2020 14:43:21] "GET /web/image/15475/Auswahl_393.png?access_token=63bbf7df-45e2-4975-9241-e09e4c8a2c9c HTTP/1.1" 200 -
 7 0.007 0.021
2020-07-09 14:43:26,520 6407 INFO prod werkzeug: 172.18.0.3 - - [09/Jul/2020 14:43:26] "GET /web/login HTTP/1.1" 200 - 28 0.025 0.070

When I upload other file types there are no errors, or only one error on 50 upload tasks.