rbtools.commands.CommandError: Error validating diff 'ascii' codec can't decode byte 0xc2 in position 1333: ordinal not in range(128) (HTTP 400, API Error 224)

149 views
Skip to first unread message

Paul Mansfield

unread,
Jul 19, 2019, 5:50:56 AM7/19/19
to Review Board Community
We've been using reviewboard for a few months now. The server is 3.0.15 on CentOS7, as is the client.

I am using python 3.6.8 from the IUS repository.

This is the first time I've encountered this error, trying to submit a post-commit review on a feature branch before it gets merged into master.

I've seen similar codec related reported but none quite the same as this.
 

$ rbt post --debug --bugs-closed DEVOPS-163 --branch DEVOPS-163 master..DEVOPS-163
>>> RBTools 1.0.2
>>> Python 3.6.8 (default, May  2 2019, 20:40:44) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
>>> Running on Linux-3.10.0-957.21.2.el7.x86_64-x86_64-with-centos-7.6.1810-Core
>>> Home = /users/paulm
>>> Current directory = /users/paulm/codecommit/ADS-CICD-infrastructure/ci
>>> Command line: rbt post --debug --bugs-closed DEVOPS-163 --branch DEVOPS-163 master..DEVOPS-163
>>> Running: tf vc help
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git config --get branch.DEVOPS-163.merge
>>> Running: git config --get branch.DEVOPS-163.remote
>>> Running: git config --get remote.origin.url
>>> Repository info: Path: ssh://xxxxxxxxxxxxxxx@git-codecommit.eu-west-1.amazonaws.com/v1/repos/xxxx, Base path: , Supports changesets: False
>>> Making HTTP GET request to https://rb.xxxx/api/
>>> Running: git rev-parse master..DEVOPS-163
>>> Running: git config --get branch.DEVOPS-163.merge
>>> Running: git config --get branch.DEVOPS-163.remote
>>> Running: git branch --remotes
>>> Running: git rev-list edce8a7dd4284d40a57ba59ba7fac62c34b22f16 --not --remotes=origin
>>> Running: git version
>>> Running: git -c core.quotepath=false -c diff.noprefix=false diff --no-color --full-index --ignore-submodules -M --no-ext-diff edce8a7dd4284d40a57ba59ba7fac62c34b22f16..429fbfbd88d9258f17681407afaa119d4cee7773
>>> Generated diff size: 22187 bytes
>>> Making HTTP GET request to https://rb.xxxx/api/validation/diffs/
>>> Cached response for HTTP GET https://rb.xxxx/api/validation/diffs/ expired and was modified
>>> Making HTTP POST request to https://rb.xxxx/api/validation/diffs/
>>> Got API Error 224 (HTTP code 400): Unexpected error when validating the diff: 'ascii' codec can't decode byte 0xc2 in position 1333: ordinal not in range(128)
>>> Error data: {'stat': 'fail', 'err': {'msg': "Unexpected error when validating the diff: 'ascii' codec can't decode byte 0xc2 in position 1333: ordinal not in range(128)", 'code': 224}}
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/rbtools/api/request.py", line 685, in make_request
    request.url, body, headers, request.method))
  File "/usr/lib/python3.6/site-packages/rbtools/api/cache.py", line 209, in make_request
    return self.urlopen(request)
  File "/usr/lib64/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/lib/python3.6/site-packages/rbtools/api/request.py", line 240, in http_response
    response.info())
  File "/usr/lib64/python3.6/urllib/request.py", line 570, in error
    return self._call_chain(*args)
  File "/usr/lib64/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.6/urllib/request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: BAD REQUEST

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/rbtools/commands/post.py", line 867, in main
    **validate_kwargs)
  File "/usr/lib/python3.6/site-packages/rbtools/api/decorators.py", line 27, in request_method
    *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/rbtools/api/transport/sync.py", line 77, in execute_request_method
    return self._execute_request(request)
  File "/usr/lib/python3.6/site-packages/rbtools/api/transport/sync.py", line 86, in _execute_request
    rsp = self.server.make_request(request)
  File "/usr/lib/python3.6/site-packages/rbtools/api/request.py", line 687, in make_request
    self.process_error(e.code, e.read())
  File "/usr/lib/python3.6/site-packages/rbtools/api/request.py", line 661, in process_error
    rsp['err']['msg'])
