thanks!
I tried to replace localhost with 127.0.0.1, 192.168.0.16 (it's
actually ip). but it doesn't work....

Cheers,
Zhe

On Aug 6, 12:33 pm, mdipierro <[email protected]> wrote:
> Try replace
>
> localhost
> with
> 127.0.0.1
> and with the actual IP of the machine. It may not be serving on
> localhost
>
> On Aug 6, 5:25 am, Zhe Li <[email protected]> wrote:
>
>
>
> > Hi,
>
> > Thanks! This is the result from trunk.
>
> > Error traceback
> > Traceback (most recent call last):
> >   File "gluon/restricted.py", line 186, in restricted
> >     exec ccode in environment
> >   File "/home/www-data/web2py/applications/welcome/models/db.py", line
> > 15, in <module>
> >     db = DAL('postgres://web2py:test...@localhost:1216/labdb')       #
> > if not, use SQLite or other DB
> >   File "gluon/sql.py", line 3911, in DAL
> >     raise RuntimeError, "%s (tried 5 times)" % exception
> > RuntimeError: could not connect to server: Connection refused
> >     Is the server running on host "localhost" and accepting
> >     TCP/IP connections on port 1216?
> > could not connect to server: Connection refused
> >     Is the server running on host "localhost" and accepting
> >     TCP/IP connections on port 1216?
> >  (tried 5 times)
> > Error snapshot
> > Detailed traceback description
> > Exception: <type 'exceptions.RuntimeError'>(could not connect to
> > server: Connection refused Is the server running on host "localhost"
> > and accepting TCP/IP connections on port 1216? could not connect to
> > server: Connection refused Is the server running on host "localhost"
> > and accepting TCP/IP connections on port 1216? (tried 5 times))
> > Python 2.6.5: /usr/bin/python
>
> > This is odd since I can connect to it both from command-line and
> > another machine using web2py account....
>
> > Cheers,
> > Zhe
>
> > On Aug 6, 11:06 am, mdipierro <[email protected]> wrote:
>
> > > Please check the version in trunk. It should give you a more detailed
> > > error.
>
> > > On Aug 6, 3:06 am, Zhe Li <[email protected]> wrote:
>
> > > > Hello everyone,
>
> > > > I tried to deploy web2py on my ubuntu server using
> > > > setup_web2py_ubuntu.sh. Everything seemed fine except when I switch
> > > > database from SQLite to PostgreSQL I got:
>
> > > > Error traceback
> > > > Traceback (most recent call last):
> > > >   File "gluon/restricted.py", line 178, in restricted
> > > >     exec ccode in environment
> > > >   File "/home/www-data/web2py/applications/init/models/db.py", line
> > > > 16, in <module>
> > > >     db = DAL('postgres://web2py:[email protected]:1216/labdb',
> > > > pool_size=10)
> > > >   File "gluon/sql.py", line 3911, in DAL
> > > >     raise RuntimeError, "Failure to connect to DB. Tried 5 times"
> > > > RuntimeError: Failure to connect to DB. Tried 5 times
>
> > > > but if I run the web server using:
>
> > > > python web2.py
>
> > > > it works fine. I got the same issue with MySQL as well.
>
> > > > Could you tell me what the problem might be? Thanks!
>
> > > > Cheers,
> > > > Zhe

Reply via email to