postgres/psychopg2 connect problem -- need help

35 views
Skip to first unread message

weheh

unread,
Apr 26, 2015, 3:10:11 AM4/26/15
to web...@googlegroups.com
I'm moving my app to a new server. It's running Windows 8.1 (sorry about that, but it can't be avoided for technical reasons). Regardless, I backed up my postgres db on my old server and moved it over to the new server and sucked it into postgres. The db is associated with the same user name and password. Now, however, when I try to start my app, I get the error message:

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 224, in restricted
    exec ccode in environment
  File "C:/web2py/applications/myapp/models/0_0_globals.py", line 25, in <module>
    migrate=False,  # enable in production for increased performance
  File "C:\web2py\gluon\dal\base.py", line 432, in __init__
    raise RuntimeError("Failure to connect, tried %d times:\n%s" % (attempts, tb))
RuntimeError: Failure to connect, tried 10 times:
Traceback (most recent call last):
  File "C:\web2py\gluon\dal\base.py", line 410, in __init__
    self._adapter = ADAPTERS[self._dbname](**kwargs)
  File "C:\web2py\gluon\dal\adapters\base.py", line 47, in __call__
    obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File "C:\web2py\gluon\dal\adapters\postgres.py", line 144, in __init__
    if do_connect: self.reconnect()
  File "C:\web2py\gluon\dal\connection.py", line 113, in reconnect
    self.connection = f()
  File "C:\web2py\gluon\dal\adapters\postgres.py", line 142, in connector
    return self.driver.connect(msg,**driver_args)
  File "C:\Program Files (x86)\Python27\lib\site-packages\psycopg2\__init__.py", line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: FATAL:  password authentication failed for user "myuser"

I'm using the same credentials as before. Nothing has changed. psychopg2 is installed. The password has been validated multiple times directly in postgres.

This is all running on web2py 2.9.12-stable+timestamp.2015.01.17.06.11.03 (Running on Rocket 1.2.6, Python 2.7.8)     



Anybody have any ideas how to get this running again? 

Paolo Valleri

unread,
Apr 26, 2015, 4:14:38 AM4/26/15
to web...@googlegroups.com
you have to setup the user on the new postgres server. You have probably restored only the data of the database.

weheh

unread,
Apr 26, 2015, 4:24:25 AM4/26/15
to web...@googlegroups.com
Thanks for the response, but no, before restoring the database I created the user and the database directly in postgres. Then I ran web2py and got the error. Then I restored the database from the old server and ran web2py and got the same error. I dropped the database and tried again and got the same result.

This may be relevant ... I'm not sure ... but if I have an "import mymodule" in my code before the DAL declaration, I get the following ticket indicating the module can't be found. This makes me suspect my web2py installation, because this works flawlessly both on the old server and my development platform using the same version of web2py.

1.
2.
3.
4.
5.
6.
7.
8.
9.
Traceback (most recent call last):
File "C:\web2py\gluon\restricted.py", line 224, in restricted
exec ccode in environment
  File "C:/web2py/applications/myapp/models/0_0_globals.py", line 20, in <module>
import mymodule
File "C:\web2py\gluon\custom_import.py", line 82, in custom_importer
modules_prefix, globals, locals, [itemname], level)
ImportError: No module named myapp.modules

Anybody have any ideas why my modules directory isn't being found?

Paolo Valleri

unread,
Apr 26, 2015, 4:47:18 AM4/26/15
to web...@googlegroups.com
The error says: FATAL:  password authentication failed for user "myuser"
Given that, as far as I can see it's related to postgres rather than web2py

 Paolo

2015-04-26 10:24 GMT+02:00 weheh <richard...@verizon.net>:
Thanks for the response, but no, before restoring the database I created the user and the database directly in postgres. Then I ran web2py and got the error. Then I restored the database from the old server and ran web2py and got the same error. I dropped the database and tried again and got the same result.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/F-IN0huIabA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages