PlayFramework itself, adding files under TMP folder at Linux

Hi;

We are having an issue about one of our contractor’s software. When we are running their software, it generates a lot of files under “tmp” folder. Those files do not remove until any period. We are deleting manually. Contractor is insisting that “Playframework” is putting those files/folders under “tmp” folder.
Is it possible?
Our server is running linux redhat 7.4.

Thank you.

Hi @Sonizci,

Yes, it is possible if they are doing file uploads, for example. But the files are usually removed automatically. Anyway, for Play 2.6.x, there is also a utility to schedule a cleanup:

  1. For Java: https://www.playframework.com/documentation/2.6.x/JavaFileUpload#Cleaning-up-temporary-files
  2. For Scala: https://www.playframework.com/documentation/2.6.x/ScalaFileUpload#Cleaning-up-temporary-files

Could you please see how old the files at /tmp are? Also, for how long is the application running?

1 Like

This is done specifically by TemporaryFile, which writes to the JVM’s idea of where the temporary file folder is:

1 Like

You can also control the directory by setting the java.io.tmpdir system property. This is documented here: https://docs.oracle.com/javase/7/docs/api/java/io/File.html#createTempFile(java.lang.String,%20java.lang.String,%20java.io.File)

Hi;

Program interface is not uploading any files.
After installation and startup, we are seeing a lot of these files. Every couple of days we are upgrading a new version. System Admins manually deleting files. Currently there is no old file :(
Today we installed new version and 4 examples:

[root@lnjsvcbt01]</tmp$ ls -ld playtemp*
drwx------ 2 [programname] [programname] 6 Mar 19 13:36 playtemp2050664863326889884
drwx------ 2 [programname] [programname] 6 Mar 19 13:36 playtemp5504644997611553861
drwx------ 2 [programname] [programname] 6 Mar 19 13:38 playtemp6666650287110327357
drwx------ 2 [programname] [programname] 6 Mar 19 13:37 playtemp8346517518727342073

@ marcospereira thanks for your advice. I send the links to developers. Waiting for their reply

@wsargent like you say, probable culprit that line of code. Question is; Are developer saving tmp files and forgetting deleting files, or framework generating those files and leaving there?

*** Update => 3 hours past after installation, and all files still exist. 150 files total.

Turn on the temporary file reaper and set it to debug – it’ll tell you exactly what it’s doing in the logs.

1 Like


wsargent
Will Sargent; after your post, we immediately try to take your advice.
Here is why i respond so late; when we edit config to add reaper, we discovered service actually in a error loop :D .
Then we check loadbalancer’s count and guess what we saw; there is no request to that service. Their software; has 4 different services.
We immediatly mailde the contractor, there is still no response.

Sorry for taking your time. I will post the progress if they mail back.

My guess is when service is starting, it puts those files into tmp folder. In the start state crashes and try to start again. This loop probably leaving files without deleting.

Thank you for all your support.