Archive is not a ZIP archive - extension installation issue

This is with the xwiki version 10.11.8. When installing an extensions Nested Pages Migrator Application and Filter Streams Converter Application, I am getting following errors -

archive is not a ZIP archive

Installed extension is not properly registered in the virtual XAR installed extensions repository

Although, the installation is successful in the Extensions UI, the new applications do not show up in the list of installed applications.

What is the cause of this issue and is there any work around?

I once hat a similar issue, and restarting XWiki helped. (O have to admit that I did not try to find the cause of the error.)
However in your case it might be that the download of the XAR-file for extension failed / was incomplete, so I am not sure if this fixes the problem.

You seems to have a bad extension file for some reason. You might want to try to uninstall and install the broken extension again.

I am using the extension manager to install the plugin. Here is the installation log -


I have some questions -

  1. The wiki is behind an nginx server. I have modified the wiki to run from a context path. Is this the root cause of the issue?
  2. Is there a way to install extensions manually by downloading the plugin xar/jar and installing it in xwiki?

I actually have no idea how you can end up with an empty file i the first place except for some weird temporary network issue.

Have you tried to uninstall and install again ?

Yes, multiple times.

I checked and the extension is definitely alright and I can install it fine so it seems something in your network located between your XWiki instance and nexus.xwiki.org or extensions.xwiki.org break the extension file for some reason. Could you take a look at <permfir>data/extension/repository/org%2Exwiki%2Eplatform%3Axwiki-platform-filter-ui/10%2E11%2E8/org%2Exwiki%2Eplatform%3Axwiki-platform-filter-ui-10%2E11%2E8.xar and see how exactly it’s broken (does it exist, is it empty, maybe its content is actually some error and you can see it in a text editor, etc.).

If you get an empty file (size 0) there is a good chance that the issue is that the download of the file is blocked for some reason but because of https://jira.xwiki.org/browse/XCOMMONS-1726 you don’t see the error.

Yes, the size of the xar file is 0! But I am able to download the file with wget command in the same system -

curl -o platform.xar https://extensions.xwiki.org/xwiki/rest/repository/extensions/org.xwiki.platform%3Axwiki-platform-filter-ui/versions/10.11.8/file?rid=maven-xwiki

Is there a way to install the application after downloading the xar file manually? I tried with Importing of the content. But it does not install application

Ideally you should fix whatever break the download for xar files between XWiki and the server, I guess you have some proxy doing weird stuff in between.

At worst what you can do manually to fix your current situation:

  • replace your 0 sized file with the correct one (the file is needed for various things)
  • import the XAR file in the admin (Administration -> Content -> Import)

I was able to install the plugin by importing the XAR file. Thanks @tmortagne for your help.

But now there is another problem. I am not able to import the content using this plugin. I have selected the following options -

  1. Input Type - Generic XML input stream
  2. Source - file:/usr/local/xwiki/Confluence-export.zip
  3. Output Type - Xwiki instance output stream (xwiki + instance)

I am getting the error
Invalid UTF-8 start byte 0x9d (at char #58, byte #-1)
class org.xwiki.filter.FilterException: Faild to parse XML source
at org.xwiki.filter.xml.internal.input.AbstractXMLInputFilterStream.read(AbstractXMLInputFilterStream.java:64)
at org.xwiki.filter.internal.job.FilterStreamConverterJob.runInternal(FilterStreamConverterJob.java:100)
at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:236)
at org.xwiki.job.AbstractJob.run(AbstractJob.java:213)
at org.xwiki.filter.script.internal.ScriptFilterStreamConverterJob.run(ScriptFilterStreamConverterJob.java:75)
Caused by: class java.io.CharConversionException: Invalid UTF-8 start byte 0x9d (at char #58, byte #-1)

The name of your package suggest you want to import a Confluence package but that’s not what you are asking to the UI here. See https://extensions.xwiki.org/xwiki/bin/view/Extension/Confluence/XML/#HTutorial.

I have installed the Confluence XML plugin, but the Filter Stream Converter is not showing the option you mentioned for some strange reason. Also, I have reinstalled the Confluence XML couple of times. Still I don’t see the needed options.

image

image

You probably have the same issue: something you have between XWiki and the extension repository break the files download. Take a look at the extensions folder and see if you don’t have another 0 sized file for the confluence extension.