Giter Club home page Giter Club logo

Comments (4)

VictorSanh avatar VictorSanh commented on May 31, 2024

Hmm that's strange indeed. I am solely working on instances on the cloud and have never encountered this problem.
It seems the bug stems from yagmail, and more specifically when it calls keyring (the password manager). I have to look at it more precisely...

from knockknock.

BramVanroy avatar BramVanroy commented on May 31, 2024

Hmm that's strange indeed. I am solely working on instances on the cloud and have never encountered this problem.
It seems the bug stems from yagmail, and more specifically when it calls keyring (the password manager). I have to look at it more precisely...

If it matters, I am using Ubuntu 18.04.2 LTS x86_64.

from knockknock.

rameshjes avatar rameshjes commented on May 31, 2024

Hello @VictorSanh I am also facing same issue. I am running code in cluster with OS Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-161-generic x86_64) :

from knockknock import email_sender

@email_sender(recipient_emails=["[email protected]"], sender_email="[email protected]")
def train_your_nicest_model():
    import time
    time.sleep(300)
    return {'loss': 0.9} # Optional return value

train_your_nicest_model()

I am getting following error:

Traceback (most recent call last):
  File "knockknock_example.py", line 9, in <module>
    train_your_nicest_model()
  File "/home/ramesh/.virtualenvs/code_of_conduct_env/lib/python3.6/site-packages/knockknock/email_sender.py", line 53, in wrapper_sender
    yag_sender.send(current_recipient, 'Training has started 🎬', contents)
  File "/home/ramesh/.virtualenvs/code_of_conduct_env/lib/python3.6/site-packages/yagmail/sender.py", line 147, in send
    self.login()
  File "/home/ramesh/.virtualenvs/code_of_conduct_env/lib/python3.6/site-packages/yagmail/sender.py", line 246, in login
    self._login(self.credentials)
  File "/home/ramesh/.virtualenvs/code_of_conduct_env/lib/python3.6/site-packages/yagmail/sender.py", line 192, in _login
    self.smtp = self.connection(self.host, self.port, **self.kwargs)
  File "/usr/lib/python3.6/smtplib.py", line 1031, in __init__
    source_address)
  File "/usr/lib/python3.6/smtplib.py", line 251, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/lib/python3.6/smtplib.py", line 336, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/lib/python3.6/smtplib.py", line 1037, in _get_socket
    self.source_address)
  File "/usr/lib/python3.6/socket.py", line 724, in create_connection
    raise err
  File "/usr/lib/python3.6/socket.py", line 713, in create_connection
    sock.connect(sa)
OSError: [Errno 101] Network is unreachable

from knockknock.

VictorSanh avatar VictorSanh commented on May 31, 2024

Hello @VictorSanh I am also facing same issue. I am running code in cluster with OS Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-161-generic x86_64) :

from knockknock import email_sender

@email_sender(recipient_emails=["[email protected]"], sender_email="[email protected]")
def train_your_nicest_model():
    import time
    time.sleep(300)
    return {'loss': 0.9} # Optional return value

train_your_nicest_model()

I am getting following error:

Traceback (most recent call last):
  File "knockknock_example.py", line 9, in <module>
    train_your_nicest_model()
  File "/home/ramesh/.virtualenvs/code_of_conduct_env/lib/python3.6/site-packages/knockknock/email_sender.py", line 53, in wrapper_sender
    yag_sender.send(current_recipient, 'Training has started 🎬', contents)
  File "/home/ramesh/.virtualenvs/code_of_conduct_env/lib/python3.6/site-packages/yagmail/sender.py", line 147, in send
    self.login()
  File "/home/ramesh/.virtualenvs/code_of_conduct_env/lib/python3.6/site-packages/yagmail/sender.py", line 246, in login
    self._login(self.credentials)
  File "/home/ramesh/.virtualenvs/code_of_conduct_env/lib/python3.6/site-packages/yagmail/sender.py", line 192, in _login
    self.smtp = self.connection(self.host, self.port, **self.kwargs)
  File "/usr/lib/python3.6/smtplib.py", line 1031, in __init__
    source_address)
  File "/usr/lib/python3.6/smtplib.py", line 251, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/lib/python3.6/smtplib.py", line 336, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/lib/python3.6/smtplib.py", line 1037, in _get_socket
    self.source_address)
  File "/usr/lib/python3.6/socket.py", line 724, in create_connection
    raise err
  File "/usr/lib/python3.6/socket.py", line 713, in create_connection
    sock.connect(sa)
OSError: [Errno 101] Network is unreachable

@rameshjesswani, are you sure it's the same error? It looks like it's something different causing your error... Did you make sure you gave yagmail access to the email you're using? (see here).

from knockknock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.