Collector Issue // Unsupported HTTP method

I can see the events hitting my collector, but it looks like there is an error. I have not been able to find a way to solve this. I am not sure were to control the HTTP method, if at all possible.

Here is the error:

[WARN] [02/12/2021 16:07:21.695] [scala-stream-collector-akka.actor.default-dispatcher-26] [akka.actor.ActorSystemImpl(scala-stream-collector)] Illegal request, responding with status '400 Bad Request': Unsupported HTTP method: The HTTP method started with 0x16 rather than any known HTTP method. Perhaps this was an HTTPS request sent to an HTTP endpoint?

[DEBUG] [02/12/2021 16:07:21.697] [scala-stream-collector-akka.actor.default-dispatcher-26] [StreamUtils$DelayCancellationStage$$anon$11(akka://scala-stream-collector)] Delaying cancellation for 1 minute

Did you happen to see my reply in the other thread @lkstrategy?

The screenshot you shared there showed you had used http:// in specifying your collector endpoint - which should be left out. So in:

window.snowplow('newTracker', 'cf', '{{MY-COLLECTOR-URI}}' ...

{{MY-COLLECTOR-URI}} should be collector.acme.com rather than http://collector.acme.com, for example.

Yeah that was perfect and now I am here. Appreciate your help.

This is what my current tracker looks like:
window.snowplow(‘newTracker’, ‘sp’, ‘ec2-3-236-209-79.compute-1.amazonaws.com:8080’, { // Initialise a tracker
appId: “unionresolute”,
platform: “web”,
cookieDomain: “unionresolute.com”,
contexts: {
webPage: true,
performanceTiming: true
}
});

Ah ok I see - apologies this looked like what might happen if you had missed that.

The http method used will default to that of the page it’s found on. But you can use forceSecureTracker or forceUnsecureTracker to force https or http respectively - here’s the relevant docs: Initialization Options - Snowplow Docs

I’ve just noticed from the other thread that you’re using v2.7 - I’m not sure when but at some point this configuration option changed. So it might not work for that version - it might be some other option.

I’d recommend using the latest version (2.17.2) - we have also changed our CDN, so it might not be available at the old location. For testing you can use one of the new third party CDNs: Third Party CDN Hosting - Snowplow Docs (as that page explains we recommend self-hosting for prod).

Thanks @Colm. Super helpful. I’ve got this going all the way to the enrich, but the data is being written to the bad enrich stream.

Should I be adding other options to the javascript tracking code to get it to write to the good stream, or are there other places I should look to debug in the process? Just unclear as to why it would write to the bad stream.

Usually data ending up in the bad stream will be because of validation failures.

The messages themselves in the bad stream will have error messages explaining why they’ve ended up there.

I wouldn’t normally expect them to go to bad rows if you’re just using standard tracking methods, but those error messages should highlight what’s going wrong here.

In case you didn’t know about it, Snowplow Mini is a handy tool to test your tracking setup with a faster feedback loop.