1

I'm getting an exception (java.nio.file.AccessDeniedException) and I don't know the reason behind it.

Does this occur when play.http.secret.key is incorrect in prod.conf or is this a symptom of some other credential being incorrect?

Oops, cannot start the server.
com.google.inject.CreationException: Unable to create injector, see the following errors:

1) Error injecting constructor, java.nio.file.AccessDeniedException: /tmp/playtemp5604435787006203928
  at play.api.libs.Files$DefaultTemporaryFileCreator.<init>(Files.scala:145)
  at play.api.libs.Files$DefaultTemporaryFileCreator.class(Files.scala:142)
  while locating play.api.libs.Files$DefaultTemporaryFileCreator
  while locating play.api.libs.Files$TemporaryFileCreator    
Caused by: java.nio.file.AccessDeniedException: /tmp/playtemp5604435787006203928
Robin Green
  • 32,079
  • 16
  • 104
  • 187
abby
  • 11
  • 1
  • The problem has nothing to do with credentials. The problem is a file `/tmp/playtemp5604435787006203928` cannot be created or updated. Which operating system are you running on? – Robin Green May 19 '18 at 19:47
  • Thanks @RobinGreen that was in fact the issue. – abby May 21 '18 at 19:53

1 Answers1

1

Well it looks like your application cannot do file manipulation on the system, so:

File name/path: double check the file name and the path used in your application.

prod.conf: I don't know what you have in your prod.conf, but mainly I use it for env variables for other apis such as AWS; or db credentials. So I don't think the prod.conf created your issue; unless you added your production superuser creds; which brings me to the last point.

Your application should not be a superuser: Note that you should not let your application do the "sudo/superuser" stuff (e.g., update the underlying OS). So, if you are doing that, please avoid it. If the mess is created, then you might end up getting locked out of your production environment. Of course the exception here is, if your web application is a cluster management system; for example, then obviously it might need to do the superuser operations.

o-0
  • 1,713
  • 14
  • 29
  • Thanks @Dave Rose. Directory/File permissions was the issue. the prod.conf and application not being superuser check out in my case. – abby May 21 '18 at 19:54
  • @abby no worries, glad you could sort it out. – o-0 May 22 '18 at 01:30