openedx-unsupported / configuration

A collection of edx configuration scripts and utilities that edx.org uses to deploy openedx.
GNU Affero General Public License v3.0
823 stars 969 forks source link

Issue found on: [edxapp | syncdb and migrate] ******************************************* on Ubuntu Server12.04 LTS #1047

Closed kenju254 closed 10 years ago

kenju254 commented 10 years ago
failed: [localhost] => {"changed": true, "cmd": " /edx/app/edxapp/venvs/edxapp/bin/python manage.py lms syncdb --migrate --noinput --settings=aws_migrate ", "delta": "0:00:02.865708", "end": "2014-04-28 10:22:57.141365", "item": "", "rc": 1, "start": "2014-04-28 10:22:54.275657"}
stderr: 2014-04-28 10:22:55,605 INFO 6763 [dd.dogapi] dog_stats_api.py:66 - Initializing dog api to use statsd: localhost, 8125
Traceback (most recent call last):
  File "manage.py", line 95, in <module>
    execute_from_command_line([sys.argv[0]] + django_args)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/edx/app/edxapp/venvs/edxapp/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 "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/base.py", line 231, in execute
    self.validate()
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/base.py", line 266, in validate
    num_errors = get_validation_errors(s, app)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/management/validation.py", line 103, in get_validation_errors
    connection.validation.validate_field(e, opts, f)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/backends/mysql/validation.py", line 14, in validate_field
    db_version = self.connection.get_server_version()
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 415, in get_server_version
    self.cursor().close()
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/backends/__init__.py", line 319, in cursor
    cursor = util.CursorWrapper(self._cursor(), self)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 387, in _cursor
    self.connection = Database.connect(**kwargs)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 187, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)")

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/root/edx_sandbox.retry

localhost                  : ok=189  changed=41   unreachable=0    failed=1   

I run the

wget https://raw.github.com/edx/configuration/master/util/install/vagrant.sh -O - | bash

On my Ubuntu Server 12.04 so after reading a lot and tweaking

~/.my.cnf

with the right configuration. I got my Ansible playbook running.

So initially when I start my instance I can access MySQL and it is running at the time. But I tend to suspect there is a play that locks the MySQL and makes it inaccessible when running Play 189 as you can see on the Error page above.

Is this a bug or simply something I have missed.

jarv commented 10 years ago

Was it the case that you already had mysql running on this server when you ran the install script? We assume that you are starting from a fresh installation of Ubuntu 12.04 without any additional packages or modifications.

kenju254 commented 10 years ago

MySQL is already installed when running this script since I had initially run the script and it stopped since there was no ~/.my.cnf file.

When I am running this, MySQL is already installed.

jarv commented 10 years ago

I would try it again against a fresh install of ubuntu 12.04

kenju254 commented 10 years ago

I will try it again against a fresh install and see if it works well.

What would you recommend installing using the script or just doing it manually?

jarv commented 10 years ago

Using https://raw.githubusercontent.com/edx/configuration/master/util/install/vagrant.sh should work.

On Mon, Apr 28, 2014 at 11:58 AM, Kenneth Kinyanjui < notifications@github.com> wrote:

I will try it again against a fresh install and see if it works well.

What would you recommend installing using the script or just doing it manually?

— Reply to this email directly or view it on GitHubhttps://github.com/edx/configuration/issues/1047#issuecomment-41576381 .