Self describing event and schema static hosting on cloud storage not working

Hello.

I’m trying to follow Jules tutorial to create my first self describing event but without success for now. Plz don’t pay attention to the design/content of the event itself. I’m just trying to get this work for now.

I have a very simple snowplow pipeline setup on GCP.

I’ve updated my enrich component with the following resolver-config:

{
   "schema":"iglu:com.snowplowanalytics.iglu/resolver-config/jsonschema/1-0-3",
   "data":{
      "cacheSize":500,
      "repositories":[
         {
            "name":"Iglu Central",
            "priority":0,
            "vendorPrefixes":[
               "com.snowplowanalytics"
            ],
            "connection":{
               "http":{
                  "uri":"http://iglucentral.com"
               }
            }
         },
         {
            "name":"custom schema repo",
            "priority":2,
            "vendorPrefixes":[
               "com.breton"
            ],
            "connection":{
               "http":{
                  "uri":"https://storage.googleapis.com/sp_custom_schemas/schemas"
               }
            }
         }
      ]
   }
}

I’ve uploaded my custom schema available in public GCS bucket here:

{
  "$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
  "description": "Schema for order catalogue impression",
  "self": {
    "vendor": "com.breton",
    "name": "order_catalogue_impression",
    "format": "jsonschema",
    "version": "1-0-0"
  },
  "type": "object",
  "properties": {
    "orderCatalogueImpressions": {
      "type": ["integer"],
      "maxLength": 50,
      "description": "when order product catalogue element is displayed"
    }
  },
  "minProperties": 1,
  "additionalProperties": true
}

and this is how I’m sending my event:

window.snowplow('trackSelfDescribingEvent', {
    event: {
        schema: 'iglu:com.breton/order_catalogue_impression/jsonschema/1-0-0',
        data: {
            testing: 1,
        }
    }
});

Looking at the log of my different components I’m not seeing any errors.

This is the output I have looking at Poplindata debugger:

What’s wrong here? How do I move on?

Hi @simonbreton!

I recommend using Snowplow Micro to debug issues like this. You can spin it up pretty quickly and point to your Iglu registry like so: Basic usage | Snowplow Documentation. Then you can use the API (see the example just above the section I linked to) to check that your schema is accessible, and also send some events and see if they pass validation.

I suspect you need to remove /schemas at the end of your registry URL.

Edit:

  • When I run Micro with MICRO_IGLU_REGISTRY_URL=https://storage.googleapis.com/sp_custom_schemas/schemas and query localhost:9090/micro/iglu/com.breton/order_catalogue_impression/jsonschema/1-0-0, I get a NotFound error.
  • With MICRO_IGLU_REGISTRY_URL=https://storage.googleapis.com/sp_custom_schemas, the same query yields your schema.

So this confirms my suspicion.

3 Likes

I actually did play with or without the /schemas path. I was not sure so thanks for your confirmation. It’s working now.

1 Like

Hi simon, what was the path you used to get it to work?