Resolve all objects in portal_callables
-
@klaus , @Tyagov : Quick action needed.
Dear Klaus and Ivan. I had a nicely working development instance. ERP5 code, at least on the filesystem was just 2 or 3 weeks old. After updating erp5 products code, after zope restart nothing works any longer.
If I take code right before this commit, my instance is working. With this commit, the ERP5 instance is broken, and I have this in logs :
... skin_selection_mapping = self.initializeCache() File "/srv/slapgrid/slappart4/srv/runner/software/f055e2467707d7418e4513bc715f55b5/parts/erp5/product/ERP5Type/patches/CMFCoreSkinnable.py", li ne 56, in CMFCoreSkinnableSkinnableObjectManager_initializeCache portal_callables = getattr(self, 'portal_callables', None) File "/srv/slapgrid/slappart4/srv/runner/software/f055e2467707d7418e4513bc715f55b5/parts/erp5/product/ERP5Type/patches/CMFCoreSkinnable.py", li ne 122, in CMFCoreSkinnableSkinnableObjectManager___getattr__ object = skinResolve(self, skin_selection_name, name) File "/srv/slapgrid/slappart4/srv/runner/software/f055e2467707d7418e4513bc715f55b5/parts/erp5/product/ERP5Type/patches/CMFCoreSkinnable.py", li ne 79, in skinResolve skin_selection_mapping = self.initializeCache() File "/srv/slapgrid/slappart4/srv/runner/software/f055e2467707d7418e4513bc715f55b5/parts/erp5/product/ERP5Type/patches/CMFCoreSkinnable.py", li ne 56, in CMFCoreSkinnableSkinnableObjectManager_initializeCache portal_callables = getattr(self, 'portal_callables', None) File "/srv/slapgrid/slappart4/srv/runner/software/f055e2467707d7418e4513bc715f55b5/parts/erp5/product/ERP5Type/patches/CMFCoreSkinnable.py", li ne 122, in CMFCoreSkinnableSkinnableObjectManager___getattr__ object = skinResolve(self, skin_selection_name, name) File "/srv/slapgrid/slappart4/srv/runner/software/f055e2467707d7418e4513bc715f55b5/parts/erp5/product/ERP5Type/patches/CMFCoreSkinnable.py", li ne 78, in skinResolve ' This should not happen often. Current thread id:%X' % get_ident()) File "/srv/slapgrid/slappart4/srv/runner/software/f055e2467707d7418e4513bc715f55b5/eggs/zLOG-2.11.2-py2.7.egg/zLOG/__init__.py", line 135, in L OG log_write(subsystem, severity, summary, detail, error) File "/srv/slapgrid/slappart4/srv/runner/software/f055e2467707d7418e4513bc715f55b5/eggs/zLOG-2.11.2-py2.7.egg/zLOG/EventLogger.py", line 44, in log_write logger = logging.getLogger(subsystem) File "/srv/slapgrid/slappart4/srv/runner/software/f055e2467707d7418e4513bc715f55b5/parts/python2.7/lib/python2.7/logging/__init__.py", line 157 4, in getLogger return Logger.manager.getLogger(name) File "/srv/slapgrid/slappart4/srv/runner/software/f055e2467707d7418e4513bc715f55b5/parts/python2.7/lib/python2.7/logging/__init__.py", line 103 7, in getLogger if not isinstance(name, basestring): RuntimeError: maximum recursion depth exceeded while calling a Python object
It seems that another commit after fix this infinite recursion. But if I switch taking the very latest ERP5 commit (d7cd7f65), my instance is still not working (not accessible at all, accessing https://my_domain/my_site/view just give the Zope Quick Start page instead of showing ERP5 front page ! ) and I have in logs every second :
2017-09-08 11:51:33,027 INFO Zope Ready to handle requests ------ 2017-09-08 11:51:35,320 INFO ZServer Timerserver ready, starting timer services. ------ 2017-09-08 11:51:42,087 INFO ERP5Type.Tool.ComponentTool Resetting Components ------ 2017-09-08 11:51:42,168 INFO ERP5Type.dynamic Resetting dynamic classes ------ 2017-09-08 11:51:42,644 ERROR ActivityTool process_timer received an exception Traceback (most recent call last): File "/srv/slapgrid/slappart4/srv/runner/software/f055e2467707d7418e4513bc715f55b5/parts/erp5/product/CMFActivity/ActivityTool.py", line 1040, in process_timer self.tic(processing_node_list.index(currentNode) + 1) File "/srv/slapgrid/slappart4/srv/runner/software/f055e2467707d7418e4513bc715f55b5/parts/erp5/product/CMFActivity/ActivityTool.py", line 1093, in tic for last in sorted(activity_dict.values(), key=sort_key): File "/srv/slapgrid/slappart4/srv/runner/software/f055e2467707d7418e4513bc715f55b5/parts/erp5/product/CMFActivity/ActivityTool.py", line 1090, in sort_key return activity.getPriority(self), activity is last File "/srv/slapgrid/slappart4/srv/runner/software/f055e2467707d7418e4513bc715f55b5/parts/erp5/product/CMFActivity/Activity/SQLBase.py", line 23 9, in getPriority result = activity_tool.SQLBase_getPriority(table=self.sql_table) AttributeError: SQLBase_getPriority
May be everything just fails because portal_callables is missing on my ERP5 site.
If this is the case, I would suggest to add automatic migration for having a portal_callables tool without doing anything. The installation of portal_callables by business template is probably not enough, because right now with a broken site we can not update any bt.
Could you please have a look ?
-
Developer
@seb, @klaus - I think this is the fix. I also had the issue with old ERP5 instance and with this fix ERP5 site is usable (i.e. upgrade of erp5_core is possible).
https://lab.nexedi.com/Tyagov/erp5/commit/66a3705e2271afd04d48a916e11ca70037242adc
I have unit tests and when ready I make a MR
-
Developer
I waited for tests,
I merged as well another small fix, too.