Issue 9408

Title
Entering wrong URL locks the user out of the profile editor
Priority
bug
Status
resolved
Nosy list
ced, edbo, reviewbot, roundup-bot
Assigned to
ced
Keywords
review

Created on 2020-06-12.18:17:17 by edbo, last changed 2 months ago by roundup-bot.

Messages

New changeset 7e43f2f49786 by Cédric Krier in branch '5.6':
Catch any exception for server version RPC
https://hg.tryton.org/tryton/rev/7e43f2f49786

New changeset 834a6ace3cc8 by Cédric Krier in branch '5.4':
Catch any exception for server version RPC
https://hg.tryton.org/tryton/rev/834a6ace3cc8

New changeset 9990c3ed2cfd by Cédric Krier in branch '5.0':
Catch any exception for server version RPC
https://hg.tryton.org/tryton/rev/9990c3ed2cfd
New changeset 43714eceaf4f by Cédric Krier in branch 'default':
Catch any exception for server version RPC
https://hg.tryton.org/tryton-env/rev/43714eceaf4f
New changeset feb8125c72d2 by Cédric Krier in branch 'default':
Catch any exception for server version RPC
https://hg.tryton.org/tryton/rev/feb8125c72d2
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2020-10-24.21:37:27

Indeed we must catch any exception as new one can be added in each new Python version.
Here is review292561004

Author: [hidden] (edbo)
Date: 2020-06-12.18:20:46
> The only way out, it to edit manually the tryton.conf file and remove the entry there.

Entered the wrong file. It should be profiles.cfg.
Author: [hidden] (edbo)
Date: 2020-06-12.18:17:16
You can manage the profiles in the Tryton client, by opening a new window. On the left you can add a new profile name and on the right you fill the variables, like host, database and username.

However, when you accidentally enter something WITH spaces into the host field and leave the field, you are done. Everything is greyed out, including the buttons. The weird thing is that the username field is still editable where I would expect the host field to be editable. There is also no possibility to remove the troubling entry because clicking on it will already cause the error. 

The error:

ERROR:tryton.common.common:  File "/home/ERP/tryton-5.6.1/tryton/gui/window/dblogin.py", line 309, in refresh_databases_end
    if self.test_server_version(host, port) is False:
  File "/home/ERP/tryton-5.6.1/tryton/gui/window/dblogin.py", line 279, in test_server_version
    version = rpc.server_version(host, port)
  File "/home/ERP/tryton-5.6.1/tryton/rpc.py", line 67, in server_version
    result = connection.common.server.version()
  File "/usr/lib64/python3.8/xmlrpc/client.py", line 1109, in __call__
    return self.__send(self.__name, args)
  File "/home/ERP/tryton-5.6.1/tryton/jsonrpc.py", line 291, in __request
    response = self.__transport.request(
  File "/usr/lib64/python3.8/xmlrpc/client.py", line 1153, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python3.8/xmlrpc/client.py", line 1165, in single_request
    http_conn = self.send_request(host, handler, request_body, verbose)
  File "/usr/lib64/python3.8/xmlrpc/client.py", line 1266, in send_request
    connection = self.make_connection(host)
  File "/home/ERP/tryton-5.6.1/tryton/jsonrpc.py", line 238, in make_connection
    fingerprint = https_connection(allow_http=True)
  File "/home/ERP/tryton-5.6.1/tryton/jsonrpc.py", line 208, in https_connection
    self._connection = host, HTTPSConnection(host,
  File "/usr/lib64/python3.8/http/client.py", line 1367, in __init__
    super(HTTPSConnection, self).__init__(host, port, timeout,
  File "/usr/lib64/python3.8/http/client.py", line 831, in __init__
    self._validate_host(self.host)
  File "/usr/lib64/python3.8/http/client.py", line 1193, in _validate_host
    raise InvalidURL(f"URL can't contain control characters. {host!r} "

InvalidURL: URL can't contain control characters. 'Test Server' (found at least ' ')

The only way out, it to edit manually the tryton.conf file and remove the entry there.
History
Date User Action Args
2020-10-30 19:59:46roundup-botsetkeyword: - backport
messages: + msg61573
2020-10-26 21:29:08roundup-botsetmessages: + msg61429
2020-10-26 21:29:06roundup-botsetmessages: + msg61428
nosy: + roundup-bot
status: testing -> resolved
2020-10-24 22:10:09reviewbotsetmessages: + msg61367
nosy: + reviewbot
2020-10-24 21:37:27cedsetkeyword: + backport, review
messages: + msg61366
reviews: 292561004
status: in-progress -> testing
2020-10-24 21:33:50cedsetassignedto: ced
nosy: + ced
status: chatting -> in-progress
type: crash
2020-06-12 18:20:47edbosetstatus: unread -> chatting
messages: + msg58666
2020-06-12 18:17:17edbocreate

Showing 10 items. Show all history (warning: this could be VERY long)