Skip to content

6.4.0 version throws exceptions in Azure Functions #913

@arvindram11

Description

@arvindram11

Issue Summary

Our code which was working with the last version of SendGrid throws exception about "No module named 'ellipticcurve' when Azure Python Function is invoked.

Steps to Reproduce

  1. Deploy to Azure using requirements.txt (either sendgrid or sendgrid==6.4.0)
  2. Invoke Azure Function that imports SendGridAPIClient
  3. Exception is thrown: "Result: Failure Exception: ModuleNotFoundError: No module named 'ellipticcurve'."

Code Snippet

from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail
import logging
import os
...
...
...

Exception/Log

Result: Failure Exception: ModuleNotFoundError: No module named 'ellipticcurve'. 

Troubleshooting Guide: https://aka.ms/functions-modulenotfound
Stack: 
File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/dispatcher.py", line 259, in _handle__function_load_request func_request.metadata.entry_point)
File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 31, in call raise extend_exception_message(e, message)
File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 29, in call return func(*args, **kwargs)
File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/loader.py", line 73, in load_function mod = importlib.import_module(fullmodname) 
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level)
File "/home/site/wwwroot/MyTesting/__init__.py", line 19, in <module> from .sendgrid import sendemail
File "/home/site/wwwroot/MyTesting/sendgrid/sendemail.py", line 1, in <module> from sendgrid import SendGridAPIClient
File "/home/site/wwwroot/.python_packages/lib/site-packages/sendgrid/__init__.py", line 21, in <module> from .helpers.eventwebhook import * # noqa
File "/home/site/wwwroot/.python_packages/lib/site-packages/sendgrid/helpers/eventwebhook/__init__.py", line 1, in <module> from ellipticcurve.ecdsa import Ecdsa

Technical details:

  • sendgrid-python version: 6.4.0
  • python version: 3.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugbug in the library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions