Trouble setting up db on new Graphite install
I'm following the documentation here http://
New install on Centos 3.10.0-
I used the pip install method and got all the way to the Webapp Database Setup section here:
http://
After resolving some issues like installing South I reached this point and am stuck. Any advice would be greatly appreciated. Thanks.
# pwd
/opt/graphite
# echo $GRAPHITE_ROOT
/opt/graphite
# ll
total 12
drwxr-xr-x 2 root root 4096 Aug 3 14:48 bin
drwxr-xr-x 2 root root 4096 Aug 3 14:48 conf
drwxr-xr-x 3 root root 77 Aug 3 14:48 examples
drwxr-xr-x 8 root root 4096 Aug 3 14:48 lib
drwxrwxr-x 6 apache apache 52 Aug 3 14:44 storage
drwxr-xr-x 4 root root 35 Aug 3 15:37 webapp
# PYTHONPATH=
Unknown command: 'migrate'
Type 'django-admin.py help' for usage.
During my search for answers in this forum I found some different syntax and tried it, but got this error:
# django-admin.py syncdb --settings=
Traceback (most recent call last):
File "/usr/lib/
management.
File "/usr/lib/
utility.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.validate()
File "/usr/lib/
num_errors = get_validation_
File "/usr/lib/
for (app_name, error) in get_app_
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
models = import_
File "/usr/lib/
__import_
File "/opt/graphite/
from tagging.managers import ModelTaggedItem
File "/usr/lib/
from django.
ImportError: cannot import name parse_lookup
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Graphite Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Blue Jakester
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
What's Django and Graphite version do you use?
Revision history for this message
|
#2 |
# python
Python 2.7.5 (default, Nov 20 2015, 02:00:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> print(django.
1.4
>>>
I used this command to install graphite and just ran it again. Is 0.10.0 the version? If not I'm not certain how to check version. Thanks.
# pip install https:/
Collecting https:/
Downloading https:/
Requirement already satisfied (use --upgrade to upgrade): ceres==0.10.0 from https:/
Revision history for this message
|
#3 |
Yes, Graphite is 0.10.0, current master. Problem that's 'bleeding edge' code, not now it's pinned to Django 1.9 - https:/
Please install Django 1.9 or install graphite from 0.9.x branch - using https:/
Revision history for this message
|
#4 |
Although it's not *literally* pinned to 1.9, we definitely encourage users to run the newest Django with graphite-web HEAD. There have been a lot of impacting changes to Django since 1.7+ which makes it a real headache to document for our users if we *don't do this*.
The alternative is to debug this yourself by reading the deprecated Django 1.4 docs and identifying the correct setup steps. :-P
Revision history for this message
|
#5 |
Thanks for the help. I did this:
# pip install Django==1.9
Collecting Django==1.9
Downloading Django-
100% |██████
Installing collected packages: Django
Found existing installation: Django 1.4
DEPRECATION: Uninstalling a distutils installed project (Django) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling Django-1.4:
Successfully uninstalled Django-1.4
Successfully installed Django-1.9
and now get this error:
# PYTHONPATH=
Traceback (most recent call last):
File "/usr/lib/
management.
File "/usr/lib/
utility.
File "/usr/lib/
django.setup()
File "/usr/lib/
apps.
File "/usr/lib/
app_
File "/usr/lib/
self.
File "/usr/lib64/
__import_
File "/opt/graphite/
from tagging.managers import ModelTaggedItem
File "/usr/lib/
from django.
ImportError: cannot import name parse_lookup
Revision history for this message
|
#6 |
Installed graphite-web.0.9.15 from epel 7 repo you recommended. Getting different errors on syncdb now (bottom of post)
# yum install graphite-web.0.9.15
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.spro.net
* epel: linux.mirrors.
* extras: centos.eecs.wsu.edu
* updates: centos.eecs.wsu.edu
No package graphite-web.0.9.15 available.
Error: Nothing to do
# yum install graphite-web-0.9.15
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.spro.net
* epel: linux.mirrors.
* extras: centos.eecs.wsu.edu
* updates: centos.eecs.wsu.edu
Resolving Dependencies
--> Running transaction check
---> Package graphite-web.noarch 0:0.9.15-1.el7 will be installed
--> Processing Dependency: python-whisper >= 0.9.15 for package: graphite-
--> Processing Dependency: python-django >= 1.3 for package: graphite-
--> Processing Dependency: pyparsing for package: graphite-
--> Processing Dependency: django-tagging for package: graphite-
--> Processing Dependency: dejavu-serif-fonts for package: graphite-
--> Processing Dependency: dejavu-sans-fonts for package: graphite-
--> Running transaction check
---> Package Django.noarch 0:1.4-1mgc30 will be obsoleted
---> Package dejavu-
--> Processing Dependency: dejavu-fonts-common = 2.33-6.el7 for package: dejavu-
---> Package dejavu-
---> Package pyparsing.noarch 0:1.5.6-9.el7 will be installed
---> Package python-
--> Processing Dependency: python-
---> Package python-
---> Package python-
--> Running transaction check
---> Package dejavu-
---> Package python-
--> Finished Dependency Resolution
Dependencies Resolved
=======
Package Arch Version Repository Size
=======
Installing:
graphite-web noarch 0.9.15-1.el7 epel 1.8 M
python-django noarch 1.6.11-5.el7 epel 4.0 M
replacing Django.noarch 1.4-1mgc30
Installing for dependencies:
dejavu-
dejavu-sans-fonts noarch 2.33-6.el7 base 1.4 M
dejavu-serif-fonts noarch 2.33-6.el7 base 776 k
pyparsing noarch 1.5.6-9.el7 base 94 k
python-
python-
python-whisper noarch 0.9.15-1.el7 epel 42 k
Transaction Summary
=======
Install 2 Packages (+7 Dependent packages)
Total download size: 8.2 M
Is this ok [y/d/N]: y
Downloading packages:
(1/9): dejavu-
(2/9): dejavu-
(3/9): pyparsing-
(4/9): graphite-
(5/9): python-
(6/9): python-
(7/9): python-
(8/9): python-
(9/9): dejavu-
-------
Total 1.5 MB/s | 8.2 MB 00:00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : dejavu-
Installing : dejavu-
Installing : dejavu-
Installing : python-
Installing : python-
Installing : python-
Installing : pyparsing-
Installing : python-
Installing : graphite-
Erasing : Django-
warning: file /usr/lib/
Verifying : graphite-
Verifying : python-
Verifying : dejavu-
Verifying : dejavu-
Verifying : dejavu-
Verifying : python-
Verifying : python-
Verifying : pyparsing-
Verifying : python-
Verifying : Django-
Installed:
graphite-
Dependency Installed:
dejavu-
pyparsing.noarch 0:1.5.6-9.el7 python-
python-
Replaced:
Django.noarch 0:1.4-1mgc30
Complete!
#
=======
# pwd
/opt/graphite
# PYTHONPATH=
Traceback (most recent call last):
File "/usr/lib/
management.
File "/usr/lib/
utility.
File "/usr/lib/
self.
File "/usr/lib/
klass = load_command_
File "/usr/lib/
module = import_
File "/usr/lib/
__import_
File "/usr/lib/
from django.apps import apps
File "/usr/lib/
from .config import AppConfig
File "/usr/lib/
from django.
ImportError: cannot import name AppRegistryNotReady
# django-admin.py syncdb --settings=
Traceback (most recent call last):
File "/usr/lib/
management.
File "/usr/lib/
utility.
File "/usr/lib/
self.
File "/usr/lib/
klass = load_command_
File "/usr/lib/
module = import_
File "/usr/lib/
__import_
File "/usr/lib/
from django.
File "/usr/lib/
from django.db import models
File "/usr/lib/
from django.
File "/usr/lib/
class Manager(
File "/usr/lib/
return meta(name, bases, d)
File "/usr/lib/
for base in inspect.
AttributeError: 'module' object has no attribute 'getmro'
Revision history for this message
|
#7 |
Did you remove the database before re-trying your migration?
Revision history for this message
|
#8 |
No. I didn't think a database had been created. Where might it be? Nothing found with 'find':
# find /opt/graphite -name *.db -print
#
Revision history for this message
|
#9 |
I wanted to summarize what I've done so far to try and resolve the db initialization problem. Any additional advice would be greatly apprciated.
* installed Django version 1.9 (was running 1.4)
* installed graphite-web version 0.9.15
Now receiving the following when I try to initialize the db:
# pwd
/opt/graphite
# PYTHONPATH=
Traceback (most recent call last):
File "/usr/lib/
management.
File "/usr/lib/
utility.
File "/usr/lib/
self.
File "/usr/lib/
klass = load_command_
File "/usr/lib/
module = import_
File "/usr/lib/
__import_
File "/usr/lib/
from django.apps import apps
File "/usr/lib/
from .config import AppConfig
File "/usr/lib/
from django.
ImportError: cannot import name AppRegistryNotReady
# django-admin.py syncdb --settings=
Traceback (most recent call last):
File "/usr/lib/
management.
File "/usr/lib/
utility.
File "/usr/lib/
self.
File "/usr/lib/
klass = load_command_
File "/usr/lib/
module = import_
File "/usr/lib/
__import_
File "/usr/lib/
from django.
File "/usr/lib/
from django.db import models
File "/usr/lib/
from django.
File "/usr/lib/
class Manager(
File "/usr/lib/
return meta(name, bases, d)
File "/usr/lib/
for base in inspect.
AttributeError: 'module' object has no attribute 'getmro'
Thanks
Revision history for this message
|
#10 |
Just to confirm, you have matching versions of graphite-web and whisper installed?
Revision history for this message
|
#11 |
Thanks for the help Jason. Yes, same version, 0.9.15
# rpm -qa | grep whisper
python-
You have new mail in /var/spool/
Revision history for this message
|
#12 |
IIRC 0.9.15 is not compaible with Django 1.9 too. If you want to continue with 0.9.15 you should stick to EPEL Django version, I think it's 1.4
Revision history for this message
|
#13 |
Success! Thanks Denis.
I re-installed Django with this command:
# pip install Django==1.4
Collecting Django==1.4
Downloading Django-1.4.tar.gz (7.6MB)
100% |██████
Building wheels for collected packages: Django
Running setup.py bdist_wheel for Django ... done
Stored in directory: /root/.
Successfully built Django
Installing collected packages: Django
Found existing installation: Django 1.6.12
DEPRECATION: Uninstalling a distutils installed project (Django) has been deprecated and will be removed in a future version. This is due to the fact that uninstaling a distutils project will only partially uninstall the project.
Uninstalling Django-1.6.12:
Successfully uninstalled Django-1.6.12
Successfully installed Django-1.9
Even though it reported version 1.9 I reran the syncdb command and it worked. See below. So I'm moving on to the next task in the install docs.
Thanks everyone for the help.
# django-admin.py syncdb --settings=
Creating tables ...
Creating table account_profile
Creating table account_variable
Creating table account_view
Creating table account_window
Creating table account_mygraph
Creating table dashboard_
Creating table dashboard_dashboard
Creating table events_event
Creating table url_shortener_link
Creating table auth_permission
Creating table auth_group_
Creating table auth_group
Creating table auth_user_
Creating table auth_user_groups
Creating table auth_user
Creating table django_session
Creating table django_admin_log
Creating table django_content_type
Creating table tagging_tag
Creating table tagging_taggeditem
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'):
E-mail address: xxxxxxx#xxxxx.com
Password:
Password (again):
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
# ls -l storage
total 68
-rw-r--r-- 1 root root 69632 Aug 9 10:06 graphite.db
drwxr-xr-x 2 apache apache 6 Aug 3 14:44 lists
drwxr-xr-x 3 apache apache 19 Aug 3 14:48 log
drwxr-xr-x 2 apache apache 6 Aug 3 14:44 rrd
drwxr-xr-x 2 apache apache 6 Aug 3 14:44 whisper
#