Failed to match schema in from iglu server to resolver file

Hi all. I’m getting this error with my stream enrichments, using a self-hosted iglu server (on docker):
The event being tracked were sent to snowplow_enriched_bad

"errors":[{"level":"error","message":"error: Could not find schema with key iglu:com.localhost/onmouse_img/jsonschema/1-0-0 in any repository, tried:\n    level: \"error\"\n    repositories: [\"Iglu Central - GCP Mirror [HTTP]\",\"Iglu Central [HTTP]\",\"Iglu Client Embedded [embedded]\",\"Check image [HTTP]\"]\n"},{"level":"error","message":"error: Unexpected exception fetching iglu:com.localhost/onmouse_img/jsonschema/1-0-0 in HTTP Iglu repository Check image: java.net.ConnectException: Connection refused (Connection refused)\n    level: \"error\"\n"},{"level":"error","message":"error: Unexpected exception fetching iglu:com.localhost/onmouse_img/jsonschema/1-0-0 in HTTP Iglu repository Check image: java.net.ConnectException: Connection refused (Connection refused)\n    level: \"error\"\n"},{"level":"error","message":"error: Unexpected exception fetching iglu:com.localhost/onmouse_img/jsonschema/1-0-0 in HTTP Iglu repository Check image: java.net.ConnectException: Connection refused (Connection refused)\n    level: \"error\"\n"}],"failure_tstamp":"2020-03-08T03:57:50.081Z"}

My resolver.json, using an internal uri for the iglu server:

{
  "schema": "iglu:com.snowplowanalytics.iglu/resolver-config/jsonschema/1-0-1",
  "data": {
    "cacheSize": 500,
    "repositories": [
      {
        "name": "Iglu Central",
        "priority": 0,
        "vendorPrefixes": [ "com.snowplowanalytics" ],
        "connection": {
          "http": {
            "uri": "http://iglucentral.com"
          }
        }
      },
      {
        "name": "Iglu Central - GCP Mirror",
        "priority": 1,
        "vendorPrefixes": [ "com.snowplowanalytics" ],
        "connection": {
          "http": {
            "uri": "http://mirror01.iglucentral.com"
          }
        }
      },
      {
        "name": "onmouse_img",
        "priority": 2,
        "vendorPrefixes": ["com.localhost"],
        "connection":{
          "http":{
            "uri": "http://localhost:8081/api",
            "apikey": "1d9c7e70-012b-11e8-ba89-0ed5f89f718b"
          }
        }
      }
    ]
  }
}

The iglu server is working, and all the schemas are public by opening this url:
http://localhost:8081/api/schemas/public


I also can access invidual schemas using url like:
http://localhost:8081/api/schemas/com.localhost/onmouse_image/jsonschema/1-0-0
Screenshot from 2020-03-08 11-05-59

My json schema looks like this:

{
  "$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
  "description": "onmouse_img example",
  "self": {
    "vendor": "com.localhost",
    "name": "onmouse_img",
    "format": "jsonschema",
    "version": "1-0-0"
  },
  "type": "object",
  "properties": {
    "imgId": {
      "type": "string"
    },
    "imgSrc": {
      "type": "string"
    },
    "imgEvent": {
      "enum": [
        "smallImg",
        "normalImg"
      ]
    }
  },
  "required": [
    "imgId",
    "imgSrc",
    "imgEvent"
  ],
  "additionalProperties": false
}

This is the js code i used to define collector and call to schema:

window.snowplow('newTracker', 'cf', 'localhost:8080', {
    appId: 'testApp',
    platform: 'web',
});
function smallImg(x) {
            x.style.height = "50px";
            // track our event
            var data = {
                "imgId": x.id,
                "imgSrc": x.src,
                'imgEvent': "smallImg"
            }
            window.snowplow('trackSelfDescribingEvent', {'schema': 'iglu:com.localhost/onmouse_img/jsonschema/1-0-0', 'data': data});
}

Any help appreciated!

Try running again and double checking that port 8081 is open and accessible from whereever your enrichment process is running. If you are using Docker you may need to potentially make some ports accessible.

1 Like

Thanks for your help!