Ticket #46 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

Import csv - Can't find the objects I created

Reported by: pjoulaud Owned by: pcosquer
Priority: major Milestone:
Component: models & controllers Version:
Keywords: search, indexing, tasks Cc:


I created several objects using a csv import.
When I use search engine, some of them are not found.
See hereafter an extract of web server output :

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/celery-2.4.1-py2.6.egg/celery/concurrency/processes/pool.py", line 199, in worker
    put((READY, (job, i, result)))
  File "/usr/lib/python2.6/multiprocessing/queues.py", line 366, in put
    return send(obj)
MaybeEncodingError: Error sending result: '<ExceptionInfo: ObjectDoesNotExist('Object3D matching query does not exist.',)>'. Reason: 'Can't pickle <class 'openPLM.phone_doc.models.DoesNotExist'>: attribute lookup openPLM.phone_doc.models.DoesNotExist failed'.
[2011-11-10 17:40:54,207: ERROR/MainProcess]''' Task openPLM.plmapp.tasks.update_index[6e4e5ea7-63dc-428a-8355-0d607d3e5458] raised exception: MaxRetriesExceededError("Can't retry openPLM.plmapp.tasks.update_index[6e4e5ea7-63dc-428a-8355-0d607d3e5458] args:('phone_doc', 'object3d', 53) kwargs:{}",)
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/celery-2.4.1-py2.6.egg/celery/execute/trace.py", line 47, in trace
    return cls(states.SUCCESS, retval=fun(*args, **kwargs))
  File "/usr/local/lib/python2.6/dist-packages/celery-2.4.1-py2.6.egg/celery/app/task/__init__.py", line 247, in __call__
    return self.run(*args, **kwargs)
  File "/var/demos/last/openPLM/../openPLM/plmapp/tasks.py", line 44, in wrapper
    cls.retry(args=args, kwargs=kwargs)
  File "/usr/local/lib/python2.6/dist-packages/celery-2.4.1-py2.6.egg/celery/app/task/__init__.py", line 535, in retry
    self.name, options["task_id"], args, kwargs))
MaxRetriesExceededError: Can't retry openPLM.plmapp.tasks.update_index[6e4e5ea7-63dc-428a-8355-0d607d3e5458] args:('phone_doc', 'object3d', 53) kwargs:{}'''

Enclosed my csv file.


demo_doc.csv Download (1.8 KB) - added by pjoulaud 9 years ago.

Change History

Changed 9 years ago by pjoulaud

comment:1 Changed 9 years ago by pcosquer

  • Keywords search, indexing, tasks added
  • Owner set to pcosquer
  • Status changed from new to accepted

In fact there are two (linked) bugs:

openPLM try to index a plmobject even if it has not been created in the database (the import failed).

openPLM does not block indexing when auto_commit is disabled.

To fix that:

  • add a 'block_indexing' attribute to instances being saved id auto_commit is disabled.
  • check this attribute in QueuedSearchIndex?
  • call update_index after a db commit

comment:2 Changed 9 years ago by pcosquer

The revision [471] should fix this bug.
I let this ticket opened since no test cases have been written.

Last edited 9 years ago by pcosquer (previous) (diff)

comment:3 Changed 9 years ago by pcosquer

I add a basic test (rev [475]) but openPLM lacks tests with concurrent updates (and the test settings run celery's tasks synchronously).

comment:4 Changed 9 years ago by pjoulaud

  • Status changed from accepted to closed
  • Resolution set to fixed

I tried today and I couldn't find the bug.
It's fixed.

Note: See TracTickets for help on using tickets.