Closed Bug 1269629 Opened 8 years ago Closed 7 years ago

Got 500 Error when submitting data to treeherder through the python client

Categories

(Tree Management :: Treeherder: API, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: shinglyu, Unassigned)

References

Details

# STR
* Run the script to submit data to PerfHerder: https://github.com/shinglyu/servo-perf/blob/master/submit_to_perfherder.py (client credential has been changed)
  ** Client ID: servo
  ** Server: treeherder.allizom.org

# Expected
The data was successfully submitted

# Actual
The client receives a 500 Internal Server Error, but the data was visiable on the server: https://treeherder.allizom.org/#/jobs?repo=servo&selectedJob=1

# Notes
There were no 500 error if I submit to my own treeherder installation. If someone can check the server log for me, I'll be very grateful.

# Log
python submit_to_perfherder.py output/perf-1461891564.json servo/revision.json                                   ✹ ✭
/home/slyu/workspace/servo-perf/venv/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/home/slyu/workspace/servo-perf/venv/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/home/slyu/workspace/servo-perf/venv/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
No handlers could be found for logger "thclient.client"
Traceback (most recent call last):
  File "submit_to_perfherder.py", line 299, in <module>
    main()
  File "submit_to_perfherder.py", line 294, in main
    submit(perf_data, revision)
  File "submit_to_perfherder.py", line 273, in submit
    client.post_collection('servo', tjc)
  File "/home/slyu/workspace/servo-perf/venv/local/lib/python2.7/site-packages/thclient/client.py", line 929, in post_collection
    collection_inst.get_collection_data(), timeout)
  File "/home/slyu/workspace/servo-perf/venv/local/lib/python2.7/site-packages/thclient/client.py", line 712, in _post_json
    resp.raise_for_status()
  File "/home/slyu/workspace/servo-perf/venv/local/lib/python2.7/site-packages/requests/models.py", line 840, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: INTERNAL SERVER ERROR for url: https://treeherder.allizom.org/api/project/servo/jobs/
Flags: needinfo?(wlachance)
Trace it down to this:

django.db.utils:DataError: (1406, "Data too long for column 'test' at row 1") 

What kind of data are you submitting to the server? There's a maximum length of 80 characters for the test and suite names (which is probably a little high, given that numbers that high won't display well in the UI). It is a bit surprising that you're not seeing this error with your own treeherder instance...
Flags: needinfo?(wlachance)
Ah, I see. I included the test case's name, which is a long URL to the website I'm testing. I'll try to shorten the test case in my client. 

Thank you for the help. I'm closing this as WONTFIX.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Blocks: 1270169
Reopening since we need the API to be more informative in cases like this and bug 1270167.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Summary: Got 500 Error when submitting data to threeherder through the python client → Got 500 Error when submitting data to treeherder through the python client
Submitting jobs/pushes via the API is now discouraged in favour of using Pulse (bug 1349182), so we're wontfixing API-specific issues.
Status: REOPENED → RESOLVED
Closed: 8 years ago7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.