Image error inside of imported pages

Hello there,

I am currently working on a replacement of an old wiki we were using. For the new wiki we decided to use XWiki.

Because the existing Wiki was counting over 700 pages we built a webscraper which build a webhome xml file for every page inside our wiki. That worked perfectly fine and we were able to import every last page to XWiki.

The only problem which occured was, that images inside of those imported pages would not be displayed. After the analysis of the logs we found the following error:

│ 2023-10-19 05:35:12,795 [domain.net/bin/download/Start/WebHome/%2Fbin%2Fdownload%2FMain%2FWebHome%2Fimage-2023101907
│ 3506-1.png] WARN c.x.x.p.XWikiPluginManager - downloadAttachment failed for plugin [image]: null │
│ 2023-10-19 05:35:12,795 [domain.net/bin/download/Start/WebHome/%2Fbin%2Fdownload%2FMain%2FWebHome%2Fimage-2023101907
│ 3506-1.png] WARN c.x.x.p.XWikiPluginManager - downloadAttachment failed for plugin [zipexplorer]: null

Even after uploading an image manually to those imported pages, the images are shown within the editor mode, but after saving it looks like this:
image

Also the string „%2Fbin%2Fdownload%2FMain%2FWebHome%2F“ gets prepended to the picture itself.

I searched for a solution in this forum but couldn’t find anything useful regarding this specific error. One forum mentioned to add the following string to the WYSIWYG Editor but it didn’t work either: config[‘xwiki-upload’].isTemporaryAttachmentSupported = false;

Every help is much appreciated! If there is more information needed, just mention it :slight_smile:

Best,
ImportIssue23

Hey there, welcome to the forums and to xwiki! (I’m a big fan and I’m sure you will be too!) :heart_eyes:

Even after uploading an image manually to those imported pages, the images are shown within the editor mode, but after saving it looks like this:
image

Some questions;

  1. Could you confirm that this file name is present under the attachment tab at the bottom of the page? (Take an extra look at the specific numbers)

  2. Are you using an urlrewriter / url shortener in your environment?

Hey Wardenburg,

thank you for the kind words!

  1. Yes, the file is present under the attachment tab, and it shows just fine. But the url is different. It is domain.net/bin/download/Start/WebHome/image-20231019073506-1.png?rev=1.1 instead of what the image object on the page tries to show: net/bin/view/Start/#I2Fbin2Fdownload2FMain2FWebHome2Fimage-20231019073506-1.png

  2. No there shouldn’t be any kind of url alteration involved.

let me just preface here that I’ve never done a migration (I’d say I’m an enthousiastic hobbyist at best :wink: )

If we look at the end results however I can say however that xwiki syntax refers to objects rather than actual urls.

i.e.:

[[image:attach:Main.SubA.SubB.WebHome@server.gif]]

Could you maybe share an example of the source code that tries to show the image?

You surely got greater knowledge than me, so I am very glad for the help! :slight_smile:

The code (after hitting edit → source code) is html:
<div><p><img src="/bin/download/Start/WebHome/%2Fbin%2Fdownload%2FStart%2FWebHome%2Fimage-20231019073506-1.png" alt="image-20231019073506-1.png" id="I2Fbin2Fdownload2FStart2FWebHome2Fimage-20231019073506-1.png" class="wikigeneratedid"/></p></div>

But what I noticed is, that every image seems to get the mentioned string prepended after hitting save. This seems to happen multiple times as well. For example, please look at this one:

<img src="/bin/download/Start/WebHome/%2Fbin%2Fdownload%2FStart%2FWebHome%2F%252Fbin%252Fdownload%252FMain%252FWebHome%252F%25252Fbin%25252Fdownload%25252FStart%25252FWebHome%25252F%2525252Fbin%2525252Fdownload%2525252FStart%2525252FWebHome%2525252F%252525252Fbin%252525252Fdownload%252525252FMain%252525252FWebHome%252525252F%25252525252Fbin%25252525252Fdownload%25252525252FMain%25252525252FWebHome%25252525252F%2525252525252Fbin%2525252525252Fdownload%2525252525252FStart%2525252525252Fout.png" alt="/bin/download/Start/out.png" id="I2Fbin2Fdownload2FStart2FWebHome2F252Fbin252Fdownload252FMain252FWebHome252F25252Fbin25252Fdownload25252FStart25252FWebHome25252F2525252Fbin2525252Fdownload2525252FStart2525252FWebHome2525252F252525252Fbin252525252Fdownload252525252FMain252525252FWebHome252525252F25252525252Fbin25252525252Fdownload25252525252FMain25252525252FWebHome25252525252F2525252525252Fbin2525252525252Fdownload2525252525252FStart2525252525252Fout.png" />

:confused:

Perhaps together we can figure it out! :wink: Otherwise there’s many smart heads floating round these forums!

Another question from my part; at the bottom of the page you have tabs, could you check under the information tab what the Syntax is set to? As a test could you experiment with setting it to HTML 5.0 ?

I hope we can :slight_smile:

It is set to HTML 5.0. But it doesn’t seem to make any difference, which syntax I choose. Since the imported XML-File only includes HTML-Tags, I guess HTML 5.0 makes more sense in this context.

Best

There is another thing I noticed: The error does not only apply to images, but to any attachment, which is referenced on the page…

well I dont know how the html url would work! … but it seems to be a thing with how the links were migrated! … personally I’m quite the fan of the xwiki format (althouygh you have to get to know it for a short bit) … its quite intuitive I’d say…

I am wondering; if you add new images/files → does that work?

Could you try the same after setting a page to xwiki syntax?