rbtools.api.errors.BadRequestError: Unexpected error when validating the diff: 'ascii' codec can't decode byte 0xc2 in position 1333: ordinal not in range(128) (HTTP 400, API Error 224)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/bin/rbt", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.6/site-packages/rbtools/commands/main.py", line 120, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/usr/lib/python3.6/site-packages/rbtools/commands/__init__.py", line 725, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/usr/lib/python3.6/site-packages/rbtools/commands/post.py", line 875, in main
    (msg_prefix, e))
rbtools.commands.CommandError: Error validating diff

Unexpected error when validating the diff: 'ascii' codec can't decode byte 0xc2 in position 1333: ordinal not in range(128) (HTTP 400, API Error 224)


I discovered it's possible to change the encoding on a repository, when logged in as admin, so I tried "utf-8" and "ascii" and it didn't make a difference.  

Christian Hammond

unread,
Jul 19, 2019, 9:24:40 AM7/19/19
to revie...@googlegroups.com
Hi Paul,

We just recently received a similar report from another Power Pack customer using AWS CodeCommit, and believe we traced the issue to a bug there. I’m going to reach out to you today via our support channel and send you a patched build to test.

Christian


On Fri, Jul 19, 2019 at 02:51 Paul Mansfield <paul.ma...@agileanalog.com> wrote:
We've been using reviewboard for a few months now. The server is 3.0.15 on CentOS7, as is the client.

I am using python 3.6.8 from the IUS repository.

This is the first time I've encountered this error, trying to submit a post-commit review on a feature branch before it gets merged into master.

I've seen similar codec related reported but none quite the same as this.
$ rbt post --debug --bugs-closed DEVOPS-163 --branch DEVOPS-163 master..DEVOPS-163
>>> RBTools 1.0.2
>>> Python 3.6.8 (default, May  2 2019, 20:40:44) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
>>> Running on Linux-3.10.0-957.21.2.el7.x86_64-x86_64-with-centos-7.6.1810-Core
>>> Home = /users/paulm
>>> Current directory = /users/paulm/codecommit/ADS-CICD-infrastructure/ci
>>> Command line: rbt post --debug --bugs-closed DEVOPS-163 --branch DEVOPS-163 master..DEVOPS-163
>>> Running: tf vc help
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git config --get branch.DEVOPS-163.merge
>>> Running: git config --get branch.DEVOPS-163.remote
>>> Running: git config --get remote.origin.url
>>> Repository info: Path: ssh://xxxxxxx...@git-codecommit.eu-west-1.amazonaws.com/v1/repos/xxxx, Base path: , Supports changesets: False

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reviewboard/7d4de61f-e2a4-4899-84fd-9815c733b6c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

Paul Mansfield

unread,
Jul 22, 2019, 7:21:48 AM7/22/19
to Review Board Community
thanks for that

I think I am doing something wrong

$ sudo pip install ReviewBoardPowerPack-3.0.3a0.dev20190701141953-cp27-none-any.whl ERROR: ReviewBoardPowerPack-3.0.3a0.dev20190701141953-cp27-none-any.whl is not a supported wheel on this platform.





and yet,,,

$ wheel unpack ReviewBoardPowerPack-3.0.3a0.dev20190701141953-cp27-none-any.whl 
Unpacking to: ./ReviewBoardPowerPack-3.0.3a0.dev20190701141953...OK



/paul is puzzled.

Paul Mansfield

unread,
Jul 22, 2019, 7:24:18 AM7/22/19
to Review Board Community
oh, wait... somehow pip got aliassed to pip3. now I've rerun without that, it worked.

apologies for the distraction

Paul Mansfield

unread,
Jul 22, 2019, 9:28:32 AM7/22/19
to Review Board Community
ok, this fix didn't break anything and I was able to submit a review on the feature branch which previously caused the codec error.

thanks

Christian Hammond

unread,
Jul 22, 2019, 3:26:13 PM7/22/19
to revie...@googlegroups.com
Glad to hear it! We’ll have that rolled up into the next release.

Christian


On Mon, Jul 22, 2019 at 06:28 Paul Mansfield <paul.ma...@agileanalog.com> wrote:
ok, this fix didn't break anything and I was able to submit a review on the feature branch which previously caused the codec error.

thanks

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages