Uploaded image for project: 'Magnolia DAM Module'
  1. Magnolia DAM Module
  2. MGNLDAM-1041

Upload of Zip file containing SVG fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 3.0.18
    • 3.0.16
    • None
    • None

      Steps to reproduce

      1. Open assets app
      2. upload zip file zip-with-svg-assets2.zip
      3. upload zip file samsung-galaxy-a33-128gb.zip

      Expected results

      Both files are correctly uploaded and the assets are created

      Actual results

      File zip-with-svg-assets.zip is correctly processed whereas samsung-galaxy-a33-128gb.zip throws an error:

      info.magnolia.ui.api.action.ActionExecutionException: java.io.IOException: Resetting to invalid mark

      Development notes

      The error is caused in info.magnolia.dam.app.action.UploadAssetsAction.handleFileEntry(ZipFile, ZipArchiveEntry) line 201:

      bis.reset();}

      Specifically in line 446 of class BufferedInputStream:

         /**
           * See the general contract of the <code>reset</code>
           * method of <code>InputStream</code>.
           * <p>
           * If <code>markpos</code> is <code>-1</code>
           * (no mark has been set or the mark has been
           * invalidated), an <code>IOException</code>
           * is thrown. Otherwise, <code>pos</code> is
           * set equal to <code>markpos</code>.
           *
           * @exception  IOException  if this stream has not been marked or,
           *                  if the mark has been invalidated, or the stream
           *                  has been closed by invoking its {@link #close()}
           *                  method, or an I/O error occurs.
           * @see        java.io.BufferedInputStream#mark(int)
           */
          public synchronized void reset() throws IOException {
              getBufIfOpen(); // Cause exception if closed
              if (markpos < 0)
                  throw new IOException("Resetting to invalid mark");
              pos = markpos;
          }
       

      Tested with Java 8 and 14
      Tested with different combinations of the files in samsung-galaxy-a33-128gb.zip:

      • Reducing the number of files up to 1
      • Simplifying the file names so they are not long and neither contain characters other than letters.
      • Mixing with the files of the working zip.
        All of the above failed.

        Acceptance criteria

              jalonso Jesus Alonso
              jayala Jonathan Ayala
              AuthorX
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0d
                    0d
                    Logged:
                    Time Spent - 1.75h
                    1.75h