Syncing Source for Entrust hit error: '_AppCtxGlobals' object has no attribute 'identity'
Hi there,
When I was syncing source Entrust, I got the below error:
Traceback (most recent call last):
File "/www/lemur/lemur/sources/cli.py", line 93, in sync
data = source_service.sync(source, user)
File "/www/lemur/lemur/sources/service.py", line 230, in sync
new_certs, updated_certs, updated_certs_by_hash = sync_certificates(source, user)
File "/www/lemur/lemur/sources/service.py", line 214, in sync_certificates
certificate_create(certificate, source)
File "/www/lemur/lemur/sources/service.py", line 30, in certificate_create
data, errors = CertificateUploadInputSchema().load(certificate)
File "/home/lemur/lemur/lib/python3.6/site-packages/marshmallow/schema.py", line 588, in load
result, errors = self._do_load(data, many, partial=partial, postprocess=True)
File "/home/lemur/lemur/lib/python3.6/site-packages/marshmallow/schema.py", line 670, in _do_load
index_errors=self.opts.index_errors,
File "/home/lemur/lemur/lib/python3.6/site-packages/marshmallow/marshalling.py", line 290, in deserialize
index=(index if index_errors else None)
File "/home/lemur/lemur/lib/python3.6/site-packages/marshmallow/marshalling.py", line 63, in call_and_store
value = getter_func(data)
File "/home/lemur/lemur/lib/python3.6/site-packages/marshmallow/marshalling.py", line 283, in
Syncing other sources is fine. Any idea what might be wrong?
I've tried syncing both via lemur cli and via celery task, but no difference.
@sirferl: This is the Entrust plugin. Could you see what might be wrong here?
@yiluzhu not checking always in here, so I saw this just now. Looks like postprocessing after returning the data from the plugin misses attributes in the data. I will check on monday whether I can reproduce.
Thanks, sirferl. This only happens for Entrust, other source worked fine, so I wondered if that might be related to Entrust certificate data.
@yiluzhu I tried it out in my Test-environment and there was no error. On closer examination I noticed in your log-snippet, that the error is thrown when getting the principal. I tried the test with the lemur-user account on my system. Maybe there is something wrong with the account used to perform the sync on your side.
@sirferl Thanks, that's really helpful. I'll check the account on my side.