Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python manage.py syncdb fails in ubuntu 14.04 VM #46

Open
patcon opened this issue Jun 20, 2015 · 14 comments
Open

python manage.py syncdb fails in ubuntu 14.04 VM #46

patcon opened this issue Jun 20, 2015 · 14 comments

Comments

@patcon
Copy link
Member

patcon commented Jun 20, 2015

(pdsEnv)kitchen@60aa1b8653be:~/pdsEnv/openPDS$ python start.py 


##########################################################################
NOTE: This must be run from the root directory of the openPDS project
and for the virtualenv to be located in the directory above it.
ie: you should be in /pdsEnv/openPDS
if necessary, press ctrl+c to exit and then move to the correct directory.
##########################################################################
Enter the path to the openPDS virtual environment (or nothing for default: /home/kitchen/pdsEnv): 

Enter the Registry Server domain name (or nothing for MIT default: linkedpersonaldata.org): 

Which backend would you like to use for personal data storage?
1. MongoDB (openpds.backends.mongo)
2. SQLite (openpds.backends.sqlite)
3. Postsgres (openpds.backends.postgres)
Enter 1, 2, or 3 (default is 1): 
wsgi.py and settings.py generated
Setup done. Please continue with django setup by running: ./manage.py syncdb
Make sure that the user running your server process (www-data for apache, for example) has write access to all directories from your PDS virtual env to the openpds package directory
Finally, after running syncdb, provide the user running the server process with write access to the test.db file generated in the openpds directory
(pdsEnv)kitchen@60aa1b8653be:~/pdsEnv/openPDS$ ./manage.py syncdb
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/kitchen/pdsEnv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/home/kitchen/pdsEnv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/kitchen/pdsEnv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/home/kitchen/pdsEnv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 69, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/home/kitchen/pdsEnv/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/kitchen/pdsEnv/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 8, in <module>
    from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
  File "/home/kitchen/pdsEnv/local/lib/python2.7/site-packages/django/core/management/sql.py", line 6, in <module>
    from django.db import models
  File "/home/kitchen/pdsEnv/local/lib/python2.7/site-packages/django/db/__init__.py", line 11, in <module>
    if DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "/home/kitchen/pdsEnv/local/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
    self._setup()
  File "/home/kitchen/pdsEnv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/kitchen/pdsEnv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 95, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'openpds.settings' (Is it on sys.path?): cannot import name Connection
(pdsEnv)kitchen@60aa1b8653be:~/pdsEnv/openPDS$

Any immediate thoughts?

@fjqdxq
Copy link

fjqdxq commented Sep 25, 2015

hi,do you have a solution? I have the same problem,
thanks

@patcon
Copy link
Member Author

patcon commented Sep 25, 2015

