Snowplow repository not found

Hello. When sending a custom event from the client, the event gets into the Kafka topic - snowplow_enriched_bad with an error

"failure":{
"timestamp":"2024-03-14T18:26:03.468223Z"
"messages":[
0:{
"schemaKey":"iglu:com.snowplowanalytics/steps/jsonschema/1-0-0"
"error":{
"error":"ResolutionError"
"lookupHistory":[
0:{
"repository":"Custom repo"
"errors":[
0:{
"error":"NotFound"
}
]
"attempts":1
"lastAttempt":"2024-03-14T18:26:03.212Z"
}
1:{
"repository":"Iglu Central"
"errors":[
0:{
"error":"NotFound"
}
]
"attempts":1
"lastAttempt":"2024-03-14T18:26:03.267Z"
}
2:{
"repository":"Iglu Central - GCP Mirror"
"errors":[
0:{
"error":"NotFound"
}
]
"attempts":1
"lastAttempt":"2024-03-14T18:26:03.467Z"
}
3:{
"repository":"Iglu Client Embedded"
"errors":[
0:{
"error":"NotFound"
}
]
"attempts":1
"lastAttempt":"2024-03-14T18:26:03.205Z"
}
]
}
}
]

Custom repo is a repository that I added according to the documentation - Iglu Resolver | Snowplow Documentation

{
  "schema": "iglu:com.snowplowanalytics.iglu/resolver-config/jsonschema/1-0-1",
  "data": {
    "cacheSize": 0,
    "repositories": [
      {
        "name": "Iglu Central",
        "priority": 0,
        "vendorPrefixes": [ "com.snowplowanalytics" ],
        "connection": {
          "http": {
            "uri": "http://iglucentral.com"
          }
        }
      },
      {
        "name": "Custom repo",
        "priority": 0,
        "vendorPrefixes": [ "com.snowplowanalytics" ],
        "connection": {
          "http": {
            "uri": "https://{iglu_server_host}/api",
            "apikey": "2cc29b15-e0f2-42c1-9bf6-f1115f2548c3"
          }
        }
      }
    ]
  }
}

Connecting and sending an event on the web

        ;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
            p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
            };p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
            n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","https://cdnjs.cloudflare.com/ajax/libs/snowplow/2.18.2/sp.js","snowplow"));

        window.snowplow('newTracker', 'sp1', '{collector}', {
            appId: 'testApp',
            platform: 'web',
        });

        snowplow('trackSelfDescribingEvent', {
            schema: 'iglu:com.snowplowanalytics/steps/jsonschema/1-0-0',
            data: {
                "eventName": "step-one"
            }
        });

Tell me what could be the problem?

This indicates that the schema (steps) wasn’t found in either of these repositories. Have you published it to your custom repository?

@mike This scheme is located in postgres in the iglu-server service. In the table iglu_schemas

 vendor - 'com.snowplowanalytics'
 name - 'steps'
 format - 'jsonschema'
 model  - 1
 revision - 1
 addition - 0
 created_at - '2024-03-14 16:46:35.028611'
 updated_at - '2024-03-14 16:46:35.028611'
 is_public - true
 body - '{"description":"Schema for an Acme Inc brand data event","properties":{"eventName":{"type":"string","maxLength":500}},"additionalProperties":false,"type":"object","required":["eventName"]}'
 superseded_by - null
 supersedes - {}

Is the schema accessible on the Iglu Server e.g., if you try and pull via the API?

Hey @fldenismarchuk,

Just double-checking that the vendor for your schema really is com.snowplowanalytics? The reason I ask is that your resolver configuration has the “vendor prefix” set for your custom repo, which means it will not be searched for schemas with any other vendor.

I tested with different vendors and specified com.snowplowanalytics for the test. As far as I understand, it is not particularly important what the vendor should be, the main thing is that it should be the same in the scheme and iglu_permissions and in the resolver. In general, I use the vendor - com.acme.

In the iglu_permissions table:
apikey: 2cc29b15-e0f2-42c1-9bf6-f1115f2548c3
vendor: com.acme
wildcard: true
schema_action: CREATE_VENDOR
key_action: “{CREATE,DELETE}”

Request:

curl --location '{{iglu-server}}/api/schemas' \
--header 'apikey: 2cc29b15-e0f2-42c1-9bf6-f1115f2548c3' \
--data ''

Response:
[
“iglu:com.acme/steps/jsonschema/1-0-0”
]

Request:

curl --location '{{iglu-server }}/api/schemas/com.acme/steps/jsonschema/1-0-0' \
--header 'apikey: 2cc29b15-e0f2-42c1-9bf6-f1115f2548c3' \
--data ''

I get a 500 error.

In the logs:
[ioapp-compute-0] ERROR org.http4s.server.service-errors - Error servicing request: GET /api/schemas/com.acme/steps/jsonschema/1-0-0 from {{api_address}}
org.postgresql.util.PSQLException: No results were returned by the query.
at org.postgresql.jdbc.TypeInfoCache.getPGArrayElement(TypeInfoCache.java:657)
at org.postgresql.jdbc.PgArray.buildArray(PgArray.java:310)