Schema-registry: Where is ${schema-registry.log.dir} defined

Created on 8 Jan 2018  路  3Comments  路  Source: confluentinc/schema-registry

On Centos 7x, CP 4.0
When I run

$ /usr/bin/kafka-avro-console-producer \ --broker-list localhost:9092 --topic test \ --property value.schema='{"type":"record","name":"myrecord","fields":[{"name":"f1","type":"string"}]}'

I get an exception

java.io.FileNotFoundException: /usr/bin/../logs/schema-registry.log (Permission denied)

/usr/logs/schema-registry.log exists and has 777 as its permissions

So, where is ${schema-registry.log.dir} defined and why do I get a permission denied even though the log file exists and has permissions to allow anyone to write?

bug usability

Most helpful comment

I ran into this issue as well. Even though there is a workaround, I think this should be fixed in the product itself. I could understand starting a service failing due to permissions issue, but running kafka-avro-console-producer should not fail due to permissions issue.

Therefore I am re-opening this issue.

All 3 comments

While I still do not know why a file with 777 permissions cannot be written to by confluent services started by my id, I managed to figure out where ${schema-registry.log.dir} is set. Hope this is of help to someone

  1. confluent cli starts the schema-registry service by calling
    "${confluent_bin}/schema-registry-start"

  2. Schema-reistry-start builds a bunch of variables and calls /usr/bin/schema-registry-run-calss

  3. one of the parameters schema-registry-run-class passes java when running the class is schema-registry.log.dir via -D option

  4. The value for schema-registry.log.dir is build in schema-registry-run-class script by determining if confluent platform in in dev mode or installed via tar or another method.

To run confluent cli and use the avro producer without running into permission issues set these 2 env variables before calling confluent start

export LOG_DIR=/home//logs
export CONFLUENT_CURRENT=/home//confluent/

After the above are set, you can run confluent start and avro producer.

馃憤

I ran into this issue as well. Even though there is a workaround, I think this should be fixed in the product itself. I could understand starting a service failing due to permissions issue, but running kafka-avro-console-producer should not fail due to permissions issue.

Therefore I am re-opening this issue.

Was this page helpful?
0 / 5 - 0 ratings