No sorry @fjqdxq, never figured it out :(

@brian717
Copy link
Member

Just checking - did you run through all of the steps in the readme? In particular, have you run:
pip install -r requirements.txt

@khaled-riad
Copy link

Hello, I have the same problem, do you solved it?
Thanks

@deepsidhu1313
Copy link

Hi , same problem here too.

 python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/user/Study/Projects/SnP/pdsEnv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/home/user/Study/Projects/SnP/pdsEnv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/user/Study/Projects/SnP/pdsEnv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/home/user/Study/Projects/SnP/pdsEnv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 69, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/home/user/Study/Projects/SnP/pdsEnv/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/user/Study/Projects/SnP/pdsEnv/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 8, in <module>
    from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
  File "/home/user/Study/Projects/SnP/pdsEnv/local/lib/python2.7/site-packages/django/core/management/sql.py", line 6, in <module>
    from django.db import models
  File "/home/user/Study/Projects/SnP/pdsEnv/local/lib/python2.7/site-packages/django/db/__init__.py", line 11, in <module>
    if DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "/home/user/Study/Projects/SnP/pdsEnv/local/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
    self._setup()
  File "/home/user/Study/Projects/SnP/pdsEnv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/user/Study/Projects/SnP/pdsEnv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 95, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'openpds.settings' (Is it on sys.path?): cannot import name Connection

@sconrod-tester
Copy link

Hi I am experiencing same issue as above

(askbot-v1)root@dev-tools-125:~/askbot-v1/askbot-v1/askbot-devel# python manage.py syncdb
WARNING!!! You are using a 'locmem' (local memory) caching backend,
which is OK for a low volume site running on a single-process server.
For a multi-process configuration it is neccessary to have a production
cache system, such as redis or memcached.

With local memory caching and multi-process setup you might intermittently
see outdated content on your site.

System check identified some issues:

WARNINGS:
django_authopenid.UserPasswordQueue.user: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
group_messaging.SenderList.recipient: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.
Traceback (most recent call last):
File "manage.py", line 11, in
execute_from_command_line(sys.argv)
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/core/management/init.py", line 354, in execute_from_command_line
utility.execute()
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/core/management/init.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/core/management/base.py", line 394, in run_from_argv
self.execute(_args, *_cmd_options)
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/core/management/base.py", line 445, in execute
output = self.handle(_args, *_options)
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/core/management/commands/syncdb.py", line 25, in handle
call_command("migrate", **options)
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/core/management/init.py", line 120, in call_command
return command.execute(_args, *_defaults)
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/core/management/base.py", line 445, in execute
output = self.handle(_args, *_options)
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/core/management/commands/migrate.py", line 93, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/db/migrations/executor.py", line 19, in init
self.loader = MigrationLoader(self.connection)
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/db/migrations/loader.py", line 47, in init
self.build_graph()
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/db/migrations/loader.py", line 191, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/db/migrations/recorder.py", line 59, in applied_migrations
self.ensure_schema()
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/db/migrations/recorder.py", line 49, in ensure_schema
if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/db/backends/base/base.py", line 162, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/db/backends/base/base.py", line 135, in _cursor
self.ensure_connection()
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/db/backends/base/base.py", line 130, in ensure_connection
self.connect()
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/db/utils.py", line 98, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/db/backends/base/base.py", line 130, in ensure_connection
self.connect()
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/db/backends/base/base.py", line 119, in connect
self.connection = self.get_new_connection(conn_params)
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/Django-1.8.7-py2.7.egg/django/db/backends/postgresql_psycopg2/base.py", line 176, in get_new_connection
connection = Database.connect(**conn_params)
File "/root/askbot-v1/askbot-v1/local/lib/python2.7/site-packages/psycopg2/init.py", line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
django.db.utils.OperationalError: FATAL: Peer authentication failed for user "askbot"

@brian717
Copy link
Member

This seems like a different issue than the one reported here. It seems that authentication for the database you're using is failing here. Have you checked to make sure you've provided the correct credentials for accessing your backing database?

@patcon
Copy link
Member Author

patcon commented Dec 16, 2015

Looks like you might want to repost in the project issue queue :)
https://github.com/ASKBOT/askbot-devel

Unfortunately this is probably not the place to debug (there are others interested in openPDS, who are getting notified).

@brian717
Copy link
Member

@patcon: right, I just realized that the provided stack trace is for a different project entirely.

@sconrod-tester: The link @patcon provided is a better place to ask this question. This issue tracker is for the openPDS project, not askbot.

@jskrivseth
Copy link
Contributor

Same issue here, no resolution found. I'm not terribly familiar with django settings, but it seems the manage script can't resolve pdsEnv/openPDS/openpds/settings.py

@jskrivseth
Copy link
Contributor

@brian717 would be it possible to update the README to address the bootstrapping issue? No matter what I try, "openpds.settings" won't resolve on any Ubuntu installation I try.

raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e)) ImportError: Could not import settings 'openpds.settings' (Is it on sys.path?): cannot import name Connection

@patcon
Copy link
Member Author

patcon commented Apr 4, 2016

I'm a little bit more familiar with django than when I originally posted this: try copying the template at openpds/settings.py.template to openpds/settings.py, and skimming through to set up obvious config? (Sorry, haven't touched this project in a long time, but saw your message just now.)

@patcon
Copy link
Member Author

patcon commented Apr 4, 2016

on a lark, tried to get it going for you using sqlite3. this got me past syncdb:
#49

(I still had to tweak settings.py so that the sqlite db was in a path that already existed :/

but then it seems that more mongo-related things are baked in when I tried to execute runserver

@jskrivseth
Copy link
Contributor

@patcon Many thanks for the help! I think the issue is that from pymongo import Connection is deprecated, but using an older version of pymongo==2.7.2 seems to work fine for me. I made a pull request to update the requirements.txt. All seems to be good for me with that one change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants