make check on master fails due to UnicodeDecodeError

Hi there, I'm trying to run make check, and I have ~13 tests on vdsm/tests which failes due to the following: File "/home/sleviim/git/vdsm/lib/vdsm/api/vdsmapi.py", line 212, in __init__ loaded_schema = pickle.load(f) File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128) (Those lines are common to all failures) Here is an example: ====================================================================== ERROR: test_ok_response (vdsmapi_test.DataVerificationTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sleviim/git/vdsm/tests/vdsmapi_test.py", line 96, in test_ok_response _schema.schema().verify_retval( File "/home/sleviim/git/vdsm/tests/vdsmapi_test.py", line 67, in schema self._schema = vdsmapi.Schema(paths, True) File "/home/sleviim/git/vdsm/lib/vdsm/api/vdsmapi.py", line 212, in __init__ loaded_schema = pickle.load(f) File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128) I've also tried to git clean -dxf && ./autogen.sh --system but it didn't help. Can you please assist? Thanks! *Regards,* *Shani Leviim*

On Tue, Apr 10, 2018 at 2:52 PM Shani Leviim <sleviim@redhat.com> wrote:
Hi there, I'm trying to run make check, and I have ~13 tests on vdsm/tests which failes due to the following:
File "/home/sleviim/git/vdsm/lib/vdsm/api/vdsmapi.py", line 212, in __init__ loaded_schema = pickle.load(f) File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128)
(Those lines are common to all failures)
Here is an example:
====================================================================== ERROR: test_ok_response (vdsmapi_test.DataVerificationTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sleviim/git/vdsm/tests/vdsmapi_test.py", line 96, in test_ok_response _schema.schema().verify_retval( File "/home/sleviim/git/vdsm/tests/vdsmapi_test.py", line 67, in schema self._schema = vdsmapi.Schema(paths, True) File "/home/sleviim/git/vdsm/lib/vdsm/api/vdsmapi.py", line 212, in __init__ loaded_schema = pickle.load(f) File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128)
I've also tried to git clean -dxf && ./autogen.sh --system but it didn't help.
Did you clean in the root directory? cd vdsm-checkout-dir git clean -dxf ./autogen.sh --system make make check Also, on which system do you run the tests? Fedora 27? CentOS? RHEL? Nir

Hi, Yes, I did clean the root directory but it didn't solve the issue. I'm currently running the tests on fedora27, using python version 2.1.14. Thanks to Dan's help, it seems that we found the root cause: I had 2 pickle files under /var/cache/vdsm/schema: vdsm-api.pickle and vdsm-events.pickle. Removing them and re-running the tests using make check was successfully completed. It was probably derived from a different encoding for python 2 and 3 while loading the schema file. *Regards,* *Shani Leviim* On Tue, Apr 10, 2018 at 4:19 PM, Nir Soffer <nsoffer@redhat.com> wrote:
On Tue, Apr 10, 2018 at 2:52 PM Shani Leviim <sleviim@redhat.com> wrote:
Hi there, I'm trying to run make check, and I have ~13 tests on vdsm/tests which failes due to the following:
File "/home/sleviim/git/vdsm/lib/vdsm/api/vdsmapi.py", line 212, in __init__ loaded_schema = pickle.load(f) File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128)
(Those lines are common to all failures)
Here is an example:
====================================================================== ERROR: test_ok_response (vdsmapi_test.DataVerificationTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sleviim/git/vdsm/tests/vdsmapi_test.py", line 96, in test_ok_response _schema.schema().verify_retval( File "/home/sleviim/git/vdsm/tests/vdsmapi_test.py", line 67, in schema self._schema = vdsmapi.Schema(paths, True) File "/home/sleviim/git/vdsm/lib/vdsm/api/vdsmapi.py", line 212, in __init__ loaded_schema = pickle.load(f) File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128)
I've also tried to git clean -dxf && ./autogen.sh --system but it didn't help.
Did you clean in the root directory?
cd vdsm-checkout-dir git clean -dxf ./autogen.sh --system make make check
Also, on which system do you run the tests? Fedora 27? CentOS? RHEL?
Nir

On Tue, Apr 10, 2018 at 5:21 PM Shani Leviim <sleviim@redhat.com> wrote:
Hi,
Yes, I did clean the root directory but it didn't solve the issue. I'm currently running the tests on fedora27, using python version 2.1.14.
Thanks to Dan's help, it seems that we found the root cause:
I had 2 pickle files under /var/cache/vdsm/schema: vdsm-api.pickle and vdsm-events.pickle. Removing them and re-running the tests using make check was successfully completed.
How did you have cached schema under /var/run? This directory is owned by root. Are you running the tests as root? This sounds like a bug in the code using the pickled schema. The pickled should not be used if the timestamp of the pickle do not match the timestamp of the source. Also in make check, we should not use host schema cache, but local schema cache generated by running "make". Nir

HI, *Regards,* *Shani Leviim* On Tue, Apr 10, 2018 at 5:32 PM, Nir Soffer <nsoffer@redhat.com> wrote:
On Tue, Apr 10, 2018 at 5:21 PM Shani Leviim <sleviim@redhat.com> wrote:
Hi,
Yes, I did clean the root directory but it didn't solve the issue. I'm currently running the tests on fedora27, using python version 2.1.14.
Thanks to Dan's help, it seems that we found the root cause:
I had 2 pickle files under /var/cache/vdsm/schema: vdsm-api.pickle and vdsm-events.pickle. Removing them and re-running the tests using make check was successfully completed.
How did you have cached schema under /var/run? This directory is owned by root. Are you running the tests as root?
No, I'm running the tests over my laptop using my user.
This sounds like a bug in the code using the pickled schema. The pickled should not be used if the timestamp of the pickle do not match the timestamp of the source.
There's a suspect that there's a different encoding for python 2 and python 3. While I checnged "with open(pickle_path) as f:" to "with open(pickle_path,'rb') as f: " (I was inspiered by [1]), the make check seems to complete successfully. [1] https://stackoverflow.com/questions/28218466/unpickling-a-python-2-object-wi...
Also in make check, we should not use host schema cache, but local schema cache generated by running "make".
Nir

A patch was uploaded: https://gerrit.ovirt.org/#/c/90093/ *Regards,* *Shani Leviim* On Wed, Apr 11, 2018 at 9:59 AM, Shani Leviim <sleviim@redhat.com> wrote:
HI,
*Regards,*
*Shani Leviim*
On Tue, Apr 10, 2018 at 5:32 PM, Nir Soffer <nsoffer@redhat.com> wrote:
On Tue, Apr 10, 2018 at 5:21 PM Shani Leviim <sleviim@redhat.com> wrote:
Hi,
Yes, I did clean the root directory but it didn't solve the issue. I'm currently running the tests on fedora27, using python version 2.1.14.
Thanks to Dan's help, it seems that we found the root cause:
I had 2 pickle files under /var/cache/vdsm/schema: vdsm-api.pickle and vdsm-events.pickle. Removing them and re-running the tests using make check was successfully completed.
How did you have cached schema under /var/run? This directory is owned by root. Are you running the tests as root?
No, I'm running the tests over my laptop using my user.
This sounds like a bug in the code using the pickled schema. The pickled should not be used if the timestamp of the pickle do not match the timestamp of the source.
There's a suspect that there's a different encoding for python 2 and python 3. While I checnged "with open(pickle_path) as f:" to "with open(pickle_path,'rb') as f: " (I was inspiered by [1]), the make check seems to complete successfully.
[1] https://stackoverflow.com/questions/28218466/unpickling- a-python-2-object-with-python-3
Also in make check, we should not use host schema cache, but local schema cache generated by running "make".
Nir
participants (2)
-
Nir Soffer
-
Shani Leviim