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

Cannot start Ralph #2236

Closed
bc-csagit opened this issue Feb 22, 2016 · 24 comments
Closed

Cannot start Ralph #2236

bc-csagit opened this issue Feb 22, 2016 · 24 comments

Comments

@bc-csagit
Copy link

I installed Ralph on Ubuntu 14.04 LTS using the installation guide from http://ralph-ng.readthedocs.org/en/ng/installation/ using the Ubuntu package. After I installed, I had to add ralph to my $PATH. When I was able to run ralph migrate, I was unable to progress because the command ran into an error. The error is inside the pastebin link below. I apologize if I am submitting an issue that seems dumb, I don't have much experience with *nix.

http://pastebin.com/BZipKb0K

@mkurek
Copy link
Contributor

mkurek commented Feb 22, 2016

As the error states, you have wrong credentials for Ralph to connect do mysql DB:

_mysql_exceptions.OperationalError: (1045, "Access denied for user 'ralph_ng'@'localhost' (using password: YES)")
``

@hhagemann
Copy link

I have the same problem BD-csagit describes. I am very sure that the user and password specified are correct: I can login to mysql with them.
I even tried root! Every time the same error.

What could it be? (using ubuntu 14.04 as specified, followed all instructions. Spent 4 hours on it...)

@szok
Copy link
Contributor

szok commented Feb 24, 2016

@hhagemann Please show me your .profile file.

cat ~/.profile

I checked just a clean ubuntu and migration works properly
Did you set a login and password to the database in the .profile file?
And do you have ralph_ng user in Mysql? And ralph_ng has access to ralph database?

My .profile in clean ubuntu:

szok@szok-virtualbox:~$ cat .profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi


export DATABASE_NAME=ralph
export DATABASE_USER=root
export DATABASE_PASSWORD=root
export DATABASE_HOST=127.0.0.1
export PATH=/opt/ralph/ralph-core/bin/:$PATH

@hhagemann
Copy link

@szok: Here is my .profile...
My user and password different than yours of course...

li### nux1@lnx1:~$ cat .profile

~/.profile: executed by the command interpreter for login shells.

This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login

exists.

see /usr/share/doc/bash/examples/startup-files for examples.

the files are located in the bash-doc package.

the default umask is set in /etc/profile; for setting the umask

for ssh logins, install and configure the libpam-umask package.

#umask 022

if running bash

if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi

set PATH so it includes user's private bin if it exists

if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
export DATABASE_NAME=ralph
export DATABASE_USER=ralphgebruiker
export DATABASE_PASSWORD=7lxl4
export DATABASE_HOST=127.0.0.1
export PATH=/opt/ralph/ralph-core/bin/:$PATH

@szok
Copy link
Contributor

szok commented Feb 24, 2016

Ok, it is correct
And in Mysql you have a user: ralphgebruiker with the password: 7lxl4
And has the permissions to create new tables in the database (ralph)?

@hhagemann
Copy link

Yes, that is correct: ralphgebruiker has full privileges for the database ralph

@szok
Copy link
Contributor

szok commented Feb 24, 2016

@mkurek What do you think?
@hhagemann maybe try a test on root user?

@ar4s
Copy link
Contributor

ar4s commented Feb 24, 2016

Can you access to database by following command?

mysql -u ralphgebruiker -p7lxl4 -h localhost ralph

@hhagemann
Copy link

Yes that works allright...

linux1@lnx1:~$ mysql -u ralphgebruiker -p7lx14 -h localhost ralph
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 768
Server version: 5.5.47-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input
statement

mysql>

Met vriendelijke groet,

Hans Hagemann
specialist informatievoorziening
Purmerendse ScholenGroep

0299 480061
0611 53 1782

2016-02-24 17:49 GMT+01:00 Arkadiusz Adamski notifications@github.com:

Can you access to database by following command?

mysql -u ralphgebruiker -p7lxl4 -h localhost ralph


Reply to this email directly or view it on GitHub
#2236 (comment).

@mkurek
Copy link
Contributor

mkurek commented Feb 24, 2016

Please try to run ralph shell and execute following commands here:

from django.conf import settings
print(settings.DATABASES)

Paste here your output.

@hhagemann
Copy link

linux1@lnx1:~$ ralph shell
Python 3.4.3 (default, Oct 14 2015, 20:28:29)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)

from django.conf import settings
print(settings['DATABASES'])
Traceback (most recent call last):
File "", line 1, in
File
"/opt/ralph/ralph-core/lib/python3.4/site-packages/django/utils/functional.py",
line 226, in inner
return func(self._wrapped, *args)
TypeError: 'Settings' object is not subscriptable

