Uploaded image for project: 'Runtime'
  1. Runtime
  2. RUNTIME-3817

Instance number is not created when AmetysCMS is a symbolic link

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.7.0
    • 4.6.0
    • None
    • None
    • 4.7.0 RC1

      Caused by: ERROR 08003: No current connection.
              at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
              at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
              ... 13 more
      2023-04-05 12:41:23,968 ERROR [org.ametys.runtime.servlet.RuntimeServlet] (main;) Cannot create the instance id
      java.nio.file.FileAlreadyExistsException: /home/cms/Ametys_CMS/ametys_cms_home
              at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:94)
              at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
              at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
              at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:397)
              at java.base/java.nio.file.Files.createDirectory(Files.java:700)
              at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:807)
              at java.base/java.nio.file.Files.createDirectories(Files.java:753)
              at org.ametys.runti
      

          [RUNTIME-3817] Instance number is not created when AmetysCMS is a symbolic link

          quote from java issue tracker

          Indeed createDirectories() is documented to throw:
          
          "FileAlreadyExistsException - if dir exists but is not a directory (optional specific exception)"
          
          As "/tmp/symlink" is a symbolic link to a directory, but not a directory itself, the exception appears to be correct so this issue should be resolved as "Not an Issue."

          so we have to test if we can create a file before trying to create the directory?

          Raphaël Franchet added a comment - quote from java issue tracker Indeed createDirectories() is documented to throw : "FileAlreadyExistsException - if dir exists but is not a directory (optional specific exception)" As "/tmp/symlink" is a symbolic link to a directory, but not a directory itself, the exception appears to be correct so this issue should be resolved as "Not an Issue." so we have to test if we can create a file before trying to create the directory?

            ggouin Guillaume Gouin
            lperier Laurence Perier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: