DostEducation / RP_IVR_analytics

This is a cloud function based webhook processing service that is being using to get webhook calls from RapidPro to capture different analytical data point.
GNU Affero General Public License v3.0
4 stars 1 forks source link

Python based error occurring while processing requests on RP_IVR analytics #484

Closed Sachinbisht27 closed 5 months ago

Sachinbisht27 commented 5 months ago

Describe the bug We are getting some Python-level error logs on the logging and monitoring dashboard for the RP_IVR cloud function.

Add diagnosis details

Issue logs:

Error 1:

  File "/layers/google.python.pip/pip/lib/python3.11/site-packages/functions_framework/__init__.py", line 361, in create_app
    spec.loader.exec_module(source_module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/workspace/main.py", line 2, in <module>
    from api import app, helpers, services, models
  File "/workspace/api/helpers/__init__.py", line 2, in <module>
    from .db_helper import *
  File "/workspace/api/helpers/db_helper.py", line 3, in <module>
    from utils.loggingutils import logger
  File "/workspace/utils/__init__.py", line 1, in <module>
    from .loggingutils import *
  File "/workspace/utils/loggingutils.py", line 13, in <module>
    log_client = gcloud_logging.Client() 

Error 2:

 File "/layers/google.python.pip/pip/lib/python3.11/site-packages/flask/app.py", line 1478, in __call__
    return self.wsgi_app(environ, start_response)"

Expected behavior

Screenshots

Screenshot 2024-06-12 at 7 23 18 PM

Impact Error logs count: 30

Criticality Medium

Acceptance Criteria

Documentation Add whatever documentation will be required here.

Sachinbisht27 commented 5 months ago

Diagnosis Details

Description:

To reproduce: Try to replicate the production environment locally and generate Application-level logs.

Root cause The google-cloud-logging package had dependency issues with the Python flask.

Action items

Steps to fix:

Sachinbisht27 commented 5 months ago

Closing this Item as the Diagnosis is completed and the Action items to fix the issue are figured out. We will be targeting the action item in a separate issue. #485