Error in Export to Excel smart service - No such file or directory

Hi,
I am using Export SQL to Excel node and I am getting below error in one of the environment
'There is a problem with task “Export SQL to Excel” in the process “APP_Scheduled Extract”. The following error was raised by the Export to Excel function: java.io.IOException: No such file or directory'.

The same model is working fine in environment 1 and not working in environment 2. Both environments are on premise and both have same version of plugin.
Could you please let me know what is causing the issue here.

OriginalPostID-258562



  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer
    over 5 years ago
    Can you attach the configuration of smart service node
  • 0
    Certified Lead Developer
    over 5 years ago
    Looks, the target folder i.e., Document_save_directory, OR Excel_base_template OR Document_to_overwrite does not exist in environment 2.
  • I have not given any base templates, and I have selected proper folders for document storage.
  • 0
    Certified Lead Developer
    over 5 years ago
    Try to check the security for folder, document and process model
  • I agree with vinodb it looks like the either the target folder is not present or not proper security is given to the document folder.
  • It could be a security issue as vinod said. Make sure that smart service node is being executed with user context who is having security to that folder. Better to make it 'Run as whoever designed this process model' and provide them access to folder
  • We have run the smart service in the context of the designer (The user who started the process is system admin as well)
    The folder provided in the "Document_save_directory" is hard coded to a folder in the environment.
    Document_to_overwrite and excel_base_template are left blank as they are not required.
    The same process gets executed successfully in a different environment, only in prod env we are facing this issue.
  • Below is the snap shot of server logs

    23:18:45,364 INFO [stdout] (Appian Work Item - 1407481 - ProcessExec00 : UnattendedJavaActivityRequest) Caused by: java.lang.RuntimeException: java.io.IOException: No such file or directory
    23:18:45,450 INFO [stdout] (Appian Work Item - 1407481 - ProcessExec00 : UnattendedJavaActivityRequest) Caused by: java.io.IOException: No such file or directory
    23:18:45,459 INFO [stdout] (Appian Work Item - 1407481 - ProcessExec00 : UnattendedJavaActivityRequest)           at java.io.UnixFileSystem.createFileExclusively(Native Method)
    23:18:45,466 INFO [stdout] (Appian Work Item - 1407481 - ProcessExec00 : UnattendedJavaActivityRequest)           at java.io.File.createTempFile(File.java:2024)
  • The issue could be related to how apache POI library is managing java.io.tmpdir.
    The Export SQL to Excel smart service makes use of apache POI library to create files. This plugin works based on the assumption that the system environment is only utilized by Appian product. If there is any other Java applications/scripts utilizing apache POI in the same server then restarting of this application/script in the same system will cause this POI to remove default poifiles directory under the defined java tempdir, which only gets created during the JVM startup and deleted on JVM shutdown.
    If there is such an application/script utilizing Apache POI, then it would be best to isolate these two conflicting applications to its own tempdir. This can be set to each JVM startup script.
    e.g. -Djava.io.tmpdir=/<NEW_TEMP>, where <NEW_TEMP> is persistent directory accessible by appian user. Or you can apply similar concept to isolate other Java applications/script to use its own tempdir.
  • It seems you are attempting to read/write to the same file before its created or read? Are you able to specify a new output file and write to it successfully?