In my case I was trying to write the json file in a folder which was already having a json file. So I change the location of the sink and it worked for me. All the best!!