https://prefect.io logo
Title
c

Chris Gunderson

09/20/2022, 5:00 PM
Hi Team - In Blocks - Email Server Credentials. What needs to be put into the Smtp Type and smtp server for office 365?
1
a

alex

09/20/2022, 5:04 PM
Hey @Chris Gunderson! There is currently an issue with configuring the Email Server Credentials block via the UI. You can find more details in this GitHub issue. We’re hoping to resolve this issue soon and you’ll see updates in GitHub as we work on it.
c

Chris Gunderson

09/20/2022, 5:08 PM
Thanks Alex.
Hey @alex! I noticed https://github.com/PrefectHQ/prefect/pull/6818 was corrected. What are the proper variables for SMTP Type and Server?
17:09:12.547 | INFO | prefect.engine - Created flow run 'khaki-narwhal' for flow 'Fidelity Allocations' 17:09:18.532 | INFO | Flow run 'khaki-narwhal' - Created task run 'email_send_message-8f021083-0' for task 'email_send_message' 17:09:18.535 | INFO | Flow run 'khaki-narwhal' - Executing 'email_send_message-8f021083-0' immediately... 17:09:18.953 | ERROR | Task run 'email_send_message-8f021083-0' - Encountered exception during execution: Traceback (most recent call last): File "/opt/pysetup/.venv/lib/python3.9/site-packages/prefect/engine.py", line 1209, in orchestrate_task_run result = await task.fn(*args, **kwargs) File "/opt/pysetup/.venv/lib/python3.9/site-packages/prefect_email/message.py", line 116, in email_send_message with email_server_credentials.get_server() as server: File "/opt/pysetup/.venv/lib/python3.9/site-packages/prefect_email/credentials.py", line 138, in get_server server = SMTP_SSL(smtp_server, smtp_port, context=context) File "/usr/local/lib/python3.9/smtplib.py", line 1050, in init SMTP.__init__(self, host, port, local_hostname, timeout, File "/usr/local/lib/python3.9/smtplib.py", line 255, in init (code, msg) = self.connect(host, port) File "/usr/local/lib/python3.9/smtplib.py", line 341, in connect self.sock = self._get_socket(host, port, self.timeout) File "/usr/local/lib/python3.9/smtplib.py", line 1057, in _get_socket new_socket = self.context.wrap_socket(new_socket, File "/usr/local/lib/python3.9/ssl.py", line 501, in wrap_socket return self.sslsocket_class._create( File "/usr/local/lib/python3.9/ssl.py", line 1041, in _create self.do_handshake() File "/usr/local/lib/python3.9/ssl.py", line 1310, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129) 17:09:19.036 | ERROR | Task run 'email_send_message-8f021083-0' - Finished in state Failed('Task run encountered an exception.')
^^ I tried a new test block and got the same result
a

alex

09/22/2022, 2:01 AM
That PR has been merged, but it has not been released yet. This issue should be fixed in the next release.
c

Chris Gunderson

09/22/2022, 12:43 PM
Thanks Alex. Is there a bi-weekly release, or what is Prefect's release schedule?
a

alex

09/22/2022, 1:23 PM
We release new versions of Prefect weekly.
👍 1
c

Chris Gunderson

09/23/2022, 4:50 PM
Hi @alex - I thought this was a part of the Prefect 2.4.1 or 2.4.2 release. I'm getting this error: 1:48:10.677 | INFO | Flow run 'blond-barracuda' - Created task run 'email_send_message-8f021083-0' for task 'email_send_message' 11:48:10.678 | INFO | Flow run 'blond-barracuda' - Executing 'email_send_message-8f021083-0' immediately... 11:48:11.066 | ERROR | Task run 'email_send_message-8f021083-0' - Encountered exception during execution: Traceback (most recent call last): File "/opt/pysetup/.venv/lib/python3.9/site-packages/prefect/engine.py", line 1214, in orchestrate_task_run result = await task.fn(*args, **kwargs) File "/opt/pysetup/.venv/lib/python3.9/site-packages/prefect_email/message.py", line 116, in email_send_message with email_server_credentials.get_server() as server: File "/opt/pysetup/.venv/lib/python3.9/site-packages/prefect_email/credentials.py", line 138, in get_server server = SMTP_SSL(smtp_server, smtp_port, context=context) File "/usr/local/lib/python3.9/smtplib.py", line 1050, in init SMTP.__init__(self, host, port, local_hostname, timeout, File "/usr/local/lib/python3.9/smtplib.py", line 255, in init (code, msg) = self.connect(host, port) File "/usr/local/lib/python3.9/smtplib.py", line 341, in connect self.sock = self._get_socket(host, port, self.timeout) File "/usr/local/lib/python3.9/smtplib.py", line 1057, in _get_socket new_socket = self.context.wrap_socket(new_socket, File "/usr/local/lib/python3.9/ssl.py", line 501, in wrap_socket return self.sslsocket_class._create( File "/usr/local/lib/python3.9/ssl.py", line 1041, in _create self.do_handshake() File "/usr/local/lib/python3.9/ssl.py", line 1310, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129) 11:48:11.159 | ERROR | Task run 'email_send_message-8f021083-0' - Finished in state Failed('Task run encountered an exception.')
a

alex

09/23/2022, 5:18 PM
Hey @Chris Gunderson, it looks like the Prefect Cloud UI has not been updated with the most recent release yet. If you look at the UI on a local Orion server, you can see what this input will look like once the update is made.
c

Chris Gunderson

09/23/2022, 5:19 PM
Thank you Alex