Sending test events to new Collector results in 404 not found

Hi!

I tried setting up a new Snowplow Collector using the Setup Snowplow Open Source on AWS guide and the Terraform modules. I also got some additional inspiration from the quick start example.

To verify that my event to S3 setup work, I thought I’d send a test event as described in the quick start guide. I however I get 404 not found error with curl.
I am using the URL for the load balancer (DNS name) (looks like <account>.<region>.elb.amazonaws.com). That is correct?

If I curl <account>.<region>.elb.amazonaws.com/health it says OK. What could be the problem? The load balancer is in the public subnet.

I haven’t setup a custom Iglu server yet if that makes any difference.

1 Like

collector_dns_name is the address you’re looking for. See step three of Quick Start Installation Guide on AWS - Snowplow Docs.

The output of terraform show should contain the collector_dns_name if you can’t find it.

1 Like

Thanks! That confirms that I am using the correct endpoint.

Then I would just

curl '<collector_dns_name>' \
   -H 'Content-Type: application/json; charset=UTF-8' \
   -H 'Cookie: _sp=305902ac-8d59-479c-ad4c-82d4a2e6bb9c' \
   --data-raw '{"schema":"iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4","data":[{"e":"pv","url":"https://docs.snowplowanalytics.com/docs/send-test-events-to-your-pipeline/","page":"Send test events to your pipeline - Snowplow Docs","refr":"https://docs.snowplowanalytics.com/","tv":"js-2.17.2","tna":"spExample","aid":"docs-example","p":"web","tz":"Europe/London","lang":"en-GB","cs":"UTF-8","res":"3440x1440","cd":"24","cookie":"1","eid":"4e35e8c6-03c4-4c17-8202-80de5bd9d953","dtm":"1626182778191","cx":"eyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy9jb250ZXh0cy9qc29uc2NoZW1hLzEtMC0wIiwiZGF0YSI6W3sic2NoZW1hIjoiaWdsdTpjb20uc25vd3Bsb3dhbmFseXRpY3Muc25vd3Bsb3cvd2ViX3BhZ2UvanNvbnNjaGVtYS8xLTAtMCIsImRhdGEiOnsiaWQiOiI0YTU2ZjQyNy05MTk2LTQyZDEtOWE0YS03ZjRlNzk2OTM3ZmEifX1dfQ","vp":"863x1299","ds":"848x5315","vid":"3","sid":"87c18fc8-2055-4ec4-8ad6-fff64081c2f3","duid":"5f06dbb0-a893-472b-b61a-7844032ab3d6","stm":"1626182778194"},{"e":"ue","ue_px":"eyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy91bnN0cnVjdF9ldmVudC9qc29uc2NoZW1hLzEtMC0wIiwiZGF0YSI6eyJzY2hlbWEiOiJpZ2x1OmNvbS5teV9jb21wYW55L3Byb2R1Y3Rfdmlldy9qc29uc2NoZW1hLzEtMC0wIiwiZGF0YSI6eyJpZCI6IjVOMFctUEwwVyIsImN1cnJlbnRfcHJpY2UiOjQ0Ljk5LCJkZXNjcmlwdGlvbiI6IlB1cnBsZSBTbm93cGxvdyBIb29kaWUifX19","tv":"js-2.17.2","tna":"spExample","aid":"docs-example","p":"web","tz":"Europe/London","lang":"en-GB","cs":"UTF-8","res":"3440x1440","cd":"24","cookie":"1","eid":"542a79d3-a3b8-421c-99d6-543ff140a56a","dtm":"1626182778193","cx":"eyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy9jb250ZXh0cy9qc29uc2NoZW1hLzEtMC0wIiwiZGF0YSI6W3sic2NoZW1hIjoiaWdsdTpjb20uc25vd3Bsb3dhbmFseXRpY3Muc25vd3Bsb3cvd2ViX3BhZ2UvanNvbnNjaGVtYS8xLTAtMCIsImRhdGEiOnsiaWQiOiI0YTU2ZjQyNy05MTk2LTQyZDEtOWE0YS03ZjRlNzk2OTM3ZmEifX1dfQ","vp":"863x1299","ds":"848x5315","vid":"3","sid":"87c18fc8-2055-4ec4-8ad6-fff64081c2f3","duid":"5f06dbb0-a893-472b-b61a-7844032ab3d6","refr":"https://docs.snowplowanalytics.com/","url":"https://docs.snowplowanalytics.com/docs/send-test-events-to-your-pipeline/","stm":"1626182778194"}]}'

as described here?

With ‘<collector_dns_name>’ replaced by the output (it has the form “collector-lb-0000000.eu-region-1.elb.amazonaws.com”)

Hey @medicinal-matt your curl should start with this:

curl 'http://<collector_dns_name>/com.snowplowanalytics.snowplow/tp2' \

You need to still include the protocol as well as that specific path for a POST request. The 404 you are getting is due to the fact that you are not including this chunk on the end com.snowplowanalytics.snowplow/tp2 and that there is no root path to the Collector.

2 Likes

That solves the issue! It now returns OK.

that there is no root path to the Collector.

What do you mean by this?

It just means that http://<collector_dns_name> doesn’t exist but http://<collector_dns_name>/com.snowplowanalytics.snowplow/tp2 does. :slight_smile:

2 Likes