NoSectionError: No section: 'app'
Smurfs-xxl opened this issue · 11 comments
运行服务 apnsagent-server.py config apnsagent.conf 报以下错误:
NoSectionError: No section: 'app'
请检查一下你的配置文件里有没有[app]这一段。
有。。。配置如下:
[app]
app_dir = /home/apns/apps/
[redis]
host = 127.0.0.1
port = 6379
db = apnsagent
password =
错误信息如下:
Traceback (most recent call last):
File "/usr/local/bin/apnsagent-server.py", line 5, in
pkg_resources.run_script('apnsagent==0.7', 'apnsagent-server.py')
File "/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 489, in run_script
File "/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1214, in run_script
File "/usr/local/lib/python2.7/site-packages/apnsagent-0.7-py2.7.egg/EGG-INFO/scripts/apnsagent-server.py", line 7, in
File "build/bdist.linux-x86_64/egg/apnsagent/guard.py", line 189, in execute
File "/usr/local/lib/python2.7/ConfigParser.py", line 567, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'app'
你试一下用绝对路径指定配置文件。
用绝对路径也是一样的错误信息:
[root@web6 apnsagent]# apnsagent-server.py config
/data0/htdocs/xxl/apnsagent/apnsagent.conf
Traceback (most recent call last):
File "/usr/local/bin/apnsagent-server.py", line 5, in
pkg_resources.run_script('apnsagent==0.7', 'apnsagent-server.py')
File
"/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py",
line 489, in run_script
File
"/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py",
line 1214, in run_script
File
"/usr/local/lib/python2.7/site-packages/apnsagent-0.7-py2.7.egg/EGG-INFO/scripts/apnsagent-server.py",
line 7, in
File "build/bdist.linux-x86_64/egg/apnsagent/guard.py", line 189, in
execute
File "/usr/local/lib/python2.7/ConfigParser.py", line 567, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'app'
在 2012年3月29日 上午10:16,jeffkit <
reply@reply.github.com
写道:
你试一下用绝对路径指定配置文件。
Reply to this email directly or view it on GitHub:
#5 (comment)
Best Regards.
Leonardo
你运行的命令有错误,要这样:
apnsagent-server.py /data0/htdocs/xxl/apnsagent/apnsagent.conf
不要“config”
修正命名行后,新的错误信息如下:
Traceback (most recent call last):
File "/usr/local/bin/apnsagent-server.py", line 5, in
pkg_resources.run_script('apnsagent==0.7', 'apnsagent-server.py')
File "/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 489, in run_script
File "/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1214, in run_script
File "/usr/local/lib/python2.7/site-packages/apnsagent-0.7-py2.7.egg/EGG-INFO/scripts/apnsagent-server.py", line 7, in
File "build/bdist.linux-x86_64/egg/apnsagent/guard.py", line 193, in execute
ValueError: invalid literal for int() with base 10: 'apnsagent'
不知道你具体的命令是什么。
建多跟踪一下源代码。
搞定了。。。配置文件的db为0,可以正常启动。。。password不能写 = ''
运行服务的命名行:apnsagent-server.py apnsagent.conf
配置文件的db最好不要改,把password = '' 的两个单引号去掉。。变成 password =
谢谢使用。
redis的db是只能为数字的。没留意到你配置文件的细节 :)