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?
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
confluent cli starts the schema-registry service by calling
"${confluent_bin}/schema-registry-start"
Schema-reistry-start builds a bunch of variables and calls /usr/bin/schema-registry-run-calss
one of the parameters schema-registry-run-class passes java when running the class is schema-registry.log.dir via -D option
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/
export CONFLUENT_CURRENT=/home/
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.
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-producershould not fail due to permissions issue.Therefore I am re-opening this issue.