spcl / serverless-benchmarks

SeBS: serverless benchmarking suite for automatic performance analysis of FaaS platforms.
https://mcopik.github.io/projects/sebs/
BSD 3-Clause "New" or "Revised" License
150 stars 68 forks source link

Another 500 internal error on 220.video-processing benchmark. Please assist #116

Closed jchigu closed 1 year ago

jchigu commented 1 year ago

(python-venv) jchigu@SEBS:~$ curl 172.17.0.3:9000 --request POST -data '{"bucket": { "input": "220.video-processing-0-input-d510f263-fb8e-49", "output": "220.video-processing-0-output-82a4c8c3-3ddf-43" }, "object": { "duration": 1, "key": "city.mp4", "op": "watermark" } }' --header 'Content-Type: application/json'

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
    <head>
        <title>Error: 500 Internal Server Error</title>
        <style type="text/css">
          html {background-color: #eee; font-family: sans;}
          body {background-color: #fff; border: 1px solid #ddd;
                padding: 15px; margin: 15px;}
          pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}
        </style>
    </head>
    <body>
        <h1>Error: 500 Internal Server Error</h1>
        <p>Sorry, the requested URL <tt>&#039;http://172.17.0.3:9000/&#039;</tt>
           caused an error:</p>
        <pre>Internal Server Error</pre>
          <h2>Exception:</h2>
          <pre>JSONDecodeError(&#039;Expecting value: line 1 column 1 (char 0)&#039;)</pre>
          <h2>Traceback:</h2>
          <pre>Traceback (most recent call last):

File "/usr/local/lib/python3.7/site-packages/bottle.py", line 868, in _handle return route.call(*args) File "/usr/local/lib/python3.7/site-packages/bottle.py", line 1748, in wrapper rv = callback(a, **ka) File "/sebs/server.py", line 17, in flush_log ret = function.handler(request.json) File "/usr/local/lib/python3.7/site-packages/bottle.py", line 172, in get if key not in storage: storage[key] = self.getter(obj) File "/usr/local/lib/python3.7/site-packages/bottle.py", line 1129, in json return json_loads(b) File "/usr/local/lib/python3.7/site-packages/bottle.py", line 98, in <lambda> json_loads = lambda s: json_lds(touni(s)) File "/usr/local/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) curl: (3) nested brace in URL position 12: {"bucket": { "input": "220.video-processing-0-input-d510f263-fb8e-49", "output": "220.video-processing-0-output-82a4c8c3-3ddf-43" }, "object": { "duration": 1, "key": "city.mp4", "op": "watermark" } } ^ (python-venv) jchigu@SEBS:~$

mcopik commented 1 year ago

The exception was caused by invoking function with empty input. Looking at your command, it seems that it is incorrect - you passed -data instead of --data. I guess that cURL ignored the incorrect option, leading to invoking the function with no input. If fixing the command doesn't fix the issue, please reopen the ticket with more detailed information - I will be happy to help.

In the future, we will implement input sanitization (#118) and the perf-cost experiment for local benchmarks (#119). This will help since users will not have to write invocations manually. Unfortunately, the local environment was developed originally as a testing ground, and thus it only has partial capabilities needed for a full experiment.

In the meantime, I would recommend writing a simple script to start function containers, invoke them as needed for your experiments, and then shut down containers. You can use the sample inputs provided in the output JSON (all modern programming languages have capabilities for loading and parsing a JSON file). If you use Python, you can import the input.py file directly from the benchmark directory and call the input generation function. Both options will help you since you will make invocations automatic and faster to conduct in series, and will help you to avoid incorrect invocations and errors caused by copy-pasting commands :-)