使用pip更新Whisper软件包(从0.9.12到1.1.1)后,我无法再访问我的Graphite实例(即使在降级后...)日志说目标脚本不能作为Python模块加载。
以下是有关该系统的一些信息。
我尝试更改/usr/share/graphite-web/graphite.wsgi
和/opt/graphite/conf/graphite.wsgi
的权利,但没有解决问题。
我的错误日志:
[Thu Jan 18 14:53:17.260272 2018] [:error] [pid 16527] [remote 203.80.55.88:18829] mod_wsgi (pid=16527): Target WSGI script '/usr/share/graphite-web/graphite.wsgi' cannot be loaded as Python module.
[Thu Jan 18 14:53:17.260431 2018] [:error] [pid 16527] [remote 203.80.55.88:18829] mod_wsgi (pid=16527): Exception occurred processing WSGI script '/usr/share/graphite-web/graphite.wsgi'.
[Thu Jan 18 14:53:17.260470 2018] [:error] [pid 16527] [remote 203.80.55.88:18829] Traceback (most recent call last):
[Thu Jan 18 14:53:17.260507 2018] [:error] [pid 16527] [remote 203.80.55.88:18829] File "/usr/share/graphite-web/graphite.wsgi", line 16, in <module>
[Thu Jan 18 14:53:17.260552 2018] [:error] [pid 16527] [remote 203.80.55.88:18829] application = get_wsgi_application()
[Thu Jan 18 14:53:17.260564 2018] [:error] [pid 16527] [remote 203.80.55.88:18829] File "/usr/local/lib/python2.7/dist-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Thu Jan 18 14:53:17.260586 2018] [:error] [pid 16527] [remote 203.80.55.88:18829] django.setup(set_prefix=False)
[Thu Jan 18 14:53:17.260597 2018] [:error] [pid 16527] [remote 203.80.55.88:18829] File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
[Thu Jan 18 14:53:17.260630 2018] [:error] [pid 16527] [remote 203.80.55.88:18829] apps.populate(settings.INSTALLED_APPS)
[Thu Jan 18 14:53:17.260651 2018] [:error] [pid 16527] [remote 203.80.55.88:18829] File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 78, in populate
[Thu Jan 18 14:53:17.260670 2018] [:error] [pid 16527] [remote 203.80.55.88:18829] raise RuntimeError("populate() isn't reentrant")
[Thu Jan 18 14:53:17.260695 2018] [:error] [pid 16527] [remote 203.80.55.88:18829] RuntimeError: populate() isn't reentrant
这是/usr/share/graphite-web/graphite.wsgi
的内容(与/opt/graphite/webapp/wsgi.py
相同)
import os
import sys
sys.path.append('/opt/graphite/webapp')
try:
from importlib import import_module
except ImportError:
from django.utils.importlib import import_module
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'graphite.settings') # noqa
from django.conf import settings
from django.core.wsgi import get_wsgi_application
from graphite.logger import log
application = get_wsgi_application()
try:
import whitenoise
except ImportError:
whitenoise = False
else:
# WhiteNoise < 2.0.1 does not support Python 2.6
if sys.version_info[:2] < (2, 7):
whitenoise_version = tuple(map(
int, getattr(whitenoise, '__version__', '0').split('.')))
if whitenoise_version < (2, 0, 1):
whitenoise = False
if whitenoise:
from whitenoise.django import DjangoWhiteNoise
application = DjangoWhiteNoise(application)
prefix = "/".join((settings.URL_PREFIX.strip('/'), 'static'))
for directory in settings.STATICFILES_DIRS:
application.add_files(directory, prefix=prefix)
for app_path in settings.INSTALLED_APPS:
module = import_module(app_path)
directory = os.path.join(os.path.dirname(module.__file__), 'static')
if os.path.isdir(directory):
application.add_files(directory, prefix=prefix)
# Initializing the search index can be very expensive. The import below
# ensures the index is preloaded before any requests are handed to the
# process.
log.info("graphite.wsgi - pid %d - reloading search index" % os.getpid())
import graphite.metrics.search # noqa
我还有一个文件/opt/graphite/conf/graphite.wsgi:
import sys
sys.path.append('/opt/graphite/webapp')
from graphite.wsgi import application
我对wsgi了解不多,我不明白这些日志。需要帮助......非常感谢你。
答案 0 :(得分:1)
更新后,您需要使用以下命令更新数据库:
CSV.open("design_performance_data_temp.csv", "w") do |csv|
csv << headers
csv_data = []
result.each do |design_data|
csv_data << design_data.first
csv_data << design_data.second[:rev] || 0
csv_data << design_data.second[:d_price] || 0
csv_data << design_data.second[:imp] || 0
csv_data << design_data.second[:d_odr] || 0
csv << csv_data
csv_data = []
end
end