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

自动部署的,点击重置密码 出来 的是Server Error (500) #36

Open
z15858167 opened this issue Aug 26, 2023 · 11 comments
Open

Comments

@z15858167
Copy link

AD 域服务器安装证书服务了,里面也有颁发的证书。不知道这样是不是就可以使用636了。conf里的文件也修改了。授权的用户也添加了修改密码的权限 。但我感觉server error 500应该是没跟AD域连接成功。

@z15858167
Copy link
Author

还有,/etc/init.d/uwsigserver start 需要执行两遍。才可以启动服务。

@z15858167
Copy link
Author

DC=test,DC=local

@capricornxl
Copy link
Owner

看下日志的报错内容是啥,500和AD没关系,服务本身启动有问题。

@z15858167
Copy link
Author

没想到大佬立刻回复了,我看看

@z15858167
Copy link
Author

2023-08-26 13:06:43,386 ERROR ./resetpwd/views.py views.index 60: [异常] 请求方法:POST,请求路径/
2023-08-26 13:06:43,394 ERROR /usr/share/python-3.8.9/lib/python3.8/site-packages/django/utils/log.py log.log_response 224: Internal Server Error: /
Traceback (most recent call last):
File "/usr/share/python-3.8.9/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/share/python-3.8.9/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "./resetpwd/views.py", line 74, in index
_msg = check_form.as_p().errors
AttributeError: 'SafeString' object has no attribute 'errors'
2023-08-26 14:23:54,878 ERROR ./resetpwd/views.py views.index 60: [异常] 请求方法:POST,请求路径/
2023-08-26 14:23:54,881 ERROR /usr/share/python-3.8.9/lib/python3.8/site-packages/django/utils/log.py log.log_response 224: Internal Server Error: /
Traceback (most recent call last):
File "/usr/share/python-3.8.9/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/share/python-3.8.9/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "./resetpwd/views.py", line 74, in index
_msg = check_form.as_p().errors
AttributeError: 'SafeString' object has no attribute 'errors'

@z15858167
Copy link
Author

是点击 提交后返回500

@capricornxl
Copy link
Owner

看着像是BUG,你把
./resetpwd/views.py的第74行
_msg = check_form.as_p().errors
这里的check_form.as_p().errors改成check_form.as_p(),然后再重启下uwsgiserver。

@z15858167
Copy link
Author

修改完了之后,后报错日志
[root@localhost log]# tail -f log.log
2023-08-26 15:19:58,147 ERROR ./resetpwd/views.py views.index 60: [异常] 请求方法:POST,请求路径/
2023-08-26 15:19:58,155 ERROR /usr/share/python-3.8.9/lib/python3.8/site-packages/django/utils/log.py log.log_response 224: Internal Server Error: /
Traceback (most recent call last):
File "/usr/share/python-3.8.9/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/share/python-3.8.9/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "./resetpwd/views.py", line 75, in index
logger.error('[异常] 请求方法:%s,请求路径:%s,错误信息:%s' % (request.method, request.path, _msg))
NameError: name '_msg' is not defined
2023-08-26 15:21:02,869 ERROR ./resetpwd/views.py views.index 60: [异常] 请求方法:POST,请求路径/
2023-08-26 15:21:02,872 ERROR /usr/share/python-3.8.9/lib/python3.8/site-packages/django/utils/log.py log.log_response 224: Internal Server Error: /
Traceback (most recent call last):
File "/usr/share/python-3.8.9/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/share/python-3.8.9/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "./resetpwd/views.py", line 75, in index
logger.error('[异常] 请求方法:%s,请求路径:%s,错误信息:%s' % (request.method, request.path, _msg))
NameError: name '_msg' is not defined

@capricornxl
Copy link
Owner

看下你改的地方,你是不是把这一行都改掉了?
是把_msg = check_form.as_p().errors改成_msg = check_form.as_p()

@z15858167
Copy link
Author

z15858167 commented Aug 26, 2023

73 else:
74 _msg = check_form.as_p()
75 logger.error('[异常] 请求方法:%s,请求路径:%s,错误信息:%s' % (request.method, request.path, _msg))后

2023-08-26 17:02:33,914 ERROR ./resetpwd/views.py views.index 60: [异常] 请求方法:POST,请求路径/
2023-08-26 17:02:33,919 ERROR ./resetpwd/views.py views.index 75: [异常] 请求方法:POST,请求路径:/,错误信息:

  • 新密码和确认密码输入不一致

  • 密码长度不能小于8个字符
  • 密码必须包含数字,字母、特殊字符

New password:

Old password:

Ensure password:

Username:

密码输入的符合规则 的

@capricornxl
Copy link
Owner

你现在改完之后的代码是什么样的?
check_form看着在你的代码里是失效了。

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