fern icon indicating copy to clipboard operation
fern copied to clipboard

[Bug] Fern temporary files created as directory

Open antoniomdk opened this issue 5 months ago • 0 comments

Describe the bug

Somewhat related to #1998.

When running fern generate --local on Linux, the CLI generates the temporary files as directories:

drwx------ 3 user user 4096 Sep 21 23:08 fern-1350-d5GZ7wpkIfeQ 

So the Java generator fails:

Exception in thread "main" java.lang.RuntimeException: Failed to read plugin configuration
	at com.fern.java.AbstractGeneratorCli.getGeneratorConfig(AbstractGeneratorCli.java:67)
	at com.fern.java.AbstractGeneratorCli.run(AbstractGeneratorCli.java:116)
	at com.fern.java.client.Cli.main(Cli.java:342)
Caused by: java.io.FileNotFoundException: /fern/config.json (Is a directory)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at com.fasterxml.jackson.core.JsonFactory.createParser(JsonFactory.java:1029)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3495)
	at com.fern.java.AbstractGeneratorCli.getGeneratorConfig(AbstractGeneratorCli.java:65)

I thought the issue was related to the docker mounts, but the host files are marked as directories, so maybe the issue comes from the CLI and not the Java generator.

Expected behavior

fern-api should generate the IR and other config files as files and not directories.

CLI Version

0.42.12 Java Generator: 2.1.0

Additional context

antoniomdk avatar Sep 21 '24 23:09 antoniomdk