[Solved] Posting a schema to Iglu Server: The schema is not found

Hello !

I’m trying to install an Iglu Server for RDB Loader but when I’m posting a schema, it returns {"message":"The schema is not found"}. I used EMR RTL Runner before so I never had to do anything with Iglu (other than writing resolvers), so maybe I’m missing something.

curl -XPOST localhost:80/api/schemas \
  -H "apikey: 5fb4713d-73ad-4163-93a9-2b82f0177c5b" \
  -d '{
    "$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
    "description": "Schema for YAUAA enrichment config",
    "self": {
        "vendor": "com.snowplowanalytics.snowplow.enrichments",
        "name": "yauaa_enrichment_config",
        "format": "jsonschema",
        "version": "1-0-0"
    },
    "type": "object",
    "properties": {
        "vendor": {
            "type": "string"
        },
        "name": {
            "type": "string"
        },
        "enabled": {
            "type": "boolean"
        },
        "parameters": {
            "type": "object",
            "properties": {
                "cacheSize": {
                    "type": "integer"
                }
            },
            "additionalProperties": false
        }
    },
    "required": [
        "vendor",
        "name",
        "enabled"
    ],
    "additionalProperties": false
}'

If you are posting - this probably means the API key is incorrect, I believe the endpoint responds with 404 rather than a 401 / 403 if you post with a API key that isn’t correct.

Hi @guillaume ,

I think you’ve run into a bug in the docker-compose example that we put in the iglu-server repo. This line reads

      IGLU_MASTER_API_KEY: ${IGLU_MASTER_API_KEY:-5fb4713d-73ad-4163-93a9-2b82f0177c5b}

but it should read

      IGLU_SUPER_API_KEY: ${IGLU_SUPER_API_KEY:-5fb4713d-73ad-4163-93a9-2b82f0177c5b}

Once I changed the docker-compose file then I was able to get your example working.

If, on the other hand, you were not using the docker-compose file but were configuring the app some other way… then I recommend looking at how you configure the super api key.

1 Like

@istreeter That was the issue!

{"message":"Schema created","updated":false,"location":"iglu:com.snowplowanalytics.snowplow.enrichments/yauaa_enrichment_config/jsonschema/1-0-0","status":201}

Thanks!

I created this issue and this issue in github so we fix this properly.

2 Likes