Permission denied on build Folder

Answered

Hello,

i am working in a school. We have IntelliJ installed for all machines.

Sometimes we get an error during the compilation. The error says that that user don't has the rights to write in the build-folder.

When we check the rights for the build folder, we see, that only the administrator hast the rights for this folder.

How can this be fixed.

 

Thank you for your response

 

0
11 comments

Hello, Maximillian!

Thank you for reporting this!

The issue may stem from IDEA using a standalone process to run the build and the folder created inherits the account-specific permissions. If the build process starts under Administrator credentials in your environment, that may lead to the issue you've described.

Could you please share more details about the use-case and the environment:

  • Which Build System the Projects are using (IDEA Native, Gradle, Maven)?
  • How the Build is initiated (Gutter Icons, Build Menu, etc.)?
  • Are there multiple user accounts per computer?
1

Hello Roman,

thank you very much for your response. The IDE is started as an teacher/student. How can I find out which process started the build.

We use Gradle as a Build System and start the process on the gutter icon on the left of the main function. There are administrator, teacher and accounts for students.

 

 

0

Maximilian Hertenstein Thank you for sharing the details!
Gradle Builds by default are processed by Gradle itself, but may be delegated to IDEA as well.

Please check the Gradle Settings and let me know which option is used in your environment ("Build and run using" and “Run tests using” options).

I'm assuming the computers are running on Windows, is that correct?

1

I can look for these options tomorrow, but Im sure that default options are selected.

Yes, we use windows.

0

Maximilian Hertenstein Assuming your environment uses the default settings (builds are processed by Gradle), I would suggest to track which credentials the Gradle Daemons runs under.

In IDEA press Shift twice and type “Show Gradle Daemons", then you can track down the process in Windows Task Manager via its PID.

1

Hello, I'm very sorry that I needed so long to write an answer. There Gradle process runs under the current user. I tried to reinstall IntelliJ, use the Community Version or use InteliJ/Amper as a Build-Tool but that did not work.

0

The same error occurs when I use Maven. Maybe Gradle is not the problem.

0

Maximilian Hertenstein Could you share a screenshot of the affected directory's permissions: right-click the directory → Properties → Security → Advanced → "Permissions" tab.

Feel free to redact any sensitive information.

Build Tools like Maven and Gradle use generic commands to create directories, so the issue may stem from how Windows manages the file system.

0

gast19 is the user that was logged in.

0

Maximilian Hertenstein Thank you for sharing the screenshot!

The most curious part of it is the “Inherited from” ("Geerbt von") section.

As mentioned earlier, Maven, Gradle and IDEA do not directly manage the file system permissions and use generic commands to generate files / folders.

On Windows newly-created directories by default inherit their permissions from their parent directories.

Are there any security solutions that may automatically manage the folder permissions in the environment?

You can try monitoring the Project's directory with Process Monitor to see if anything other than Gradle / Maven / IDEA accesses it and makes changes to the permissions.

0

Please sign in to leave a comment.