Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log Acoustic sync errors for better troubleshooting #581

Closed
leplatrem opened this issue Mar 8, 2023 · 1 comment · Fixed by #587
Closed

Log Acoustic sync errors for better troubleshooting #581

leplatrem opened this issue Mar 8, 2023 · 1 comment · Fixed by #587
Assignees
Labels
enhancement New feature or request

Comments

@leplatrem
Copy link
Contributor

Ref #575
Ref #569

Currently, we count the number of retries when a record fails to be sync to Acoustic, but we don't log/save the error. This makes troubleshooting impossible.

@leplatrem leplatrem self-assigned this Mar 8, 2023
@leplatrem leplatrem added the enhancement New feature or request label Mar 8, 2023
@leplatrem
Copy link
Contributor Author

Some errors spotted in the logs...

{"Timestamp": 1678252967754000896, "Type": "ctms.sync", "Logger": "ctms", "Hostname": "ctms-background-6c47f6f8b-zwjwj", "EnvVersion": "2.0", "Severity": 3, "Pid": 1, "Fields": {"msg": "Error executing sync.sync_contact_with_acoustic", "error": "XMLSyntaxError('Space required after the Public Identifier, line 1, column 50')", "traceback": "Uncaught exception:
  File \"/app/ctms/sync.py\", line 69, in sync_contact_with_acoustic
    return self.ctms_to_acoustic.attempt_to_upload_ctms_contact(
      File \"/app/ctms/acoustic_service.py\", line 420, in attempt_to_upload_ctms_contact
    self._add_contact(
      File \"/app/ctms/acoustic_service.py\", line 353, in _add_contact
    self.acoustic.add_recipient(**params)  # Call to Acoustic
  File \"<string>\", line 2, in add_recipient
  File \"/opt/pysetup/.venv/lib/python3.10/site-packages/silverpop/api.py\", line 44, in wrapper
    return self._call(tree)
  File \"/app/ctms/acoustic_service.py\", line 112, in _call
    return self._process_response(response)
  File \"/app/ctms/acoustic_service.py\", line 86, in _process_response
    response = etree.fromstring(resp.text.encode(\"utf-8\"))
  File \"src/lxml/etree.pyx\", line 3257, in lxml.etree.fromstring
  File \"src/lxml/parser.pxi\", line 1916, in lxml.etree._parseMemoryDocument
  File \"src/lxml/parser.pxi\", line 1803, in lxml.etree._parseDoc
  File \"src/lxml/parser.pxi\", line 1144, in lxml.etree._BaseParser._parseDoc
  File \"src/lxml/parser.pxi\", line 618, in lxml.etree._ParserContext._handleParseResultDoc
  File \"src/lxml/parser.pxi\", line 728, in lxml.etree._handleParseResult
  File \"src/lxml/parser.pxi\", line 657, in lxml.etree._raiseParseError
<class 'lxml.etree.XMLSyntaxError'>
XMLSyntaxError('Space required after the Public Identifier, line 1, column 50')
"}}
Traceback (most recent call last):
  File \"/app/ctms/acoustic_service.py\", line 420, in attempt_to_upload_ctms_contact
    self._add_contact(
      File \"/app/ctms/acoustic_service.py\", line 353, in _add_contact
    self.acoustic.add_recipient(**params)  # Call to Acoustic
  File \"<string>\", line 2, in add_recipient
  File \"/opt/pysetup/.venv/lib/python3.10/site-packages/silverpop/api.py\", line 44, in wrapper
    return self._call(tree)
  File \"/app/ctms/acoustic_service.py\", line 112, in _call
    return self._process_response(response)
  File \"/app/ctms/acoustic_service.py\", line 94, in _process_response
    raise SilverpopResponseException(fault.text)
silverpop.api.SilverpopResponseException: Email Address Is Invalid.

leplatrem added a commit that referenced this issue Mar 14, 2023
* Remove superfluous method in sync service

* Rely on exceptions instead of booleans to pop-up errors

* Use structlog everywhere

* Log primary email domain on error

* Store last sync error in DB

* Add clarification comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant