Unable to send event to snowplow mini

Hi,

i’m trying to send unstructured event to snowplow mini using java. I followed steps which are in in the snowplow documentation. However, i’m getting exception that
{
“level”: “error”,
“message”: “error: Could not find schema with key iglu:company_name/schema_name/jsonschema/1-0-0 in any repository, tried:\n level: “error”\n repositories: [“Iglu Central - GCP Mirror [HTTP]”,“Iglu Central [HTTP]”,“Iglu Server [HTTP]”,“Iglu Client Embedded [embedded]”]\n”
}

Could you please let me know what is the problem. since 15 days i’m working on this to solve. coudn’t find any clue.

Hi @lakshmi,

Have you defined a schema for your custom event, and uploaded it for Snowplow Mini to use?

If not, see the docs on schemas for guidance on creating one, and Ihor’s comment here for a quick reference on uploading.

Best,

1 Like

Hi Colm, Thank you so much for quick reply.

This is the schema we defined by our data team And they say its already in snowplow mini

{
“$schema”: “http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#”,
“self”: {
“vendor”: “company-name”,
“name”: “schema_name”,
“format”: “jsonschema”,
“version”: “1-0-0”
},
“type”: “object”,
“properties”: {
“value1”: {
“type”: “string”,
“maxLength”: 256
},
“value2”: {
“type”: “string”,
“maxLength”: 256
},
“value3”: {
“type”: “string”,
“maxLength”: 256
},
“required”: [
“value1”,
“value2”,
“value3”
],
“additionalProperties”: false
}

Sp, how do i check whether this schema is available in snowplow mini or not. And below is my code for setting selfdescriving json

SelfDescribingJson eventData = new SelfDescribingJson(iglu:company_name/schema_name/jsonschema/1-0-0, eventMap);

Please let me know is this correct or not. Also, please let me know whether i can use simpleemitter to send events.

Ok, so I can think of a couple of things that might be happening here:

  1. The schema is there, but the failure response has been cached. This can be resolved by choosing ‘restart all services’ from the Snowplow Mini control pane section of the Mini homepage (found at url/home).

  2. The schema has not been uploaded, or has been uploaded to the wrong path.

The path it needs to live at is vendor/name/format/version - so in your example it would be at company-name/pk_sub_status_change/jsonschema/1-0-0.

The simplest way to check things is to re-uplaod the schema to this path. Igluctl will tell you if you have modified or created a new schema.

2 Likes

PS. Yes your tracking is correct - the data is arriving into your Snowplow mini instance but is failing at validation step - otherwise you wouldn’t see the error message in bad rows.

Now i have another issue. Earlier i tried with java. Now i want to try with Node js.
So i followed the documentation which is https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/node-js-tracker/initialization/.

But i’m not able to send events.

  1. Documentation says port number is optional. But if i don’t mention i’m getting error. Also i don’t have port number. I only have url for our snowplow mini. Please let me know what port number i need to mention?

  2. In the emitter object creation, after POST method, documentation says 5, // Only send events once n are buffered. Defaults to 1 for GET requests and 10 for POST requests.

Why 10 needed?? i want to send my event immediately? also how do we know mention the emitter is batch or simple. I can’t find in the documentation. please guid me asap.

Hi @lakshmi,

Documentation says port number is optional. But if i don’t mention i’m getting error. Also i don’t have port number. I only have url for our snowplow mini. Please let me know what port number i need to mention?

To omit the port, set it to null.

Why 10 needed?? i want to send my event immediately? also how do we know mention the emitter is batch or simple. I can’t find in the documentation. please guid me asap.

10 is the default, it’s configurable. If you would like every event to be sent immediately, either use GET requests, or keep it as POST and change the 5 from the example to a 1.

I hope that’s helpful!

Best,

Thank you so much @Colm. It worked after setting port number to null. Thank you so much for your quick replies. you saved my time. I really appreciate it.

2 Likes

Happy to help!