Address already in use when running trytond over web

131 views
Skip to first unread message

Dr. Praveen Bhatia

unread,
Jun 3, 2017, 5:10:30 AM6/3/17
to tryton
What is the correct way to setup trytond to be accessed over web in ver 4.2?

Following is the instruction from the documentation:
==================

web

Defines the behavior of the web interface.

listen

Defines the couple of host (or IP address) and port number separated by a colon to listen on.

Default localhost:8000

hostname

Defines the hostname.

root

Defines the root path served by GET requests.

Default: Under the www directory of user’s home running trytond.

=================
If the global ip address on aws is say 111.222.333.444 and custom tcp ports 8888-8890 are opened, is the following correct in the config file?

listen=111.222.333.444:8889   OR listen=*:8889
hostname=111.222.333.444
root=~/mytryton

Trytond start:
trytond -c /etc/trytond.conf &

GIVES ERROR : Address already in use


Also, Is the correct Access from tryton client:
tryton -c /etc/trytond.conf -p 8889 -s 111.222.333.444

Is the above correct usage? All combinations I try keep giving the error "Address already in use"
Does tryton application on AWS require a certificate like .pem file to be run over the web else AWS will not allow access? 





Cédric Krier

unread,
Jun 3, 2017, 5:35:07 AM6/3/17
to tryton
On 2017-06-03 02:10, Dr. Praveen Bhatia wrote:
> If the global ip address on aws is say 111.222.333.444 and custom tcp ports
> 8888-8890 are opened, is the following correct in the config file?
>
> listen=111.222.333.444:8889 OR listen=*:8889

Using * means all interface but using a specific IP is only for the
interface with this IP. Using specific IP could be annoying if the IP
change.

> hostname=111.222.333.444
> root=~/mytryton
>
> Trytond start:
> trytond -c /etc/trytond.conf &
>
> GIVES ERROR : Address already in use
>
>
> Also, Is the correct Access from tryton client:
> tryton -c /etc/trytond.conf -p 8889 -s 111.222.333.444
>
> Is the above correct usage?

I see nothing wrong here.

> All combinations I try keep giving the error
> "Address already in use"

You have another process that is already using this address.
You have to find it.
I use this command to find it:

$ netstat -lnp --inet

> Does tryton application on AWS require a certificate like .pem file to be
> run over the web else AWS will not allow access?

It is not required but highly recommended for privacy. Without a
certificate the communication between the clients and the server will be
in clear text and malicious people could sniff it and collect password,
data etc.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Dr. Praveen Bhatia

unread,
Jun 3, 2017, 8:29:57 AM6/3/17
to tryton


On Saturday, June 3, 2017 at 6:35:07 PM UTC+9, Cédric Krier wrote:
On 2017-06-03 02:10, Dr. Praveen Bhatia wrote:
> If the global ip address on aws is say 111.222.333.444 and custom tcp ports
> 8888-8890 are opened, is the following correct in the config file?
>
> listen=111.222.333.444:8889   OR listen=*:8889

Using * means all interface but using a specific IP is only for the
interface with this IP. Using specific IP could be annoying if the IP
change.

> hostname=111.222.333.444
> root=~/mytryton
>
> Trytond start:
> trytond -c /etc/trytond.conf &
>
> GIVES ERROR : Address already in use
>
>
> Also, Is the correct Access from tryton client:
> tryton -c /etc/trytond.conf -p 8889 -s 111.222.333.444
>
> Is the above correct usage?

I see nothing wrong here.

> All combinations I try keep giving the error
> "Address already in use"

You have another process that is already using this address.
You have to find it.
I use this command to find it:

    $ netstat -lnp --inet


When I do: 
sudo netstat -lnp --inet | grep 8889

I get null, so port 8889 is not being used and yet the "Address already  in use" error comes irrespective of the various ports that I try. 

The error that I get is


(tryton4.2) ubuntu@ip-172-30-0-215:~/Projects/tryton4.2$ trytond -c /etc/trytond.conf &
[1] 14538
(tryton4.2) ubuntu@ip-172-30-0-215:~/Projects/tryton4.2$ Traceback (most recent call last):
  File "/home/ubuntu/Envs/tryton4.2/bin/trytond", line 51, in <module>
    use_reloader=options.dev)
  File "/home/ubuntu/Envs/tryton4.2/local/lib/python2.7/site-packages/werkzeug/serving.py", line 739, in run_simple
    inner()
  File "/home/ubuntu/Envs/tryton4.2/local/lib/python2.7/site-packages/werkzeug/serving.py", line 699, in inner
    fd=fd)
  File "/home/ubuntu/Envs/tryton4.2/local/lib/python2.7/site-packages/werkzeug/serving.py", line 587, in make_server
    passthrough_errors, ssl_context, fd=fd)
  File "/home/ubuntu/Envs/tryton4.2/local/lib/python2.7/site-packages/werkzeug/serving.py", line 504, in __init__
    HTTPServer.__init__(self, (host, int(port)), handler)
  File "/usr/lib/python2.7/SocketServer.py", line 419, in __init__
    self.server_bind()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind
    SocketServer.TCPServer.server_bind(self)
  File "/usr/lib/python2.7/SocketServer.py", line 430, in server_bind
    self.socket.bind(self.server_address)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use
 

Dr. Praveen Bhatia

unread,
Jun 3, 2017, 11:08:42 AM6/3/17
to tryton
On reboot I could get rid of this error. However, it seems to assign it to localhost port only and not the aws address 111.222.333.444:8888 
When I try to connect from my PC by tryton client 111.222.333.444:8888  it is not able to connect to the server and hence find no list of databases..... So what am I doing wrong?

The /etc/trytond.conf file has

# Activate the json-rpc protocol
#jsonrpc = localhost:8001
#ssl_jsonrpc = False
listen=111.222.333.444:8888
hostname=111.222.333.444
root=~/db
#jsonrpc=*:8889


Cédric Krier

unread,
Jun 3, 2017, 8:05:08 PM6/3/17
to tryton
But you are talking about 8888

> On reboot I could get rid of this error. However, it seems to assign it to
> localhost port only and not the aws address 111.222.333.444:8888
> When I try to connect from my PC by tryton client 111.222.333.444:8888 it
> is not able to connect to the server and hence find no list of
> databases..... So what am I doing wrong?

I guess you have a firewall so you must allow external to connect to
this port.
Reply all
Reply to author
Forward
0 new messages