Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's not possible to upload zip archive created on Mac #121

Open
chloegugli opened this issue Jun 29, 2018 · 5 comments
Open

It's not possible to upload zip archive created on Mac #121

chloegugli opened this issue Jun 29, 2018 · 5 comments

Comments

@chloegugli
Copy link
Contributor

chloegugli commented Jun 29, 2018

There is a folder (name __MACOSX) inside Mac archives and the catalog tries to parse it as a workflow. As a result, we get an error "The object(s) couldn't be uploaded: It was not possible to parse an object: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 middle byte 0x0 (at char #99, byte #-1)" and no workflow is uploaded.
When we remove this __MACOSX folder, the upload of the archive works.

@chloegugli
Copy link
Contributor Author

@ShatalovYaroslav
Copy link
Contributor

ShatalovYaroslav commented Jun 29, 2018

It's true that zip should contain only files that will be extracted as catalog objects.
So catalog in current realization is not expecting to have folder inside zip.
There is no bug in this behavior. It's contract of use catalog API: zip archive should contain object files inside in first level of hierarchy. So catalog should not take files from subfolders.

When I extract the provided YolloTest.zip in any OS, there are next:
__MACOSX (Folder)
YolloTest (Folder)
Inside YolloTest subfolder there are files:
YOLO.xml
YOLO1.xml
YOLO2.xml

In this example even if inside catalog it will be skipped the folders, we will not get the correct objects, because the files are in the subfolder.

We did with @marcocast the archive on mac with zip command and it works fine for catalog.
ciaos.zip
The zip is attached.
Because in the archive it was no subfolders and only required files.
So there is no bug.

The solution for MAC and in general is to generate the zip archive properly:
don't put subfolders during generating zip archive (use maybe other library on Mac or command line).

I think we can close the issue.
@cdiop @chloegugli do you agree?

@marcocast
Copy link
Contributor

I tried to create a zip from my mac and I don't have the __MACOSX folder :
ciaos.zip
which is strange as the mac SHOULD create that folder.
Anyway a mac user can remove the folder with this command :

zip -d your-archive.zip "__MACOSX*"

We can add this command in the documentation or in the tooltip in the portal maybe...

As a more robust solution we could opt for ignoring folders in the zip and only considering files.

@ShatalovYaroslav
Copy link
Contributor

I agree as an improvement, on catalog service side we can skip the sub folders of archive.
But we can not handle the case if the required object files are inside subfolder.

@chloegugli
Copy link
Contributor Author

chloegugli commented Jun 29, 2018

Ignoring folders in the zip is a good solution, it is OK if we can't handle every case of subfolders. @marcocast Actually it seems that Mac users can't see this folder, it is hidden. You can see it if you open it in another OS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants