OperationalError: unable to open database file
On Ubuntu 11.10 Server x64.
Got past the owner/permission issues for the directory.
Now when I hit my graphite vhost, I get the following in the browser itself:
Traceback (most recent call last):
File "/usr/lib/
request.
File "/usr/lib/
sub_match = pattern.
File "/usr/lib/
return ResolverMatch(
File "/usr/lib/
self._callback = get_callable(
File "/usr/lib/
result = func(*args)
File "/usr/lib/
lookup_view = getattr(
File "/usr/lib/
__import_
File "/opt/graphite/
from graphite.util import getProfile, getProfileByUse
File "/opt/graphite/
defaultUser = User.objects.
File "/usr/lib/
return self.get_
File "/usr/lib/
num = len(clone)
File "/usr/lib/
self.
File "/usr/lib/
for row in compiler.
File "/usr/lib/
for rows in self.execute_
File "/usr/lib/
cursor = self.connection
File "/usr/lib/
cursor = util.CursorWrap
File "/usr/lib/
self.connection = Database.
OperationalError: unable to open database file
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Graphite Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Nicholas Leskiw
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
Any ideas as to what the cause of this might be?
Is it another directory permission issue? Which dir? What should the permission be?
Thanks in advance.
-Jac
Revision history for this message
|
#3 |
Oh, I had no idea I had to run that command. Ok, I ran it with "sudo" and it produced this:
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 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 auth_message
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: jac@localhost
Password:
Password (again):
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
No fixtures found.
After that /opt/graphite/
Back to the webapp and refreshed the page and now get a different error:
File "/usr/lib/
return Database.
DatabaseError: attempt to write a readonly database
So, what's next? Am I still missing some file permission issues somewhere? Should graphite.db belong to apache2 user:group? Just for kicks I did that and it gave me "Unable to open database file" error again, so I switched it back to root:root.
Please advise.
Thank you again for all your help.
-Jac
Revision history for this message
|
#4 |
Yup, chown it to the graphite user
-Nick
Sent from a mobile device.
Please excuse terse language and spelling mistakes.
Joseph Schmoley <email address hidden> wrote:
>Question #178172 on Graphite changed:
>https:/
>
> Status: Answered => Open
>
>Joseph Schmoley is still having a problem:
>Oh, I had no idea I had to run that command. Ok, I ran it with "sudo"
>and it produced this:
>
>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 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 auth_message
>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: jac@localhost
>Password:
>Password (again):
>Superuser created successfully.
>Installing custom SQL ...
>Installing indexes ...
>No fixtures found.
>
>After that /opt/graphite/
>root:root).
>
>Back to the webapp and refreshed the page and now get a different error:
>
> File "/usr/lib/
> return Database.
>DatabaseError: attempt to write a readonly database
>
>So, what's next? Am I still missing some file permission issues
>somewhere? Should graphite.db belong to apache2 user:group? Just for
>kicks I did that and it gave me "Unable to open database file" error
>again, so I switched it back to root:root.
>
>Please advise.
>
>Thank you again for all your help.
>
>-Jac
>
>--
>You received this question notification because you are a member of
>graphite-dev, which is an answer contact for Graphite.
>
>______
>Mailing list: https:/
>Post to : <email address hidden>
>Unsubscribe : https:/
>More help : https:/
Revision history for this message
|
#5 |
Nicholas, thanks for your reply. There's no user named "graphite" on my Ubuntu 11.10 server, but I had a hunch you meant to say the Apache user (www-data). So I made the following changes:
sudo chown www-data:www-data /opt/graphite/
sudo chown www-data:www-data /opt/graphite/
sudo chown www-data:www-data /opt/graphite/
...and now the graphite home page comes up! Excellent! Thanks a bunch for everyone's help.
A follow-up question... Should everything under /opt/graphite/
Currently lists, log, rrd, whisper subdirs are still owned by root. Should they be owned by Apache user as well?
Thanks.
-Jac
Revision history for this message
|
#6 |
Yea, you may want to just chown -R www-data:www-data /opt/graphite.
Joseph Schmoley <email address hidden> wrote:
>Question #178172 on Graphite changed:
>https:/
>
> Status: Answered => Solved
>
>Joseph Schmoley confirmed that the question is solved:
>Nicholas, thanks for your reply. There's no user named "graphite" on my
>Ubuntu 11.10 server, but I had a hunch you meant to say the Apache user
>(www-data). So I made the following changes:
>
>sudo chown www-data:www-data /opt/graphite/
>sudo chown www-data:www-data /opt/graphite/
>sudo chown www-data:www-data /opt/graphite/
>
>...and now the graphite home page comes up! Excellent! Thanks a bunch
>for everyone's help.
>
>A follow-up question... Should everything under /opt/graphite/
>be owned by the Apache user?
>
>Currently lists, log, rrd, whisper subdirs are still owned by root.
>Should they be owned by Apache user as well?
>
>Thanks.
>
>-Jac
>
>--
>You received this question notification because you are a member of
>graphite-dev, which is an answer contact for Graphite.
>
>______
>Mailing list: https:/
>Post to : <email address hidden>
>Unsubscribe : https:/
>More help : https:/
Revision history for this message
|
#7 |
Thanks Nicholas Leskiw, that solved my question.
Revision history for this message
|
#8 |
hi can any body explain what this error is
Traceback:
File "/usr/lib/
178. response = middleware_
File "/usr/lib/
36. request.
File "/usr/lib/
56. session_key = self.session_key,
File "/usr/lib/
175. self._session_key = self._get_
File "/usr/lib/
167. if not self.exists(
File "/usr/lib/
29. Session.
File "/usr/lib/
132. return self.get_
File "/usr/lib/
344. num = len(clone)
File "/usr/lib/
82. self._result_cache = list(self.
File "/usr/lib/
273. for row in compiler.
File "/usr/lib/
680. for rows in self.execute_
File "/usr/lib/
734. cursor = self.connection
File "/usr/lib/
250. cursor = self.make_
File "/usr/lib/
207. self.connection = Database.
Exception Type: OperationalError at /auth/login/
Exception Value: unable to open database file
Revision history for this message
|
#9 |
As a start i'd recommend either running the django syncdb or perhaps the
sqlite file has the wrong ownership / permissions. Could potentially be
another cause but that is an initial suggestion.
On Mar 18, 2012 8:57 PM, "sanjaya dahal" <
<email address hidden>> wrote:
> Question #178172 on Graphite changed:
> https:/
>
> sanjaya dahal posted a new comment:
> hi can any body explain what this error is
> Traceback:
> File "/usr/lib/
> get_response
> 178. response = middleware_
> File "/usr/lib/
> in process_response
> 36. request.
> File "/usr/lib/
> in save
> 56. session_key = self.session_key,
> File
> "/usr/lib/
> _get_session_key
> 175. self._session_key = self._get_
> File
> "/usr/lib/
> _get_new_
> 167. if not self.exists(
> File "/usr/lib/
> in exists
> 29. Session.
> File "/usr/lib/
> 132. return self.get_
> File "/usr/lib/
> 344. num = len(clone)
> File "/usr/lib/
> 82. self._result_cache = list(self.
> File "/usr/lib/
> 273. for row in compiler.
> File "/usr/lib/
> results_iter
> 680. for rows in self.execute_
> File "/usr/lib/
> execute_sql
> 734. cursor = self.connection
> File "/usr/lib/
> cursor
> 250. cursor = self.make_
> File "/usr/lib/
> _cursor
> 207. self.connection = Database.
>
> Exception Type: OperationalError at /auth/login/
> Exception Value: unable to open database file
>
> --
> You received this question notification because you are a member of
> graphite-dev, which is an answer contact for Graphite.
>
> _______
> Mailing list: https:/
> Post to : <email address hidden>
> Unsubscribe : https:/
> More help : https:/
>
Revision history for this message
|
#10 |
hi i tried to run django-admin sync db got following errors
django-admin syncdb
Traceback (most recent call last):
File "/usr/bin/
management.
File "/usr/lib/
line 429, in execute_
utility.
File "/usr/lib/
line 379, in execute
self.
File "/usr/lib/
line 261, in fetch_command
klass = load_command_
File "/usr/lib/
line 67, in load_command_class
module = import_
File "/usr/lib/
in import_module
__import_
File
"/usr/lib/
line 7, in <module>
from django.
emit_post_
File "/usr/lib/
6, in <module>
from django.db import models
File "/usr/lib/
<module>
if not settings.DATABASES:
File "/usr/lib/
in __getattr__
self._setup()
File "/usr/lib/
_setup
raise ImportError(
variable %s is undefined." % ENVIRONMENT_
ImportError: Settings cannot be imported, because environment variable
DJANGO_
On Mon, Mar 19, 2012 at 3:10 AM, cbrinley <
<email address hidden>> wrote:
> Question #178172 on Graphite changed:
> https:/
>
> cbrinley posted a new comment:
> As a start i'd recommend either running the django syncdb or perhaps the
> sqlite file has the wrong ownership / permissions. Could potentially be
> another cause but that is an initial suggestion.
> On Mar 18, 2012 8:57 PM, "sanjaya dahal" <
> <email address hidden>> wrote:
>
> > Question #178172 on Graphite changed:
> > https:/
> >
> > sanjaya dahal posted a new comment:
> > hi can any body explain what this error is
> > Traceback:
> > File "/usr/lib/
> > get_response
> > 178. response = middleware_
> > File "/usr/lib/
> > in process_response
> > 36. request.
> > File
> "/usr/lib/
> > in save
> > 56. session_key = self.session_key,
> > File
> > "/usr/lib/
> in
> > _get_session_key
> > 175. self._session_key = self._get_
> > File
> > "/usr/lib/
> in
> > _get_new_
> > 167. if not self.exists(
> > File
> "/usr/lib/
> > in exists
> > 29. Session.
> > File "/usr/lib/
> > 132. return self.get_
> > File "/usr/lib/
> > 344. num = len(clone)
> > File "/usr/lib/
> > 82. self._result_cache = list(self.
> > File "/usr/lib/
> > 273. for row in compiler.
> > File "/usr/lib/
> > results_iter
> > 680. for rows in self.execute_
> > File "/usr/lib/
> > execute_sql
> > 734. cursor = self.connection
> > File "/usr/lib/
> > cursor
> > 250. cursor = self.make_
> > File "/usr/lib/
> > _cursor
> > 207. self.connection = Database.
> >
> > Exception Type: OperationalError at /auth/login/
> > Exception Value: unable to open database file
> >
> > --
> > You received this question notification because you are a member of
> > graphite-dev, which is an answer contact for Graphite.
> >
> > _______
> > Mailing list: https:/
> > Post to : <email address hidden>
> > Unsubscribe : https:/
> > More help : https:/
> >
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>
Revision history for this message
|
#11 |
Hi Sanjaya,
This just means django can't find the graphite settings module. That is its
not defined as an environmental variable or in the apache config.
Attached is doc on this. A typical setting looks like this: export
DJANGO_
Your setup may differ so please consult the django documentation.
https:/
On Sun, Mar 18, 2012 at 10:15 PM, sanjaya dahal <
<email address hidden>> wrote:
> Question #178172 on Graphite changed:
> https:/
>
> sanjaya dahal posted a new comment:
> hi i tried to run django-admin sync db got following errors
> django-admin syncdb
> Traceback (most recent call last):
> File "/usr/bin/
> management.
> File "/usr/lib/
> line 429, in execute_
> utility.execute()
> File "/usr/lib/
> line 379, in execute
> self.fetch_
> File "/usr/lib/
> line 261, in fetch_command
> klass = load_command_
> File "/usr/lib/
> line 67, in load_command_class
> module = import_
> File "/usr/lib/
> in import_module
> __import__(name)
> File
> "/usr/lib/
> line 7, in <module>
> from django.
> emit_post_
> File "/usr/lib/
> 6, in <module>
> from django.db import models
> File "/usr/lib/
> <module>
> if not settings.DATABASES:
> File "/usr/lib/
> in __getattr__
> self._setup()
> File "/usr/lib/
> _setup
> raise ImportError(
> variable %s is undefined." % ENVIRONMENT_
> ImportError: Settings cannot be imported, because environment variable
> DJANGO_
>
>
> On Mon, Mar 19, 2012 at 3:10 AM, cbrinley <
> <email address hidden>> wrote:
>
> > Question #178172 on Graphite changed:
> > https:/
> >
> > cbrinley posted a new comment:
> > As a start i'd recommend either running the django syncdb or perhaps the
> > sqlite file has the wrong ownership / permissions. Could potentially be
> > another cause but that is an initial suggestion.
> > On Mar 18, 2012 8:57 PM, "sanjaya dahal" <
> > <email address hidden>> wrote:
> >
> > > Question #178172 on Graphite changed:
> > > https:/
> > >
> > > sanjaya dahal posted a new comment:
> > > hi can any body explain what this error is
> > > Traceback:
> > > File "/usr/lib/
> > > get_response
> > > 178. response = middleware_
> > > File
> "/usr/lib/
> > > in process_response
> > > 36. request.
> > > File
> > "/usr/lib/
> > > in save
> > > 56. session_key = self.session_key,
> > > File
> > > "/usr/lib/
> > in
> > > _get_session_key
> > > 175. self._session_key = self._get_
> > > File
> > > "/usr/lib/
> > in
> > > _get_new_
> > > 167. if not self.exists(
> > > File
> > "/usr/lib/
> > > in exists
> > > 29. Session.
> > > File "/usr/lib/
> > > 132. return self.get_
> > > File "/usr/lib/
> > > 344. num = len(clone)
> > > File "/usr/lib/
> __len__
> > > 82. self._result_cache = list(self.
> > > File "/usr/lib/
> iterator
> > > 273. for row in compiler.
> > > File "/usr/lib/
> > > results_iter
> > > 680. for rows in self.execute_
> > > File "/usr/lib/
> > > execute_sql
> > > 734. cursor = self.connection
> > > File "/usr/lib/
> > > cursor
> > > 250. cursor = self.make_
> > > File "/usr/lib/
> in
> > > _cursor
> > > 207. self.connection = Database.
> > >
> > > Exception Type: OperationalError at /auth/login/
> > > Exception Value: unable to open database file
> > >
> > > --
> > > You received this question notification because you are a member of
> > > graphite-dev, which is an answer contact for Graphite.
> > >
> > > _______
> > > Mailing list: https:/
> > > Post to : <email address hidden>
> > > Unsubscribe : https:/
> > > More help : https:/
> > >
> >
> > --
> > You received this question notification because you are a direct
> > subscriber of the question.
> >
>
> --
> You received this question notification because you are a member of
> graphite-dev, which is an answer contact for Graphite.
>
> _______
> Mailing list: https:/
> Post to : <email address hidden>
> Unsubscribe : https:/
> More help : https:/
>
--
Chris Brinley
Cleartrial
e: <email address hidden>
p: 312-460-3038
m: 219-789-2811
Revision history for this message
|
#12 |
LinkedIn
------------
I'd like to add you to my professional network on LinkedIn.
- sanjaya
sanjaya dahals
Student at Kungliga tekniska högskolan
Stockholm County, Sweden
Confirm that you know sanjaya dahals:
https:/
--
You are receiving Invitation to Connect emails. Click to unsubscribe:
http://
(c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.
Revision history for this message
|
#14 |
Wrong answer, bobfranis.
I urge everyone to stay away from that software he linked to in his post.
God only knows what it really does.