Adding a new incident creates the following error seemingly connected to the Google G Suite plugin.
I tried loading the private key in a simple python script (which doesn't raise the Value exception -> https://gist.github.com/unbelauscht/f347546cccedce06076aafe5a06ae89f), so its safe to assume the private key is fine.
INFO: 10.10.250.135:42228 - "POST /api/v1/incidents/ HTTP/1.1" 200 OK
web_1 | WARNING:dispatch.plugin.service:Attempted to fetch active plugin, but none were found. PluginType: participant
web_1 | ERROR:dispatch.incident.flows:Could not deserialize key data. The data may be in an incorrect format or it may be encrypted with an unsupported algorithm.
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/incident/flows.py", line 486, in incident_create_flow
web_1 | tactical_group, notification_group = create_participant_groups(
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/incident/flows.py", line 186, in create_participant_groups
web_1 | tactical_group = plugin.instance.create(
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 58, in wrapper
web_1 | result = func(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 74, in wrapper
web_1 | return func(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_google/groups/plugin.py", line 138, in create
web_1 | client = get_service("admin", "directory_v1", self.scopes)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_google/common.py", line 39, in get_service
web_1 | credentials = service_account.Credentials.from_service_account_file(
web_1 | File "/usr/local/lib/python3.8/site-packages/google/oauth2/service_account.py", line 233, in from_service_account_file
web_1 | info, signer = _service_account_info.from_filename(
web_1 | File "/usr/local/lib/python3.8/site-packages/google/auth/_service_account_info.py", line 74, in from_filename
web_1 | return data, from_dict(data, require=require)
web_1 | File "/usr/local/lib/python3.8/site-packages/google/auth/_service_account_info.py", line 55, in from_dict
web_1 | signer = crypt.RSASigner.from_service_account_info(data)
web_1 | File "/usr/local/lib/python3.8/site-packages/google/auth/crypt/base.py", line 113, in from_service_account_info
web_1 | return cls.from_string(
web_1 | File "/usr/local/lib/python3.8/site-packages/google/auth/crypt/_cryptography_rsa.py", line 133, in from_string
web_1 | private_key = serialization.load_pem_private_key(
web_1 | File "/usr/local/lib/python3.8/site-packages/cryptography/hazmat/primitives/serialization/base.py", line 20, in load_pem_private_key
web_1 | return backend.load_pem_private_key(data, password)
web_1 | File "/usr/local/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1217, in load_pem_private_key
web_1 | return self._load_key(
web_1 | File "/usr/local/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1448, in _load_key
web_1 | self._handle_key_loading_error()
web_1 | File "/usr/local/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1490, in _handle_key_loading_error
web_1 | raise ValueError(
web_1 | ValueError: Could not deserialize key data. The data may be in an incorrect format or it may be encrypted with an unsupported algorithm.
web_1 | WARNING:dispatch.plugin.service:Attempted to fetch active plugin, but none were found. PluginType: storage
web_1 | WARNING:dispatch.plugin.service:Attempted to fetch active plugin, but none were found. PluginType: conference
web_1 | WARNING:dispatch.plugin.service:Attempted to fetch active plugin, but none were found. PluginType: conversation
web_1 | WARNING:dispatch.plugin.service:Attempted to fetch active plugin, but none were found. PluginType: document
web_1 | ERROR:dispatch.decorators:Could not deserialize key data. The data may be in an incorrect format or it may be encrypted with an unsupported algorithm.
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 37, in wrapper
web_1 | result = func(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/incident/flows.py", line 694, in incident_create_flow
web_1 | send_incident_created_notifications(incident, db_session)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/incident/messaging.py", line 281, in send_incident_created_notifications
web_1 | notification_service.filter_and_send(
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/notification/service.py", line 123, in filter_and_send
web_1 | send(
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/notification/service.py", line 92, in send
web_1 | plugin.instance.send(
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 58, in wrapper
web_1 | result = func(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 74, in wrapper
web_1 | return func(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_google/gmail/plugin.py", line 79, in send
web_1 | client = get_service("gmail", "v1", self.scopes)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_google/common.py", line 39, in get_service
web_1 | credentials = service_account.Credentials.from_service_account_file(
web_1 | File "/usr/local/lib/python3.8/site-packages/google/oauth2/service_account.py", line 233, in from_service_account_file
web_1 | info, signer = _service_account_info.from_filename(
web_1 | File "/usr/local/lib/python3.8/site-packages/google/auth/_service_account_info.py", line 74, in from_filename
web_1 | return data, from_dict(data, require=require)
web_1 | File "/usr/local/lib/python3.8/site-packages/google/auth/_service_account_info.py", line 55, in from_dict
web_1 | signer = crypt.RSASigner.from_service_account_info(data)
web_1 | File "/usr/local/lib/python3.8/site-packages/google/auth/crypt/base.py", line 113, in from_service_account_info
web_1 | return cls.from_string(
web_1 | File "/usr/local/lib/python3.8/site-packages/google/auth/crypt/_cryptography_rsa.py", line 133, in from_string
web_1 | private_key = serialization.load_pem_private_key(
web_1 | File "/usr/local/lib/python3.8/site-packages/cryptography/hazmat/primitives/serialization/base.py", line 20, in load_pem_private_key
web_1 | return backend.load_pem_private_key(data, password)
web_1 | File "/usr/local/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1217, in load_pem_private_key
web_1 | return self._load_key(
web_1 | File "/usr/local/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1448, in _load_key
web_1 | self._handle_key_loading_error()
web_1 | File "/usr/local/lib/python3.8/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1490, in _handle_key_loading_error
web_1 | raise ValueError(
web_1 | ValueError: Could not deserialize key data. The data may be in an incorrect format or it may be encrypted with an unsupported algorithm.
It seems like failing to read the public key prevents dispatch from communicating with G Suite.
Hi!
Adding a new incident creates the following error seemingly connected to the Google G Suite plugin. I tried loading the private key in a simple python script (which doesn't raise the Value exception -> https://gist.github.com/unbelauscht/f347546cccedce06076aafe5a06ae89f), so its safe to assume the private key is fine.
It seems like failing to read the public key prevents dispatch from communicating with G Suite.
Dispatch Web ENV:
(please note some values are redacted)
pip freeze:
Thanks for your help!
Screenshot: