django异常日志_django uwsgi 错误日志分析例子
uwsgi 启动时就报错
一般能看到:--- no python application found, check your startup logs for errors ---,基本上是配置出错了,无法正常启动 uwsgi。
有用日志信息(每次启动 uwsgi 的时候就会有启动的日志产生,如果出错了就在这块找找):
*** Operational MODE: preforking ***
failed to open python file /root/yzq/djangos/testdata/Testdata/wsgi.py
unable to load app 0 (mountpoint='') (callable not found or import error)
它说 /root/yzq/djangos/testdata/Testdata/wsgi.py 这个路径打开失败,我这里是路径写错了,少写了一级。
*** Operational MODE: preforking ***
failed to open python file /root/yzq/djangos/testdata/Testdata/wsgi.py
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 25141)
spawned uWSGI worker 1 (pid: 25142, cores: 1)
spawned uWSGI worker 2 (pid: 25143, cores: 1)
*** Stats server enabled on 127.0.0.1:9193 fd: 11 ***
...brutally killing workers...
worker 1 buried after 1 seconds
worker 2 buried after 1 seconds
binary reloading uWSGI...
chdir() to /root/yzq/configs
closing all non-uwsgi socket fds > 2 (max_fd = 100001)...
found fd 3 mapped to socket 0 (127.0.0.1:9092)
running /root/.virtualenvs/blog/bin/uwsgi
[uWSGI] getting INI configuration from /root/yzq/configs/testdata_uwsgi.ini
*** Starting uWSGI 2.0.17 (64bit) on [Fri Feb 15 21:31:14 2019] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-16) on 04 April 2018 04:11:16
os: Linux-3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017
nodename: VM_2_29_centos
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 1
current working directory: /root/yzq/configs
detected binary path: /root/.virtualenvs/blog/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
chdir() to /root/yzq/djangos/testdata
your processes number limit is 7283
your memory page size is 4096 bytes
detected max file descriptor number: 100001
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 inherited INET address 127.0.0.1:9092 fd 3
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Python version: 3.6.4 (default, Mar 16 2018, 22:27:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
Set PythonHome to /root/.virtualenvs/testdata
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x28f9820
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 304776 bytes (297 KB) for 2 cores
*** Operational MODE: preforking ***
failed to open python file /root/yzq/djangos/testdata/Testdata/wsgi.py
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** uWSGI is running in multiple interpreter mode ***
gracefully (RE)spawned uWSGI master process (pid: 25141)
spawned uWSGI worker 1 (pid: 27985, cores: 1)
spawned uWSGI worker 2 (pid: 27986, cores: 1)
*** Stats server enabled on 127.0.0.1:9193 fd: 11 ***
*** Starting uWSGI 2.0.17 (64bit) on [Fri Feb 15 21:32:11 2019] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-16) on 04 April 2018 04:11:16
os: Linux-3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017
nodename: VM_2_29_centos
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 1
current working directory: /
writing pidfile to /root/yzq/running/uwsgi_testdata.pid
detected binary path: /root/.virtualenvs/blog/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
chdir() to /root/yzq/djangos/testdata
your processes number limit is 7283
your memory page size is 4096 bytes
detected max file descriptor number: 1000000
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 127.0.0.1:9092 fd 3
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Python version: 3.6.4 (default, Mar 16 2018, 22:27:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
Set PythonHome to /root/.virtualenvs/testdata
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x17141f0
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 304776 bytes (297 KB) for 2 cores
*** Operational MODE: preforking ***
failed to open python file /root/yzq/djangos/testdata/Testdata/wsgi.py
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 527)
spawned uWSGI worker 1 (pid: 541, cores: 1)
spawned uWSGI worker 2 (pid: 542, cores: 1)
*** Stats server enabled on 127.0.0.1:9193 fd: 11 ***
--- no python application found, check your startup logs for errors ---
[pid: 541|app: -1|req: -1/1] 193.112.40.139 () {32 vars in 365 bytes} [Fri Feb 15 21:36:07 2019] GET / => generated 21 bytes i
n 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
--- no python application found, check your startup logs for errors ---
[pid: 541|app: -1|req: -1/2] 193.112.40.139 () {32 vars in 365 bytes} [Fri Feb 15 21:36:10 2019] GET / => generated 21 bytes i
n 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
uwsgi 正常启动,访问相关视图才报错
日志里明确的得到有用信息:
django.urls.exceptions.NoReverseMatch: Reverse for 'detail' with arguments '('',)' not found. 1 pattern(s) tried: ['article/(?
P[0-9]+)/$']
路由缺少参数,我这个问题是因为缓存没更新引起的。具体情况是,django 新模板代码 拿到旧的数据结构(因为是缓存数据-旧的数据结构,缓存时长 12H)去解析导致的,只需要进入缓存,把 key 删除就可以,或者换个新 key。
[pid: 11774|app: 0|req: 420/491] 111.206.221.40 () {44 vars in 1222 bytes} [Wed Dec 25 20:06:17 2019] GET /like_get/?cur_url=http%3A%2F%2Fzhuoqun.info%2Farticle%2F215%2F&article_id=215&csrfmiddlewaretoken=DcI4hLPyMtwaL5hutjx1s5KnfUTEWcWBudwwYYk9iyHu8iI2IQQ1Ez1saXXeY3WZ => generated 242 bytes in 44 msecs (HTTP/1.1 200) 3 headers in 101 bytes (1 switches on core 2)
[pid: 11775|app: 0|req: 72/492] 111.206.221.104 () {50 vars in 1101 bytes} [Wed Dec 25 20:06:17 2019] POST /visit_web/ => generated 1342 bytes in 25 msecs (HTTP/1.1 403) 3 headers in 102 bytes (1 switches on core 3)
django.security.csrf: 2019-12-25 20:06:17,771 /root/.virtualenvs/blog/lib/python3.6/site-packages/django/middleware/csrf.py [l
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/base.py", line 990, in render
bit = node.render_annotated(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated
return self.render(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/loader_tags.py", line 72, in render
result = block.nodelist.render(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/base.py", line 990, in render
bit = node.render_annotated(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated
return self.render(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/loader_tags.py", line 72, in render
result = block.nodelist.render(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/base.py", line 990, in render
bit = node.render_annotated(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated
return self.render(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/library.py", line 245, in render
return t.render(new_context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/base.py", line 209, in render
return self._render(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/base.py", line 199, in _render
return self.nodelist.render(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/base.py", line 990, in render
bit = node.render_annotated(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated
return self.render(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/defaulttags.py", line 216, in render
nodelist.append(node.render_annotated(context))
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated
return self.render(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/defaulttags.py", line 322, in render
return nodelist.render(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/base.py", line 990, in render
bit = node.render_annotated(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/base.py", line 957, in render_annotated
return self.render(context)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/template/defaulttags.py", line 458, in render
url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/urls/base.py", line 91, in reverse
return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))
File "/root/.virtualenvs/blog/lib/python3.6/site-packages/django/urls/resolvers.py", line 497, in _reverse_with_prefix
raise NoReverseMatch(msg)
django.urls.exceptions.NoReverseMatch: Reverse for 'detail' with arguments '('',)' not found. 1 pattern(s) tried: ['article/(?
P[0-9]+)/$']
[pid: 9439|app: 0|req: 19/23] 223.166.75.193 () {46 vars in 779 bytes} [Wed Dec 25 00:57:26 2019] GET / => generated 2073 byte
s in 624 msecs (HTTP/1.1 200) 5 headers in 278 bytes (1 switches on core 2)
[pid: 9439|app: 0|req: 20/24] 124.225.47.166 () {42 vars in 781 bytes} [Wed Dec 25 00:57:28 2019] GET /favicon.ico => generate
d 0 bytes in 11 msecs (HTTP/1.1 301) 4 headers in 160 bytes (1 switches on core 3)
django异常日志_django uwsgi 错误日志分析例子相关推荐
- MySQL日志 - Error Log错误日志
MySQL日志历史文章, <MySQL日志 - General Query Log> MySQL的错误日志,是我们排查问题的主要线索之一,引用GreatSQL技术社区的这篇文章<图文 ...
- 配置php.ini文件,关闭错误提示,打开错误日志,设置错误日志路径(亲测)
配置php.ini文件,关闭错误提示,打开错误日志,设置错误日志路径 打开php.ini配置文件: 找到display_errors = On:修改为:display_errors = Off: 找到 ...
- MySQL日志文件之错误日志和慢查询日志详解
今天天气又开始变得很热了,虽然很热很浮躁,但是不能不学习,我在北京向各位问好.今天给大家分享一点关于数据库日志方面的东西,因为日志不仅讨厌而且还很重要,在开发中时常免不了与它的亲密接触,就在前几天公司 ...
- django异常日志_django 捕获异常和日志系统过程详解
这一块的内容很少, 异常使用try except即可, 日志只需要几行配置. 使用装饰器捕获方法内的所有异常 我使用装饰器来整个包裹一个方法, 捕获方法中的所有异常信息.并将其转为json返回客户端. ...
- mysql5.6 错误日志_MySQL5.6.36 日志文件之错误日志,二进制日志,慢日志
(一)错误日志配置 vim /etc/my.cnf log-error=/var/log/mysql.log 查找错误日志位置 show variables like '%log_error%' 一般 ...
- mysql之 日志体系(错误日志、查询日志、二进制日志、事务日志、中继日志)...
一. mysql错误日志: 错误日志记录的事件: a).服务器启动关闭过程中的信息 b).服务器运行过程中的错误信息 c).事件调试器运行一个事件时间生的信息 d).在从服务器上启动从服务器进程时产生 ...
- mysql错误日志为aborting_MySQL 错误日志(Error Log)
同大多数关系型数据库一样,日志文件是MySQL数据库的重要组成部分.MySQL有几种不同的日志文件.通常包括错误日志文件,二进制日志,通用日志,慢查询日志,等等. 这些日志能够帮助我们定位mysqld ...
- python try catch打印到日志_django 捕获异常和日志系统过程详解
这一块的内容很少, 异常使用try except即可, 日志只需要几行配置. 使用装饰器捕获方法内的所有异常 我使用装饰器来整个包裹一个方法, 捕获方法中的所有异常信息.并将其转为json返回客户端. ...
- php慢日志 格式,php慢日志记录和错误日志(转)
php的日志是值得关注的,包含错误日志和慢日志 一 错误输出 找到php.ini log_errors = On ; Log errors to specified file. error_log = ...
最新文章
- Eclipse中SVN设置文件为ignore后重新添加至版本控制
- ajax+php+jq+面向对象,php+jquery+ajax+json的一个最简单实例
- SharePoint 出现无法识别的属性“type”
- Visual Studio中检测内存泄漏的方法(一)
- apache OFBiz的安装
- Linux进程全解5——父子进程对文件的操作
- spring中文参考手册-核心技术_ioc
- 【Elasticsearch】分片未分配 (UNASSIGNED) failed to obtain in-memory shard lock
- weex npm 报错 cb() never called!
- poj 3278 Catch That Cow (bfs 搜索)
- 星尘小组第六周学习笔记—如何在各类控件中输入/输出数据
- java安卓开发异步任务_Android笔记4-android之多线程和异步任务
- C语言程序设计基础篇
- 如何设置二级域名解析(新手小白必看)
- 2020版熊猫金币解读及购买方式
- html导出excel合并单元格,JS导出EXCEL,动态设置单元格格式,合并单元格(横向或纵向)等操作...
- 独家:海尔消金“重仓”医美,月放款量惊人
- GOM传奇引擎登录器商业版与免费版的区别
- 利用chrom 截长图
- 利用MATLAB绘制逆发动机MAP图
热门文章
- Word如何交叉引用以及交叉引用参考文献后使用逗号分隔
- Windows Server 2012R2 启用网络发现失败
- 今天有个同事L发了一个“称象”的帖子,不过更搞笑的是另一个同事Z回了一个经典的解答。...
- 5G 空口信令分析指导书
- 并发编程的艺术 读书笔记
- pytorch中num_workers详解
- v-chart折线图数据改造
- 电脑教学有什么软件可以控制学生上网
- [Kerberos基础]-- kdc集群主从搭建(kerberos相关)
- Dynamips路由模拟器使用心得