I'm sorry to keep spamming, but I'm frustrated with not being able to solve 
this, so I can get my website up and running. I'm starting a local Python 
community, and we've already gotten some members, so it feels silly (and a 
little embarassing :-/ ) not to have the site running. The command that 
fails is this:

$ /home/pyvarm/.virtualenvs/PyVarm/bin/python 
> /home/pyvarm/mezzanine/PyVarm/manage.py createdb --noinput --nodata


I've tried running it manually on the production server as well, but it 
produces the same error then, as it does when I run it through "fab create" 
(or "fab all") from the development server. It says that the password is 
wrong (I suppose?), but I have no idea where it's getting the password 
from, if not from local_settings.py (which I would say is the correct 
password by definition):

$ /home/pyvarm/.virtualenvs/PyVarm/bin/python 
> /home/pyvarm/mezzanine/PyVarm/manage.py createdb --noinput --nodata
> /home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/psycopg2/__init__.py:144:
>  
> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
> in order to keep installing fr
> om binary please use "pip install psycopg2-binary" instead. For details 
> see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
>   """)
> Traceback (most recent call last):
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/db/backends/base/base.py",
>  
> line 213, in ensure_connection
>     self.connect()
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/db/backends/base/base.py",
>  
> line 189, in connect
>     self.connection = self.get_new_connection(conn_params)
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/db/backends/postgresql/base.py",
>  
> line 176, in get_new_connection
>     connection = Database.connect(**conn_params)
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/psycopg2/__init__.py",
>  
> line 130, in connect
>     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
> *psycopg2.OperationalError: FATAL:  password authentication failed for 
> user "PyVarm"*
> *FATAL:  password authentication failed for user "PyVarm"*
>
> The above exception was the direct cause of the following exception:
> Traceback (most recent call last):
>   File "/home/pyvarm/mezzanine/PyVarm/manage.py", line 14, in <module>
>     execute_from_command_line(sys.argv)
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/core/management/__init__.py",
>  
> line 364, in execute_from_command_line
>     utility.execute()
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/core/management/__init__.py",
>  
> line 356, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/core/management/base.py",
>  
> line 283, in run_from_argv
>     self.execute(*args, **cmd_options)
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/core/management/base.py",
>  
> line 330, in execute
>     output = self.handle(*args, **options)
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/mezzanine/core/management/commands/createdb.py",
>  
> line 39, in handle
>     if "conf_setting" in connection.introspection.table_names():
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/db/backends/base/introspection.py",
>  
> line 53, in table_names
>     with self.connection.cursor() as cursor:
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/db/backends/base/base.py",
>  
> line 254, in cursor
>     return self._cursor()
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/db/backends/base/base.py",
>  
> line 229, in _cursor
>     self.ensure_connection()
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/db/backends/base/base.py",
>  
> line 213, in ensure_connection
>     self.connect()
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/db/utils.py",
>  
> line 94, in __exit__
>     six.reraise(dj_exc_type, dj_exc_value, traceback)
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/utils/six.py",
>  
> line 685, in reraise
>     raise value.with_traceback(tb)
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/db/backends/base/base.py",
>  
> line 213, in ensure_connection
>     self.connect()
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/db/backends/base/base.py",
>  
> line 189, in connect
>     self.connection = self.get_new_connection(conn_params)
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/django/db/backends/postgresql/base.py",
>  
> line 176, in get_new_connection
>     connection = Database.connect(**conn_params)
>   File 
> "/home/pyvarm/.virtualenvs/PyVarm/lib/python3.6/site-packages/psycopg2/__init__.py",
>  
> line 130, in connect
>     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
>
> *django.db.utils.OperationalError: FATAL:  password authentication failed 
> for user "PyVarm"FATAL:  password authentication failed for user "PyVarm"*



Den söndag 13 januari 2019 kl. 18:23:12 UTC+1 skrev Christer Enfors:
>
> Ughh, I spoke too soon - I'm still getting the same error. :-( 
> "django.db.utils.OperationalError: FATAL:  password authentication failed 
> for user "PyVarm"" when I run either "fab all" or just the "fab create" 
> part.
>
> Den söndag 13 januari 2019 kl. 17:45:51 UTC+1 skrev Christer Enfors:
>>
>> Never mind - this has now been solved by looking at Travis' excellent 
>> video, as per suggested in another thread: https://youtu.be/snBBOv7F_k4
>>
>> Thanks, Travis!
>>
>> Den söndag 13 januari 2019 kl. 12:54:50 UTC+1 skrev Christer Enfors:
>>>
>>> Thanks to the helpful nature of people on this list, I've come a bit 
>>> further in my quest to deploy my website.
>>>
>>> I'm following along with the Deployment page of the documentation 
>>> <http://mezzanine.jupo.org/docs/deployment.html>, and I'm now up to 
>>> step 4 on "Tutorial - Case 1: deploying to a brand new server". I have set 
>>> the database password in local_settings.py, the DB_PASS field. And "fab 
>>> all" seems to be able to create the database.
>>>  
>>>
>>>> $ CREATE USER PyVarm WITH ENCRYPTED PASSWORD '***************'; ->
>>>> [23.101.79.24] out: sudo password:
>>>> [23.101.79.24] out: CREATE DATABASE
>>>> [23.101.79.24] out: 
>>>> $ CREATE DATABASE PyVarm WITH OWNER PyVarm ENCODING = 'UTF8' LC_CTYPE = 
>>>> 'en_US.UTF-8' LC_COLLATE = 'en_US.UTF-8' TEMPLATE template0; ->
>>>> [23.101.79.24] put: <file obj> -> 
>>>> /home/pyvarm/mezzanine/PyVarm/PyVarm/local_settings.py
>>>
>>>
>>> But then a little later, this section (with the error) comes up - it 
>>> seems to be trying to create a database again, this time with "manage.py 
>>> createdb":
>>>
>>> $ /home/pyvarm/.virtualenvs/PyVarm/bin/python 
>>> /home/pyvarm/mezzanine/PyVarm/manage.py createdb --noinput --nodata ->
>>>
>>> [23.101.79.24] out: 
>>> /home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/psycopg2/__init__.py:144:
>>>  
>>> UserWarning: The psycopg2 wheel package will be renamed from release 2.8; 
>>> in order to keep installing from binary please use "pip install 
>>> psycopg2-binary" instead. For deta[23.101.79.24] out: 
>>> td.org/psycopg/docs/install.html#binary-install-from-pypi>.
>>> [23.101.79.24] out:   """)
>>> [23.101.79.24] out: Traceback (most recent call last):
>>> [23.101.79.24] out:   File "/home/pyvarm/mezzanine/PyVarm/manage.py", 
>>> line 14, in <module>
>>> [23.101.79.24] out:     execute_from_command_line(sys.argv)
>>> [23.101.79.24] out:   File 
>>> "/home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/[23.101.79.24]
>>>  
>>> out: nt/__init__.py", line 364, in execute_from_command_line
>>> [23.101.79.24] out:     utility.execute()
>>> [23.101.79.24] out:   File 
>>> "/home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/[23.101.79.24]
>>>  
>>> out: nt/__init__.py", line 356, in execute
>>> [23.101.79.24] out:     
>>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>> [23.101.79.24] out:   File 
>>> "/home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/[23.101.79.24]
>>>  
>>> out: nt/base.py", line 283, in run_from_argv
>>> [23.101.79.24] out:     self.execute(*args, **cmd_options)
>>> [23.101.79.24] out:   File 
>>> "/home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/[23.101.79.24]
>>>  
>>> out: nt/base.py", line 330, in execute
>>> [23.101.79.24] out:     output = self.handle(*args, **options)
>>> [23.101.79.24] out:   File 
>>> "/home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/[23.101.79.24]
>>>  
>>> out: ement/commands/createdb.py", line 39, in handle
>>> [23.101.79.24] out:     if "conf_setting" in 
>>> connection.introspection.table_names():
>>> [23.101.79.24] out:   File 
>>> "/home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/[23.101.79.24]
>>>  
>>> out: ase/introspection.py", line 53, in table_names
>>> [23.101.79.24] out:     with self.connection.cursor() as cursor:
>>> [23.101.79.24] out:   File 
>>> "/home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/[23.101.79.24]
>>>  
>>> out: ase/base.py", line 254, in cursor
>>> [23.101.79.24] out:     return self._cursor()
>>> [23.101.79.24] out:   File 
>>> "/home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/[23.101.79.24]
>>>  
>>> out: ase/base.py", line 229, in _cursor
>>> [23.101.79.24] out:     self.ensure_connection()
>>> [23.101.79.24] out:   File 
>>> "/home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/[23.101.79.24]
>>>  
>>> out: ase/base.py", line 213, in ensure_connection
>>> [23.101.79.24] out:     self.connect()
>>> [23.101.79.24] out:   File 
>>> "/home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/[23.101.79.24]
>>>  
>>> out:  line 94, in __exit__
>>> [23.101.79.24] out:     six.reraise(dj_exc_type, dj_exc_value, traceback)
>>> [23.101.79.24] out:   File 
>>> "/home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/[23.101.79.24]
>>>  
>>> out: ase/base.py", line 213, in ensure_connection
>>> [23.101.79.24] out:     self.connect()
>>> [23.101.79.24] out:   File 
>>> "/home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/[23.101.79.24]
>>>  
>>> out: ase/base.py", line 189, in connect
>>> [23.101.79.24] out:     self.connection = 
>>> self.get_new_connection(conn_params)
>>> [23.101.79.24] out:   File 
>>> "/home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/[23.101.79.24]
>>>  
>>> out: ostgresql/base.py", line 176, in get_new_connection
>>> [23.101.79.24] out:     connection = Database.connect(**conn_params)
>>> [23.101.79.24] out:   File 
>>> "/home/pyvarm/.virtualenvs/PyVarm/local/lib/python2.7/site-packages/[23.101.79.24]
>>>  
>>> out: ", line 130, in connect
>>> [23.101.79.24] out:     conn = _connect(dsn, 
>>> connection_factory=connection_factory, **kwasync)
>>> [23.101.79.24] out: django.db.utils.OperationalError: FATAL:  password 
>>> authentication failed fo[23.101.79.24] out:
>>> [23.101.79.24] out: FATAL:  password authentication failed for user 
>>> "PyVarm"
>>> [23.101.79.24] out:
>>> [23.101.79.24] out:
>>> Fatal error: run() encountered an error (return code 1) while executing 
>>> '/home/pyvarm/.virtualenvs/PyVarm/bin/python 
>>> /home/pyvarm/mezzanine/PyVarm/manage.py createdb --noinput --nodata'
>>>
>>> Aborting.
>>> Disconnecting from 23.101.79.24... done.
>>>
>>>
>>> Given that there's only one place (local_settings.py) to enter the 
>>> password, I don't understand how a mismatch can arise. Could it perhaps be 
>>> that the password is correct, but something other than an incorrect 
>>> password is giving the "password authentication failure" error?
>>>
>>> I've been running "fab all" many times now, and inbetween each time I 
>>> completely uninstall all postgresql packages (apt remove --purge) to avoid 
>>> conflicts ("the database already exists", etc, because it was created last 
>>> time I ran "fab all". Perhaps in the future, I can help make "fab all" 
>>> idempotent). Perhaps I should now try following the documentation 
>>> <http://mezzanine.jupo.org/docs/deployment.html> for Case 2: Deploying 
>>> to an existing server instead? But I'm hesitant to just try it, for fear 
>>> that I might mess things up further.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to