| Summary: | send-error-report fails with 500: INTERNAL SERVER ERROR | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Infrastructure] AutoBuilder | Reporter: | Alexandre Belloni <alexandre.belloni> | ||||||||||||
| Component: | autobuilder | Assignee: | Thomas Perrot <thomas.perrot> | ||||||||||||
| Status: | RESOLVED DUPLICATE | QA Contact: | |||||||||||||
| Severity: | normal | ||||||||||||||
| Priority: | Medium+ | CC: | chee.yang.lee, infras.ab.watcher, Infras.watcher, pidge, randy.macleod, sgw | ||||||||||||
| Version: | 3.3 | ||||||||||||||
| Target Milestone: | 3.4 M2 | ||||||||||||||
| Hardware: | x86 | ||||||||||||||
| OS: | Multiple | ||||||||||||||
| Whiteboard: | |||||||||||||||
| OS type for building Yocto: | --- | Type of Regression: | --- | ||||||||||||
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Alexandre Belloni
2021-01-29 20:40:58 UTC
Created attachment 4767 [details]
error_report_bitbake_1611770519.txt
Yop I can reproduce, wasn't able to send the json file to the server calling the script locally. tried forging the requests with a simple curl command curl errors.yoctoproject.org/ClientPost/ -L -H "Content-Type: application/json" --user-agent "send-error-report/0.3" --data "`cat ~/Downloads/post_request.txt`" the server spits back Traceback: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 132. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py" in wrapped_view 58. return view_func(*args, **kwargs) File "/var/www/error-report-web/Post/views.py" in addData 61. result = p.parse(request) File "/var/www/error-report-web/Post/parser.py" in parse 40. if self.contains_tags(jsondata) == True: File "/var/www/error-report-web/Post/parser.py" in contains_tags 28. if '<' in val: turns out one of the fields is `"machine":False`, which is not an iterable so `'<' in val` is invalid I want also to submit a patch to not send MACHINE as false moving to M4 bumping m4 Another occurence: https://autobuilder.yoctoproject.org/typhoon/#/builders/42/builds/3186/steps/23/logs/stdio sent 2 patches to the yocto mailing list to fix some of the weirdness around yocto-check-layer-wrapper this is the error msg seen: https://errors.yoctoproject.org/Errors/Details/576832/ Created attachment 4790 [details]
fix "false"
Created attachment 4791 [details]
correct error reporting
Another occurrence but probably a different issue: https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/25/steps/14 I'm attaching error_report_bitbake_1619453707.txt Created attachment 4792 [details]
error_report_bitbake_1619453707.txt
https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/14/steps/24/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/15/steps/25/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/17/steps/24/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/18/steps/28/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/22/steps/28/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#builders/121/builds/28/steps/26/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/29/steps/26/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/31/steps/28/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/40/steps/27/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/41/steps/26/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/47/steps/27/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/48/steps/27/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/73/steps/27/logs/stdio https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/74/steps/26/logs/stdio I reproduced this failure, with the following command, to send the report to a local instance of error-report-web:
send-error-report -n foo --no-ssl -y -s 127.0.0.1:8000 ../error_report_bitbake_1619453707.txt
And from error-report-web side, the following stack trace has been obtained:
Internal Server Error: /ClientPost/
Traceback (most recent call last):
File "/src/Post/parser.py", line 66, in parse
b.save()
File "/src/Post/models.py", line 53, in save
self.ERROR_TYPE)
Post.models.InvalidErrorType: Error type check-layer is not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/src/venv/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
return view_func(*args, **kwargs)
File "/src/Post/views.py", line 63, in addData
result = p.parse(request)
File "/src/Post/parser.py", line 69, in parse
return { 'error' : "Problem reading json payload, %s" % e.message }
AttributeError: 'InvalidErrorType' object has no attribute 'message'
[22/Jun/2021 11:57:06] "POST /ClientPost/ HTTP/1.1" 500 83858
The issue occurs because "check-layer" isn't an entry of "ERROR_TYPE_CHOICES":
class Build(models.Model):
ERROR_TYPE_CHOICES = (
(ErrorType.RECIPE, 'Recipe'),
(ErrorType.CORE, 'Core'),
(ErrorType.BITBAKE_SELFTEST, 'Bitbake selftest'),
(ErrorType.OE_SELFTEST, 'OE selftest'),
)
When I add a "check-layer" in ERROR_TYPE_CHOICES and ErrorType, the report is sent with success:
send-error-report -n toto --no-ssl -y -s 127.0.0.1:8000 ../error_report_bitbake_1619453707.txt
Preparing to send errors to: 127.0.0.1:8000
Your entry can be found here: http://127.0.0.1:8000/Errors/Build/2/
[23/Jun/2021 00:55:19] "GET /ClientPost/JSON HTTP/1.1" 301 0
[23/Jun/2021 00:55:19] "GET /ClientPost/JSON/ HTTP/1.1" 200 62
[23/Jun/2021 00:55:19] "POST /ClientPost/ HTTP/1.1" 200 67
diff --git a/Post/models.py b/Post/models.py
index 3fa66f2198a4..b7a913c82359 100644
--- a/Post/models.py
+++ b/Post/models.py
@@ -15,6 +15,7 @@ import Levenshtein
class ErrorType(object):
RECIPE = 'recipe'
+ CHECK_LAYER = 'check-layer'
CORE = 'core'
BITBAKE_SELFTEST = 'bitbake-selftest'
OE_SELFTEST = 'oe-selftest'
@@ -26,6 +27,7 @@ class InvalidErrorType(Exception):
class Build(models.Model):
ERROR_TYPE_CHOICES = (
(ErrorType.RECIPE, 'Recipe'),
+ (ErrorType.CHECK_LAYER, 'check-layer'),
(ErrorType.CORE, 'Core'),
(ErrorType.BITBAKE_SELFTEST, 'Bitbake selftest'),
(ErrorType.OE_SELFTEST, 'OE selftest'),
Changes above has been merged. Thanks Thomas! For anyone looking, here's a link to the commit: http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/commit/?id=7fa9441d4498baf9e4655d946fffb7217a6ce437 Seems to be happening again. 2 recent builds that had layer-check failures are getting HTTP Error 500. https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/232 https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/231 Internal Server Error: /ClientPost/ Traceback (most recent call last): File "/var/www/error-report-web/Post/parser.py", line 66, in parse b.save() File "/var/www/error-report-web/Post/models.py", line 53, in save self.ERROR_TYPE) Post.models.InvalidErrorType: Error type check-layer is not known During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 132, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python3.5/dist-packages/django/views/decorators/csrf.py", line 58, in wrapped_view return view_func(*args, **kwargs) File "/var/www/error-report-web/Post/views.py", line 63, in addData result = p.parse(request) File "/var/www/error-report-web/Post/parser.py", line 69, in parse return { 'error' : "Problem reading json payload, %s" % e.message } AttributeError: 'InvalidErrorType' object has no attribute 'message' A new bug #14506 has been opened to track the new failure. *** This bug has been marked as a duplicate of bug 14506 *** bulk change to add Saul's non-WR address. Bulk change: Remove Saul's old WR address. |