educational-technology-collective / morf

The MOOC Replication Framework (MORF)
MIT License
16 stars 7 forks source link

Handling of unverified email address #18

Open miggyab opened 6 years ago

miggyab commented 6 years ago

Tried running: python3 execute_morf_job.py --server_config_url file:///Users/miguelandres/Documents/GitHub/morf-install/config/server.config --client_config_url file:///Users/miguelandres/Documents/GitHub/morf-install/config/client.config

Got the following error:

[INFO] retrieving file file:///Users/miguelandres/Documents/GitHub/morf-install/config/client.config to /Users/miguelandres/Documents/GitHub/morf-install/job_runner/work/tmpj41ox9kx
[INFO] uploading config.properties to s3://miggy-test1/miggy_andres/morf-api-test-session/config.properties
[INFO] retrieving file file:///Users/miguelandres/Documents/GitHub/morf/mwe/mwe.tar to /Users/miguelandres/Documents/GitHub/morf-install/job_runner/work/tmpj41ox9kx
[INFO] retrieving file file:///Users/miguelandres/Documents/GitHub/morf/mwe/controller.py to /Users/miguelandres/Documents/GitHub/morf-install/job_runner/work/tmpj41ox9kx
[INFO] uploading docker_image to s3://miggy-test1/miggy_andres/morf-api-test-session/docker_image
[INFO] uploading controller.py to s3://miggy-test1/miggy_andres/morf-api-test-session/controller.py
[WARNING] error sending email to miglimjapandres@gmail.com: An error occurred (MessageRejected) when calling the SendEmail operation: Email address is not verified. The following identities failed the check in region US-EAST-1: miglimjapandres@gmail.com, morf-alerts@umich.edu
Traceback (most recent call last):
  File "controller.py", line 29, in <module>
    from morf.workflow.evaluate import evaluate_course
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/morf/workflow/evaluate.py", line 34, in <module>
    import sklearn.metrics
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sklearn/__init__.py", line 134, in <module>
    from .base import clone
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sklearn/base.py", line 11, in <module>
    from scipy import sparse
ModuleNotFoundError: No module named 'scipy'
Traceback (most recent call last):
  File "execute_morf_job.py", line 48, in <module>
    main(args.client_config_url, args.server_config_url, args.email_to, args.no_cache)
  File "execute_morf_job.py", line 36, in main
    run_morf_job(client_config_url, server_config_url, email_to, no_cache)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/morf/utils/job_runner_utils.py", line 195, in run_morf_job
    config["job_id"], config["user_id"], config["email_to"])
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/morf/utils/alerts.py", line 136, in send_success_email
    attachment_filepath = download_from_s3(proc_data_bucket, key, s3)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/morf/utils/__init__.py", line 68, in download_from_s3
    s3.download_fileobj(bucket, key, resource)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/boto3/s3/inject.py", line 570, in download_fileobj
    return future.result()
  File "/Users/miguelandres/Library/Python/3.6/lib/python/site-packages/s3transfer/futures.py", line 73, in result
    return self._coordinator.result()
  File "/Users/miguelandres/Library/Python/3.6/lib/python/site-packages/s3transfer/futures.py", line 233, in result
    raise self._exception
  File "/Users/miguelandres/Library/Python/3.6/lib/python/site-packages/s3transfer/tasks.py", line 255, in _main
    self._submit(transfer_future=transfer_future, **kwargs)
  File "/Users/miguelandres/Library/Python/3.6/lib/python/site-packages/s3transfer/download.py", line 349, in _submit
    **transfer_future.meta.call_args.extra_args
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/botocore/client.py", line 314, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/botocore/client.py", line 612, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (404) when calling the HeadObject operation: Not Found
jpgard commented 6 years ago

This error is due to unverified email addresses; this should actually be checked before the job even runs, probably in morf_listener.py or execute_morf_job.py.

jpgard commented 6 years ago

When an unverified email address is detected, the job should print an alert and ask the user to verify their email address (by calling `verify_email_address()', and stop execution.