Issue
I want to participate all about strange issue ( the OS is redhat 7.2 )
We can see that carbon.util module is missing
/opt/graphite/bin/carbon-cache.py start
Traceback (most recent call last):
File "/opt/graphite/bin/carbon-cache.py", line 28, in <module>
from carbon.util import run_twistd_plugin
ImportError: No module named carbon.util
This issue is a new , because before couple weeks everything was ok
So one conclusion is maybe someone use pip and remove by mistake the module ? ,
or some action that removed the module , or other assumption ,
Is it possible to trace the pip history , or to find the reason for removing module ?
just for more info this is the script that using the module ,
more /opt/graphite/bin/carbon-cache.py
#!/usr/bin/python2
"""Copyright 2009 Chris Davis
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License."""
import sys
import os.path
# Figure out where we're installed
BIN_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(BIN_DIR)
# Make sure that carbon's 'lib' dir is in the $PYTHONPATH if we're running from
# source.
LIB_DIR = os.path.join(ROOT_DIR, "lib")
sys.path.insert(0, LIB_DIR)
from carbon.util import run_twistd_plugin
from carbon.exceptions import CarbonConfigException
try:
run_twistd_plugin(__file__)
except CarbonConfigException, exc:
raise SystemExit(str(exc))
Solution
pip has a --log option, but it's not enabled by default, so unless that option was enabled, which seems unlikely in this case, you can't trace the pip history. Anyway, a simple "pip install carbon" should be enough to reinstall the module just like nothing happened.
If you really need to find out what happened on the machine, you can always try to inspect the shell history file (~/.bash_history for bash) and find out who was logged using "last", but that's more a forensics problem than a Python problem.
Answered By - piwai Answer Checked By - Cary Denson (WPSolving Admin)