I've setup mayan as described in manual at a proxmox lxc container with Debian buster for testing. On several machines all is well and my changes are working. On one machine I get error AttributeError; 'NoneType' object has no attribute 'open' when I try to access document. But not always, a few times document is not None and workflow is ok. The document I need is from context document=context['document'] in workflow execute method. I also tried to get simple checksum, but document most time is None (error changes to attribute checksum for sure).
I've tried to debug my method, only thing I can say document remains None. Can someone give me a hint what to do ? I think it could have something to do with threading, so the document context is not available when I access it.
thanks in advance !
no access to context['document']
Re: no access to context['document']
after some debugging I've found I need to wait for ocr to finish. For now I do this with a state. Would be nice to know how to wait inside my codeblock.
Re: no access to context['document']
This is the reason we added events. You can subscribe to the event which is committed when the processing ends. From the instance passed to you by this event you can also infer the document with .
Code: Select all
event_ocr_document_version_finish
Code: Select all
instance.document