Errors generated by OPTIONS requests


We were recently asked the question:

I changed from GET to POST requests from JS-tracker, and that has started making an OPTIONS http request which is generating some errors.

As this seems to be a common question I’m elaborating on it below.

Why enabling POST request results in an additional OPTIONS request?

The OPTIONS request is a pre-flight request, that is a CORS (Cross-Origin Resource Sharing) requirement. You can read more about it here:

When the Javascript tracker wants to send a POST request, it has to send an OPTIONS request first to check that the collector will accept POST requests from any domain. The collector logs these OPTIONS requests which are then processed in Enrichment.

Why the OPTIONS requests end up in bad rows?

As the collector logs these OPTIONS requests, they are processed by Enrichment. However, they do not contain any meaningful data. Here’s an example of such a request taken from bad row logs.

  "_index": "snowplow",
  "_type": "bad_rows",
  "_id": "AVM7XuqOi4wlDuAN6icW",
  "_score": null,
  "_source": {
    "line": "2016-03-02\t19:00:47\t-\t-\t66.249.73.212\tOPTIONS\t66.249.73.212\t/com.snowplowanalytics.snowplow/tp2\t200\t\\t&cv=clj-1.1.0-tom-0.2.0&nuid=-\t-\t-\t-\t-\t-",
    "errors": [
        "level": "error",
        "message": "Unrecognized event [null]"
    "failure_tstamp": "2016-03-03T07:02:46.465Z"
  "fields": {
    "failure_tstamp": [

Note the message “Unrecognized event [null]”. They can safely be ignored as they don’t represent failed attempts to send data.

How can these be filtered out?

If you are logging bad row with Elasticsearch/Kibana you can filter these out using the following query in Kibana:

-errors.message:"does not match (/)vendor/version(/) pattern nor is a legacy /i(ce.png) request" AND -errors.message:"Unrecognized event [null]"