diff --git a/airtime_mvc/application/modules/rest/controllers/MediaController.php b/airtime_mvc/application/modules/rest/controllers/MediaController.php index d2a55d0ebc..8a578fc0c5 100644 --- a/airtime_mvc/application/modules/rest/controllers/MediaController.php +++ b/airtime_mvc/application/modules/rest/controllers/MediaController.php @@ -369,7 +369,7 @@ private function fileNotFoundResponse() private function invalidDataResponse() { $resp = $this->getResponse(); - $resp->setHttpResponseCode(400); + $resp->setHttpResponseCode(422); $resp->appendBody("ERROR: Invalid data"); } diff --git a/python_apps/airtime_analyzer/airtime_analyzer/status_reporter.py b/python_apps/airtime_analyzer/airtime_analyzer/status_reporter.py index 0e3c716190..0a69461ba8 100644 --- a/python_apps/airtime_analyzer/airtime_analyzer/status_reporter.py +++ b/python_apps/airtime_analyzer/airtime_analyzer/status_reporter.py @@ -91,9 +91,13 @@ def send_http_request(picklable_request, retry_queue): r.raise_for_status() # Raise an exception if there was an http error code returned logging.info("HTTP request sent successfully.") except requests.exceptions.RequestException as e: - # If the web server is having problems, retry the request later: - logging.error("HTTP request failed. Retrying later! Exception was: %s" % str(e)) - retry_queue.append(picklable_request) + if r.status_code != 422: + # If the web server is having problems, retry the request later: + logging.error("HTTP request failed. Retrying later! Exception was: %s" % str(e)) + retry_queue.append(picklable_request) + else: + # Do no retry the request if there was a metadata validation error + logging.error("HTTP request failed. Exception was: %s" % str(e)) except Exception as e: logging.error("HTTP request failed with unhandled exception. %s" % str(e)) # Don't put the request into the retry queue, just give up on this one.