Met vriendelijke groet,

Hans Hagemann
specialist informatievoorziening
Purmerendse ScholenGroep

0299 480061
0611 53 1782

2016-02-24 19:00 GMT+01:00 Mateusz Kurek notifications@github.com:

Please try to run ralph shell and execute following commands here:

from django.conf import settings
print(settings['DATABASES'])

Paste here your output.


Reply to this email directly or view it on GitHub
#2236 (comment).

@mkurek
Copy link
Contributor

mkurek commented Feb 25, 2016

@hhagemann i've fixed this command right after posting this message. Try to use print(settings.DATABASES)

@hhagemann
Copy link

Hi Mateusz,
The command works now:

>>> print(settings.DATABASES)

{'default': {'NAME': 'ralph', 'OPTIONS': {'init_command': '\n    SET
storage_engine=INNODB;\n    SET character_set_connection=utf8,
       collation_connection=utf8_unicode_ci;\n    SET SESSION TRANSACTION
ISOLATION LEVEL READ COMMITTED;\n    ', 'sql_mode': 'TRADITIONAL
         ', 'charset': 'utf8'}, 'PASSWORD': '7lxl4', 'USER':
'ralphgebruiker', 'HOST': '127.0.0.1', 'TIME_ZONE': 'Europe/Warsaw',
'CONN_MAX_                    AGE': 0, 'ATOMIC_REQUESTS': True, 'TEST':
{'NAME': 'test_ralph_ng', 'CHARSET': None, 'COLLATION': None, 'MIRROR':
None}, 'PORT': 33                    06, 'ENGINE':
'django.db.backends.mysql', 'AUTOCOMMIT': True}}

Met vriendelijke groet,

Hans Hagemann
specialist informatievoorziening
Purmerendse ScholenGroep

0299 480061
0611 53 1782

2016-02-25 7:41 GMT+01:00 Mateusz Kurek notifications@github.com:

@hhagemann https://github.com/hhagemann i've fixed this command right
after posting this message. Try to use print(settings.DATABASES)


Reply to this email directly or view it on GitHub
#2236 (comment).

@mkurek
Copy link
Contributor

mkurek commented Feb 25, 2016

Everything seems ok right now. Could you just try to run ralph migrate one more time? Maybe you didn't applied your changes in .profile file (either by logging again or by sourcing this file)? In your original exception, ralph tried to use ralph_ng user to call db - in your last output everything seems to be fine.

@vi4m
Copy link
Contributor

vi4m commented Feb 25, 2016

Keep in mind that .profile is not executed at all if ~/.bash_profile or ~/.bash_login exists. I will bet too, that .profile was not processed previously (could check if set shows variables)

@hhagemann
Copy link

Hi,
I don't exactly know what you mean. But here is the contents of my home-dir
and an echo-command for DATABASE_USER
So I think the .profile is executed.

root@lnx1:/home/linux1# ls -la
total 76
drwxr-xr-x 4 linux1 linux1 4096 feb 25 11:13 .
drwxr-xr-x 3 root root 4096 feb 19 11:38 ..
-rw------- 1 linux1 linux1 2821 feb 24 20:14 .bash_history
-rw-r--r-- 1 linux1 linux1 220 feb 19 11:38 .bash_logout
-rw-r--r-- 1 linux1 linux1 3637 feb 19 11:38 .bashrc
drwx------ 2 linux1 linux1 4096 feb 19 11:40 .cache
drwxr-xr-x 3 root root 4096 feb 21 14:08 .composer
-rwxr--r-- 1 linux1 linux1 240 feb 21 14:04 install.sh
-rw------- 1 linux1 linux1 1092 feb 24 19:32 .mysql_history
-rw-r--r-- 1 linux1 linux1 845 feb 24 10:30 .profile
-rwxr--r-- 1 root root 25599 feb 21 14:05 snipeit.sh
-rw------- 1 linux1 linux1 4456 feb 25 11:09 .viminfo
root@lnx1:/home/linux1# echo $DATABASE_USER
ralphgebruiker
root@lnx1:/home/linux1#

Met vriendelijke groet,

Hans Hagemann
specialist informatievoorziening
Purmerendse ScholenGroep

0299 480061
0611 53 1782

2016-02-25 11:03 GMT+01:00 ✪ vi4m Marcin Kliks notifications@github.com:

Keep in mind that .profile is not executed at all if ~/.bash_profile or
~/.bash_login exists. I will bet too that .profile was not processed
previously (could check if set shows variables)


Reply to this email directly or view it on GitHub
#2236 (comment).

@mkurek
Copy link
Contributor

mkurek commented Mar 4, 2016

@hhagemann is the problem solved (does the Ralph command work properly)?

@bydunai
Copy link

bydunai commented Apr 28, 2016

Hello.
Well, somehow, I have a similar issue.
Freshly installed Ubuntu 14.04.4
.profile:

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi
export DATABASE_NAME=ralph
export DATABASE_USER=root
export DATABASE_PASSWORD=12345678
export DATABASE_HOST=127.0.0.1
export PATH=/opt/ralph/ralph-core/bin/:$PATH

Variables work:

bydunai@ralph:~$ echo $DATABASE_USER
root
bydunai@ralph:~$ echo $DATABASE_PASSWORD
12345678

but:

bydunai@ralph:~$ ralph shell
/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/contenttypes/models.py:159: RemovedInDjango19Warning: Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class ContentType(models.Model):

/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/admin/models.py:28: RemovedInDjango19Warning: Model class django.contrib.admin.models.LogEntry doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class LogEntry(models.Model):

/opt/ralph/ralph-core/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango19Warning: django.utils.importlib will be removed in Django 1.9.
  return f(*args, **kwds)

/opt/ralph/ralph-core/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated and will be removed in Django 1.9. Its contents have been moved to the fields, forms, and admin submodules of django.contrib.contenttypes.
  return f(*args, **kwds)

/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/lib/transitions/models.py:85: RemovedInDjango19Warning: Model class ralph.lib.transitions.models.TransitionModel doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class TransitionModel(models.Model):

/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/lib/transitions/models.py:96: RemovedInDjango19Warning: Model class ralph.lib.transitions.models.Transition doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class Transition(models.Model):

/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/lib/transitions/models.py:107: RemovedInDjango19Warning: Model class ralph.lib.transitions.models.Action doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class Action(models.Model):

Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.conf import settings
>>> print(settings.DATABASES)
{'default': {'ATOMIC_REQUESTS': True, 'USER': 'ralph_ng', 'PORT': '', 'AUTOCOMMIT': True, 'ENGINE': 'django.db.backends.mysql', 'TEST': {'NAME': None, 'COLLATION': None, 'MIRROR': None, 'CHARSET': None}, 'PASSWORD': 'ralph_ng', 'OPTIONS': {'init_command': '\n    SET storage_engine=INNODB;\n    SET character_set_connection=utf8,collation_connection=utf8_unicode_ci;\n    SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;\n    ', 'charset': 'utf8', 'sql_mode': 'TRADITIONAL'}, 'CONN_MAX_AGE': 0, 'HOST': '127.0.0.1', 'NAME': 'ralph_ng', 'TIME_ZONE': 'Europe/Warsaw'}}

and:

bydunai@ralph:~$ ralph migrate
/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/contenttypes/models.py:159: RemovedInDjango19Warning: Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class ContentType(models.Model):

/opt/ralph/ralph-core/lib/python3.4/site-packages/django/contrib/admin/models.py:28: RemovedInDjango19Warning: Model class django.contrib.admin.models.LogEntry doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class LogEntry(models.Model):

/opt/ralph/ralph-core/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango19Warning: django.utils.importlib will be removed in Django 1.9.
  return f(*args, **kwds)

/opt/ralph/ralph-core/lib/python3.4/importlib/_bootstrap.py:321: RemovedInDjango19Warning: django.contrib.contenttypes.generic is deprecated and will be removed in Django 1.9. Its contents have been moved to the fields, forms, and admin submodules of django.contrib.contenttypes.
  return f(*args, **kwds)

/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/lib/transitions/models.py:85: RemovedInDjango19Warning: Model class ralph.lib.transitions.models.TransitionModel doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class TransitionModel(models.Model):

/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/lib/transitions/models.py:96: RemovedInDjango19Warning: Model class ralph.lib.transitions.models.Transition doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class Transition(models.Model):

/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/lib/transitions/models.py:107: RemovedInDjango19Warning: Model class ralph.lib.transitions.models.Action doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
  class Action(models.Model):

Traceback (most recent call last):
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
    self.connect()
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/backends/base/base.py", line 119, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/backends/mysql/base.py", line 276, in get_new_connection
    conn = Database.connect(**conn_params)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/MySQLdb/connections.py", line 204, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, "Access denied for user 'ralph_ng'@'localhost' (using password: YES)")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/ralph/ralph-core/bin/ralph", line 9, in <module>
    load_entry_point('ralph==3.0.0', 'console_scripts', 'ralph')()
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/__main__.py", line 29, in prod
    main('ralph.settings.prod')
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/__main__.py", line 14, in main
    execute_from_command_line(sys.argv)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/management/base.py", line 393, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/management/base.py", line 443, in execute
    self.check()
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/management/base.py", line 481, in check
    include_deployment_checks=include_deployment_checks,
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/checks/registry.py", line 72, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/core/checks/model_checks.py", line 28, in check_all_models
    errors.extend(model.check(**kwargs))
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/models/base.py", line 1205, in check
    errors.extend(cls._check_fields(**kwargs))
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/models/base.py", line 1282, in _check_fields
    errors.extend(field.check(**kwargs))
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/models/fields/__init__.py", line 934, in check
    errors = super(AutoField, self).check(**kwargs)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/models/fields/__init__.py", line 207, in check
    errors.extend(self._check_backend_specific_checks(**kwargs))
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/models/fields/__init__.py", line 306, in _check_backend_specific_checks
    return connection.validation.check_field(self, **kwargs)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/backends/mysql/validation.py", line 18, in check_field
    field_type = field.db_type(connection)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/models/fields/__init__.py", line 614, in db_type
    return connection.data_types[self.get_internal_type()] % data
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/__init__.py", line 36, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/utils/functional.py", line 60, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/backends/mysql/base.py", line 196, in data_types
    if self.features.supports_microsecond_precision:
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/utils/functional.py", line 60, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/backends/mysql/features.py", line 52, in supports_microsecond_precision
    return self.connection.mysql_version >= (5, 6, 4) and Database.version_info >= (1, 2, 5)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/utils/functional.py", line 60, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/backends/mysql/base.py", line 371, in mysql_version
    with self.temporary_connection():
  File "/usr/lib/python3.4/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/backends/base/base.py", line 462, in temporary_connection
    cursor = self.cursor()
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/backends/base/base.py", line 162, in cursor
    cursor = self.make_debug_cursor(self._cursor())
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/backends/base/base.py", line 135, in _cursor
    self.ensure_connection()
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
    self.connect()
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/utils/six.py", line 658, in reraise
    raise value.with_traceback(tb)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
    self.connect()
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/backends/base/base.py", line 119, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/django/db/backends/mysql/base.py", line 276, in get_new_connection
    conn = Database.connect(**conn_params)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/opt/ralph/ralph-core/lib/python3.4/site-packages/MySQLdb/connections.py", line 204, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
django.db.utils.OperationalError: (1045, "Access denied for user 'ralph_ng'@'localhost' (using password: YES)")

@mkurek
Copy link
Contributor

mkurek commented Apr 28, 2016

Hi @bydunai . Are you sure your .profile is executed? Could you run source ~/.profile and see if it helps? If not, please run ralph shell and paste here output of following commands:

import os
os.environ.get('DATABASE_PASSWORD')
os.environ.get('DATABASE_USER')

Btw how did you installed ralph? Vagrant or deb?

@bydunai
Copy link

bydunai commented Apr 28, 2016

@mkurek.
source ~/.profile did nothing, I still got the error.
ralph shell output:

>>> import os
>>> os.environ.get('DATABASE_PASSWORD')
'12345678'
>>> os.environ.get('DATABASE_USER')
'root'

I've installed deb package.
Though not via apt-get because there was some 404 problem.
So I've downloaded and dpkg'ed this one:
ralph-core_3.0.0-29_amd64.deb
Could this be the source of the issue?

@mkurek
Copy link
Contributor

mkurek commented Apr 28, 2016

It could be (very) old version. Could you try with ralph-core_3.0.0-snapshot-20160428-5440_amd64.deb?

@bydunai
Copy link

bydunai commented Apr 28, 2016

You were right, this was the thing.
I thought package name without "snapshot" is stable and picked the latest from them.
Alright, the server started, but now I got Server Error (500).

bydunai@ralph:~$ ralph runserver 0.0.0.0:8000
Performing system checks...

System check identified no issues (0 silenced).
April 28, 2016 - 12:18:35
Django version 1.8.12, using settings 'ralph.settings.prod'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
[28/Apr/2016 12:19:03] "GET / HTTP/1.1" 302 0
[28/Apr/2016 12:19:03] "GET /login/?next=/ HTTP/1.1" 500 27
[28/Apr/2016 12:19:04] "GET /favicon.ico HTTP/1.1" 404 85

@bydunai
Copy link

bydunai commented May 4, 2016

I'm sorry, I guess I should have stuck to concept "one issue - one concept".
Here's the solution: #2193

@vi4m
Copy link
Contributor

vi4m commented May 15, 2016

Everybody happy, so closing this issue :-)

@vi4m vi4m closed this as completed May 15, 2016
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