huggingface / knockknock

🚪✊Knock Knock: Get notified when your training ends with only two additional lines of code
MIT License
2.78k stars 233 forks source link

Timeout #66

Open Betristor opened 3 years ago

Betristor commented 3 years ago

Hello, Thank you for creating this project for getting notified. This works well on my laptop but when I try to get notified when my code runs on jupyter via email, this problem happened.

~/.local/lib/python3.7/site-packages/knockknock/email_sender.py in wrapper_sender(*args, *kwargs) 51 for i in range(len(recipient_emails)): 52 current_recipient = recipient_emails[i] ---> 53 yag_sender.send(current_recipient, 'Training has started 🎬', contents) 54 try: 55 value = func(args, **kwargs)

~/.local/lib/python3.7/site-packages/yagmail/sender.py in send(self, to, subject, contents, attachments, cc, bcc, preview_only, headers, prettify_html, message_id, group_messages) 151 ): 152 """ Use this to send an email with gmail""" --> 153 self.login() 154 recipients, msg_string = self.prepare_send( 155 to,

~/.local/lib/python3.7/site-packages/yagmail/sender.py in login(self) 204 self._login_oauth2(self.credentials) 205 else: --> 206 self._login(self.credentials) 207 208 def _login(self, password):

~/.local/lib/python3.7/site-packages/yagmail/sender.py in _login(self, password) 211 connection to the SMTP server was closed by the user. 212 """ --> 213 self.smtp = self.connection(self.host, self.port, **self.kwargs) 214 self.smtp.set_debuglevel(self.debuglevel) 215 if self.starttls:

/opt/tljh/user/lib/python3.7/smtplib.py in init(self, host, port, local_hostname, keyfile, certfile, timeout, source_address, context) 1029 self.context = context 1030 SMTP.init(self, host, port, local_hostname, timeout, -> 1031 source_address) 1032 1033 def _get_socket(self, host, port, timeout):

/opt/tljh/user/lib/python3.7/smtplib.py in init(self, host, port, local_hostname, timeout, source_address) 249 250 if host: --> 251 (code, msg) = self.connect(host, port) 252 if code != 220: 253 self.close()

/opt/tljh/user/lib/python3.7/smtplib.py in connect(self, host, port, source_address) 334 if self.debuglevel > 0: 335 self._print_debug('connect:', (host, port)) --> 336 self.sock = self._get_socket(host, port, self.timeout) 337 self.file = None 338 (code, msg) = self.getreply()

/opt/tljh/user/lib/python3.7/smtplib.py in _get_socket(self, host, port, timeout) 1035 self._print_debug('connect:', (host, port)) 1036 new_socket = socket.create_connection((host, port), timeout, -> 1037 self.source_address) 1038 new_socket = self.context.wrap_socket(new_socket, 1039 server_hostname=self._host)

/opt/tljh/user/lib/python3.7/socket.py in create_connection(address, timeout, source_address) 726 if err is not None: 727 try: --> 728 raise err 729 finally: 730 # Break explicitly a reference cycle

/opt/tljh/user/lib/python3.7/socket.py in create_connection(address, timeout, source_address) 714 if source_address: 715 sock.bind(source_address) --> 716 sock.connect(sa) 717 # Break explicitly a reference cycle 718 err = None

I turned my new backup google account' safety option off as instruction offered on https://pypi.org/project/knockknock/ but this happened and search on this issue has no results, so here it goes.

My recipants_emails is firstly set to my private email which is not of gmail, after error above occured, I changed it to my previous google account and this time keyrings.alt dependency is needed but enve if this is satisfied the error occured again. Now I'm helpless. Can anyone explain why this happened and how can I solve it? Much thanks!