-
Type: Story
-
Status: To Do (View Workflow)
-
Priority: Medium
-
Resolution: Unresolved
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Story Points:3
-
Epic Link:
We see these errors in the core container often during service development:
Traceback (most recent call last):
File "./core_main.py", line 10, in <module>
from grpc_server import XOSGrpcServer, restart_chameleon
File "/opt/xos/coreapi/grpc_server.py", line 33, in <module>
from xos_grpc_api import XosService
File "/opt/xos/coreapi/xos_grpc_api.py", line 11, in <module>
class XosService(xos_pb2.xosServicer, XOSAPIHelperMixin):
AttributeError: 'module' object has no attribute 'xosServicer'
cd ../../tools/apigen && python ./modelgen -a "*" protobuf.template.txt > /opt/xos/coreapi/protos/xos.proto
Traceback (most recent call last):
File "./modelgen", line 368, in <module>
main()
File "./modelgen", line 331, in main
generator.add_object(m)
File "./modelgen", line 181, in add_object
obj = GenObj(o)
File "./modelgen", line 130, in _init_
self.content_type_id = ContentType.objects.get_for_model(m).id
File "/usr/local/lib/python2.7/dist-packages/django/contrib/contenttypes/models.py", line 80, in get_for_model
"Error creating new content types. Please make sure contenttypes "
RuntimeError: Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually.
make: *** [rebuild-protos] Error 1
The core container will fail and restart indefinitely. It may eventually succeed, and I suspect it may be waiting for migration to complete.
I think this task is primarily to harden the modelgen tool and/or the grpc server to report useful errors.
This error was reported in CORD-3.0. It may or may not be present in Shared Delusion, given that there has been refactoring of the modelgen pipeline.