Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flask执行异常(light分支) #35

Open
gaoyifan opened this issue Mar 19, 2017 · 8 comments
Open

flask执行异常(light分支) #35

gaoyifan opened this issue Mar 19, 2017 · 8 comments

Comments

@gaoyifan
Copy link
Member

在后台点击pass按钮时报调用栈:

10.254.0.252 - - [19/Mar/2017 21:10:32] "POST /pass/199 HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/flask/app.py", line 2000, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/lib/python3.5/site-packages/flask/app.py", line 1991, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/lib/python3.5/site-packages/flask/app.py", line 1567, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/lib/python3.5/site-packages/flask/app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3.5/site-packages/flask/app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3.5/site-packages/flask/app.py", line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/lib/python3.5/site-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.5/site-packages/flask/app.py", line 1625, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python3.5/site-packages/flask_login.py", line 792, in decorated_view
    return func(*args, **kwargs)
  File "/srv/lugvpn-web/app/views.py", line 163, in pass_
    send_mail('Your application has passed', html, user.email)
  File "/srv/lugvpn-web/app/mail.py", line 11, in send_mail
    mail.send(msg)
  File "/usr/lib/python3.5/site-packages/flask_mail.py", line 491, in send
    with self.connect() as connection:
  File "/usr/lib/python3.5/site-packages/flask_mail.py", line 144, in __enter__
    self.host = self.configure_host()
  File "/usr/lib/python3.5/site-packages/flask_mail.py", line 158, in configure_host
    host = smtplib.SMTP(self.mail.server, self.mail.port)
  File "/usr/lib/python3.5/smtplib.py", line 251, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/lib/python3.5/smtplib.py", line 335, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/lib/python3.5/smtplib.py", line 306, in _get_socket
    self.source_address)
  File "/usr/lib/python3.5/socket.py", line 693, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/lib/python3.5/socket.py", line 732, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

有时间看一下吗? @zzh1996

@zzh1996
Copy link
Member

zzh1996 commented Mar 19, 2017

@gaoyifan SMTP服务器的域名解析失败

@zzh1996 zzh1996 closed this as completed Mar 19, 2017
@gaoyifan
Copy link
Member Author

@zzh1996 我当时也怀疑是这个原因。因此在出错后立即用web界面发了一封邮件,发送正常。

@zzh1996
Copy link
Member

zzh1996 commented Mar 19, 2017

@gaoyifan 就是偶然事件?DNS包丢了?

@gaoyifan
Copy link
Member Author

@zzh1996 maybe… 先不管这个问题了,如果复现再说

@gaoyifan
Copy link
Member Author

gaoyifan commented Mar 20, 2017

@zzh1996 找到问题了,light上配置的DNS是:10.254.0.253, 202.38.95.74
其中202.38.95.74是boj的DNS,独立于LUG,然而跪了..... 目前已换成202.38.93.94

@gaoyifan
Copy link
Member Author

今天这个问题又复现了,调用栈相同,日志就不贴了。
@zzh1996 能否在发邮件时增加一个重试逻辑,失败后重试两三次?

@gaoyifan gaoyifan reopened this Mar 24, 2017
@gaoyifan
Copy link
Member Author

gaoyifan commented Mar 24, 2017

或者在邮件发送失败时撤销之前做的操作(事务)

@zzh1996
Copy link
Member

zzh1996 commented Mar 24, 2017

好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants