Bug 1636867 - [OVN][[OVS BLOCKED] - Can't create ovn network with Hebrew characters - "UnicodeEncodeError: 'ascii' codec can't encode characters"
Summary: [OVN][[OVS BLOCKED] - Can't create ovn network with Hebrew characters - "Unic...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Network
Version: 4.2.6.2
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ovirt-4.3.5
: ---
Assignee: Miguel Duarte Barroso
QA Contact: Michael Burman
URL:
Whiteboard:
Depends On: 1666710 1714179
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-08 07:21 UTC by Michael Burman
Modified: 2019-07-30 14:08 UTC (History)
4 users (show)

Fixed In Version: openvswitch2.11-2.11.0-9.el7fdp.x86_64
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-30 14:08:05 UTC
oVirt Team: Network
Embargoed:
rule-engine: ovirt-4.3+
ylavi: blocker-


Attachments (Terms of Use)
ovn log (10.77 KB, application/x-gzip)
2018-10-08 07:23 UTC, Michael Burman
no flags Details
new ovn log (4.80 KB, application/gzip)
2018-12-24 12:45 UTC, Michael Burman
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 94798 0 master MERGED Fix network name unicode bug 2020-11-14 19:07:38 UTC
oVirt gerrit 96745 0 master ABANDONED Unicode fix. 2020-11-14 19:07:18 UTC

Description Michael Burman 2018-10-08 07:21:19 UTC
Description of problem:
[OVN] - Can't create ovn network with Hebrew characters - 
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128).

When trying to create an external network with Hebrew characters i get - 

2018-10-08 10:04:19,908 root Request body:
{
  "network" : {
    "name" : "רשתחיצונית",
    "admin_state_up" : true
  }
}
2018-10-08 10:04:19,908 root None
Traceback (most recent call last):
  File "/usr/share/ovirt-provider-ovn/handlers/base_handler.py", line 134, in _handle_request
    method, path_parts, content
  File "/usr/share/ovirt-provider-ovn/handlers/selecting_handler.py", line 175, in handle_request
    return self.call_response_handler(handler, content, parameters)
  File "/usr/share/ovirt-provider-ovn/handlers/neutron.py", line 36, in call_response_handler
    return response_handler(ovn_north, content, parameters)
  File "/usr/share/ovirt-provider-ovn/handlers/neutron_responses.py", line 140, in post_networks
    network = nb_db.add_network(received_network)
  File "/usr/share/ovirt-provider-ovn/neutron/neutron_api_mappers.py", line 76, in wrapper
    else f(wrapped_self, rest_data))
  File "/usr/share/ovirt-provider-ovn/neutron/neutron_api_mappers.py", line 59, in wrapper
    return cls.rest2row(wrapped_self, f, rest_data, entity_id)
  File "/usr/share/ovirt-provider-ovn/neutron/neutron_api_mappers.py", line 184, in rest2row
    port_security_enabled=port_security
  File "/usr/share/ovirt-provider-ovn/neutron/neutron_api_mappers.py", line 83, in wrapper
    data = f(wrapped_self, *args, **kwargs)
  File "/usr/share/ovirt-provider-ovn/neutron/neutron_api.py", line 103, in add_network
    self._create_network(name, mtu, port_security_enabled)
  File "/usr/share/ovirt-provider-ovn/neutron/neutron_api.py", line 114, in _create_network
    name = 'ovirt-{name}-{gen_id}'.format(name=name, gen_id=uuid.uuid4())
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-9: ordinal not in range(128)

Version-Release number of selected component (if applicable):
4.2.7.2_SNAPSHOT-120.gb074dc8.0.scratch.master.el7ev
4.3.0-0.0.master.20181007173621.git678f1a8.el7

How reproducible:
100%

Steps to Reproduce:
1. Try to create an external network(ovn) with Hebrew characters

Actual results:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-9: ordinal not in range(128)

Expected results:
Should work

Comment 1 Michael Burman 2018-10-08 07:23:29 UTC
Created attachment 1491526 [details]
ovn log

Comment 2 Michael Burman 2018-10-22 07:59:34 UTC
Verified on - ovirt-provider-ovn-1.2.17-0.20181016103251.git3d03ecf.el7.noarch and 4.3.0-0.0.master.20181016132820.gite60d148.el7

Comment 3 Sandro Bonazzola 2018-11-02 14:28:58 UTC
This bugzilla is included in oVirt 4.2.7 release, published on November 2nd 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.7 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.

Comment 4 Sandro Bonazzola 2018-11-02 14:40:55 UTC
Closed by mistake, moving back to qa -> verified

Comment 5 Dominik Holler 2018-12-21 08:08:02 UTC
Even this issue was fixed already, it needs to be verified and probably fixed again.

Comment 6 Michael Burman 2018-12-24 06:25:01 UTC
The bug has failedQA. Still exist on -
rhvm-4.3.0-0.6.alpha2.el7.noarch
ovirt-provider-ovn-1.2.17-1.el7ev.noarch
rhv-openvswitch-ovn-common-2.10-3.el7ev.noarch
rhv-openvswitch-ovn-central-2.10-3.el7ev.noarch

Note that now, the behavior is even worse then before. After failing to create such network, the ovn provider need a restart, becasue it's no more possible to communicate with him or to create networks on him. Also the OVS database is completely dead. Not sure yet how to recover from this.

TimeoutException: Commands [<ovsdbapp.schema.ovn_northbound.commands.LsAddCommand object at 0x7fe1c4298cd0>] exceeded timeout 100 seconds
TimeoutException: Commands [<ovsdbapp.schema.ovn_northbound.commands.LsAddCommand object at 0x7fe1c4298cd0>] exceeded timeout 100 seconds

Error while executing action AddNetworkOnProvider: Failed to communicate with the external provider, see log for additional details.


{
  "network" : {
    "name" : "רשת_חיצונית",
    "admin_state_up" : true,
    "port_security_enabled" : true
  }
}


Traceback (most recent call last):
  File "/usr/share/ovirt-provider-ovn/ovirt_provider_ovn.py", line 65, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "/usr/lib64/python2.7/threading.py", line 765, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/connection.py", line 95, in run
    self.idl.run()
  File "/usr/lib64/python2.7/site-packages/ovs/db/idl.py", line 230, in run
    msg = self._session.recv()
  File "/usr/lib64/python2.7/site-packages/ovs/jsonrpc.py", line 567, in recv
    error, msg = self.rpc.recv()
  File "/usr/lib64/python2.7/site-packages/ovs/jsonrpc.py", line 301, in recv
    self.input = self.input[self.parser.feed(self.input):]
UnicodeEncodeError: 'ascii' codec can't encode characters in position 158-160: ordinal not in range(128)


2018-12-24 08:17:30,827 root OVS database connection to %(db_schema)s failed with error: '%(error)s'. Verify that OVS and related services are available and that the relevant configuration options are correct.
Traceback (most recent call last):
  File "/usr/share/ovirt-provider-ovn/handlers/base_handler.py", line 134, in _handle_request
    method, path_parts, content
  File "/usr/share/ovirt-provider-ovn/handlers/selecting_handler.py", line 175, in handle_request
    return self.call_response_handler(handler, content, parameters)
  File "/usr/share/ovirt-provider-ovn/handlers/neutron.py", line 35, in call_response_handler
    with NeutronApi() as ovn_north:
  File "/usr/share/ovirt-provider-ovn/neutron/neutron_api.py", line 63, in __init__
    self.ovsidl, self.idl = ovn_connection.connect()
  File "/usr/share/ovirt-provider-ovn/ovn_connection.py", line 48, in connect
    timeout=100
  File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/__init__.py", line 31, in __init__
    self.start_connection(connection)
  File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/__init__.py", line 43, in start_connection
    raise connection_exception

Comment 7 Michael Burman 2018-12-24 12:45:39 UTC
Created attachment 1516542 [details]
new ovn log

Comment 8 Dominik Holler 2019-01-10 09:02:46 UTC
openvswitch-2.9.0-56 from https://cbs.centos.org/koji/buildinfo?buildID=24381 is working, but unfortunately, this build is not included in ovirt-4.2.8, and ovirt-4.3 requires openvswitch >= 2.10

Comment 9 Miguel Duarte Barroso 2019-01-11 16:46:50 UTC
The issue seems to only affect the C json parser; falling back to the python json parser could be a valid workaround.

This can be achieved by removing the C parser from the filesystem, and restarting the provider:
> rm /usr/lib64/python2.7/site-packages/ovs/_json.so
> systemctl restart ovirt-provider-ovn

Keep in mind that the C json parser is *a lot* faster than the python one.

Comment 10 Dan Kenigsberg 2019-04-20 15:22:08 UTC
This requires us to move to ovs-2.11, so I would not rush it.

Comment 11 Dominik Holler 2019-06-11 13:21:44 UTC
Michael, does this issue is solved with ovs-2.11?

Comment 12 Michael Burman 2019-06-16 08:51:59 UTC
(In reply to Dominik Holler from comment #11)
> Michael, does this issue is solved with ovs-2.11?

Yes it is solved with 2.11 indeed

Comment 13 Michael Burman 2019-06-16 08:56:30 UTC
Verified on - 4.3.5-0.1.el7 with:
openvswitch2.11-2.11.0-9.el7fdp.x86_64
rhv-openvswitch-2.11-4.el7ev.noarch
rhv-openvswitch-ovn-central-2.11-4.el7ev.noarch
rhv-openvswitch-ovn-common-2.11-4.el7ev.noarch
rhv-python-openvswitch-2.11-4.el7ev.noarch
openvswitch-selinux-extra-policy-1.0-13.el7fdp.noarch
ovn2.11-2.11.0-16.el7fdp.x86_64
ovn2.11-central-2.11.0-16.el7fdp.x86_64
ovirt-provider-ovn-1.2.22-1.el7ev.noarch

Comment 14 Sandro Bonazzola 2019-07-30 14:08:05 UTC
This bugzilla is included in oVirt 4.3.5 release, published on July 30th 2019.

Since the problem described in this bug report should be
resolved in oVirt 4.3.5 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.