I have got an error (HTTP 400, API Error 224)

197 views
Skip to first unread message

潘达春

unread,
Aug 16, 2021, 9:55:32 AM8/16/21
to Review Board Community
Hi guys, I got an error from rbt post.

result:
>>> RBTools 2.0.1
>>> Python 3.6.9 (default, Jul 17 2020, 12:50:27) 
[GCC 8.4.0]
>>> Running on Linux-4.15.0-117-generic-x86_64-with-Ubuntu-18.04-bionic
>>> Home = /root
>>> Current directory = /root/123
>>> Command line: rbt post -d -p
>>> Running: tf vc help
>>> Checking for a Subversion repository...
>>> Running: svn --non-interactive info
>>> Running: diff --version
>>> Running: svn --non-interactive --version -q
>>> Repository info: Path: http://xxxsvn.idreamsky.com/test, Base path: /123, Supports changesets: False
>>> Making HTTP GET request to http://reviewboard-test.ids111.com/api/
>>> HTTP GET request to http://reviewboard-test.ids111.com/api/repositories/2/info/ cannot be cached
>>> Repository info: Path: http://xxxsvn.idreamsky.com/test/123, Base path: /, Supports changesets: False
>>> Running: svn --non-interactive status -q --ignore-externals
>>> Running: svn --non-interactive diff --diff-cmd=diff --notice-ancestry -r BASE
>>> Running: svn --non-interactive info 123
>>> Running: svn --non-interactive diff --diff-cmd=diff --notice-ancestry -r BASE --no-diff-deleted
>>> HTTP GET request to http://reviewboard-test.ids111.com/api/validation/diffs/ cannot be cached
>>> Got API Error 224 (HTTP code 400): Unexpected error when validating the diff: 'NoneType' object has no attribute 'endswith'
>>> Error data: {'err': {'code': 224, 'msg': "Unexpected error when validating the diff: 'NoneType' object has no attribute 'endswith'"}, 'stat': 'fail'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/rbtools/api/request.py", line 813, in make_request
    request.url, body, headers, request.method))
  File "/usr/local/lib/python3.6/dist-packages/rbtools/api/cache.py", line 209, in make_request
    return self.urlopen(request)
  File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.6/dist-packages/rbtools/api/request.py", line 361, in http_response
    response.info())
  File "/usr/lib/python3.6/urllib/request.py", line 570, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/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/local/lib/python3.6/dist-packages/rbtools/commands/post.py", line 1081, in main
    squashed_diff)
  File "/usr/local/lib/python3.6/dist-packages/rbtools/commands/post.py", line 1464, in _validate_squashed_diff
    **validate_kwargs)
  File "/usr/local/lib/python3.6/dist-packages/rbtools/api/decorators.py", line 27, in request_method
    *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/rbtools/api/transport/sync.py", line 82, in execute_request_method
    return self._execute_request(request)
  File "/usr/local/lib/python3.6/dist-packages/rbtools/api/transport/sync.py", line 91, in _execute_request
    rsp = self.server.make_request(request)
  File "/usr/local/lib/python3.6/dist-packages/rbtools/api/request.py", line 815, in make_request
    self.process_error(e.code, e.read())
  File "/usr/local/lib/python3.6/dist-packages/rbtools/api/request.py", line 789, in process_error
    rsp['err']['msg'])
rbtools.api.errors.BadRequestError: Unexpected error when validating the diff: 'NoneType' object has no attribute 'endswith' (HTTP 400, API Error 224)

During handling of the above exception, another exception occurred:

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

Unexpected error when validating the diff: 'NoneType' object has no attribute 'endswith' (HTTP 400, API Error 224)


But, rbt diff worked well.
result:
>>> RBTools 2.0.1
>>> Python 3.6.9 (default, Jul 17 2020, 12:50:27) 
[GCC 8.4.0]
>>> Running on Linux-4.15.0-117-generic-x86_64-with-Ubuntu-18.04-bionic
>>> Home = /root
>>> Current directory = /root/123
>>> Command line: rbt diff
>>> Running: tf vc help
>>> Checking for a Subversion repository...
>>> Running: svn --non-interactive info
>>> Running: diff --version
>>> Running: svn --non-interactive --version -q
>>> Repository info: Path: http://xxxsvn.idreamsky.com/test, Base path: /123, Supports changesets: False
>>> Making HTTP GET request to http://reviewboard-test.ids111.com/api/
>>> Running: svn --non-interactive status -q --ignore-externals
>>> Running: svn --non-interactive diff --diff-cmd=diff --notice-ancestry -r BASE
>>> Running: svn --non-interactive info 123
>>> Running: svn --non-interactive diff --diff-cmd=diff --notice-ancestry -r BASE --no-diff-deleted
Index: /123/123
===================================================================
--- /123/123    (revision 1510)
+++ /123/123    (working copy)
@@ -2,6 +2,7 @@
 lksjfd
 sddfd
 kajf;lsakj;lfj;kfjd;fj
+ksfsdkfjakf
 aklsjaidjfl
 dd
 jsadf
@@ -15,3 +16,4 @@
 asdakdj
 oasjodfa
 asldfj
+

Christian Hammond

unread,
Aug 16, 2021, 8:16:51 PM8/16/21
to revie...@googlegroups.com
Hi,

What version of Review Board is being used? It looks like the failure is server-side somewhere.

Can you look at the server's reviewboard.log and look for a corresponding exception backtrace? If available, it should say "'NoneType' object has no attribute 'endswith'".

Christian

--
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/a6ad1f2e-cdfd-43c5-be8d-5554a09e498an%40googlegroups.com.


--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

潘达春

unread,
Aug 16, 2021, 11:21:48 PM8/16/21
to Review Board Community
hi, Christian
My ReviewBoard version is 4.0.3. I used docker deployment

I cannot find this file reviewboard.log in container. 
screenshot-20210817-111420.png
Where else can I find?

Regards,
Shawn

Christian Hammond

unread,
Aug 17, 2021, 5:08:56 AM8/17/21
to revie...@googlegroups.com
Hi Shawn,

If this is a Docker instance, logs are written to stdout on the instance, so that they can be incorporated into Docker's standard logging mechanism. You should be able to see it with `docker logs <container ID>`.

You can try `docker logs -f <container ID>` to have it stream logs, and then reproduce the problem, see if anything useful appears.

Christian

潘达春

unread,
Aug 17, 2021, 6:20:23 AM8/17/21
to Review Board Community
Hi Christian,

Thanks. I have got the logs.
screenshot-20210817-181823.png

潘达春

unread,
Aug 19, 2021, 2:18:44 AM8/19/21
to Review Board Community
Hi Christian,

Is there any problem? What else can I do?


Regards,
Shawn

Reply all
Reply to author
Forward
0 new messages