Repository navigation
Closed
Labels
P1I'll work on this now. (Assignee required)team-Rules-PythonNative rules for Pythontype: support / not a bug (process)
Description
Hey @brandjon,
we are seeing a Python error with Bazel@HEAD that we are not seeing with Bazel 0.26.1
UnicodeEncodeError: 'ascii' codec can't encode character '\U0001f60e' in position 190: ordinal not in range(128)
I believe you updated the Python rules to pick python3 instead of python2 by default in master?
Executing tests from //test/extensions/filters/network/thrift_proxy:integration_test
-----------------------------------------------------------------------------
WARNING: Perftools heap leak checker is active -- Performance may suffer
[==========] Running 98 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 96 tests from TransportAndProtocol/ThriftConnManagerIntegrationTest
[ RUN ] TransportAndProtocol/ThriftConnManagerIntegrationTest.Success/FramedBinary
ERROR:root:Unexpected exception in handler
Traceback (most recent call last):
File "/var/lib/buildkite-agent/builds/bk-docker-spqt/bazel-downstream-projects/envoy/test/extensions/filters/network/thrift_proxy/driver/generated/example/Example.py", line 239, in process_execute
result.success = self._handler.execute(args.input)
File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/d1c957111778f6d978cec2005bbaba74/sandbox/linux-sandbox/4808/execroot/envoy/bazel-out/k8-fastbuild/bin/test/extensions/filters/network/thrift_proxy/integration_test.runfiles/envoy/test/extensions/filters/network/thrift_proxy/driver/server.py", line 33, in execute
print("server: execute({0})".format(param))
UnicodeEncodeError: 'ascii' codec can't encode character '\U0001f60e' in position 190: ordinal not in range(128)
client exception: 6: Internal error
test/extensions/filters/network/thrift_proxy/integration_test.cc:197: Failure
Expected equality of these values:
1U
Which is: 1
counter->value()
Which is: 0
[ FAILED ] TransportAndProtocol/ThriftConnManagerIntegrationTest.Success/FramedBinary, where GetParam() = (4-byte object <00-00 00-00>, 4-byte object <00-00 00-00>, false) (742 ms)
Metadata
Metadata
Assignees
Labels
P1I'll work on this now. (Assignee required)team-Rules-PythonNative rules for Pythontype: support / not a bug (process)
Activity
brandjon commentedon Jun 13, 2019
Yep, Python 2 vs 3 errors are likely from my change. The fix is to ensure the target properly declares itself as PY2 if that's the version its source code requires. This can be done by setting
python_version = "PY2"forpy_binary/py_testtargets. If it's apy_binaryused in the host config then you need--host_force_python=PY2. See #7899 for more migration info.keith commentedon Jun 13, 2019
I should be able to fix this on the envoy side when I'm back in the office next week
buchgr commentedon Jun 13, 2019
thanks @keith!
lizan commentedon Jun 18, 2019
@buchgr this is fixed in envoyproxy/envoy#7305
keith commentedon Jun 18, 2019
I've submitted a PR to re-enable it on CI here bazelbuild/continuous-integration#729
Re-enable Envoy (#729)
c-parsons commentedon Jun 20, 2019
Since this test was re-enabled, it hasn't had a green run with Bazel@HEAD
The errors continue to look like python issues.
and
https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1045#18e29d9e-99e1-484b-8e11-0730630ceebf
brandjon commentedon Jun 20, 2019
That "client" target you updated with
python_version = "PY2"appears to still be using Python 3. That probably means it's being used in the host config and you need to add--host_force_python=PY2to the top-level bazelrc (for the "build" command).bazel: Force python 2 for host tools
keith commentedon Jun 20, 2019
I'm trying to use that flag, but based on @lizan's PR that only set a few of our py_binary targets to PY2, so I'm not sure it will work still. envoyproxy/envoy#7337
Is there any way we can trigger that bazel job against this PR if it does end up being green on normal envoy CI?
1 remaining item
bazel: Force python 2 for host tools (#7337)
keith commentedon Jun 20, 2019
Well my PR was merged upstream so we can wait for the next run and see if that fixed this case.
meteorcloudy commentedon Jun 21, 2019
We have no way to trigger a CI build with Bazel@HEAD for a PR from envoy. But it's easy to get a Bazel binary built from HEAD.
brandjon commentedon Jun 25, 2019
@keith, looks like the httplib failure is still there at head, which is why the downstream pipeline hasn't picked up your other change.
It sounds like
socket_passingneeds to be declaredpython_version = "PY2".brandjon commentedon Jun 25, 2019
See also this comment about how to ensure
httplibis available in the Python environment. But it sounds like you already havehttplibavailable for PY2 and just need to make this target PY2.keith commentedon Jun 25, 2019
This should be fixed by envoyproxy/envoy#7391
keith commentedon Jun 26, 2019
Envoy CI is now on 0.27.0, so I'm hoping we're good on the next bazel CI run now
meteorcloudy commentedon Jun 27, 2019
Envoy is green on Bazel CI! Thanks for the fix!
Re-enable Envoy (bazelbuild#729)