Cannot display image in form

Hi, I installed kobotoolbox on my own servers, but I had the issue when I open the deployed form, it cannot find the logo image i set. It appear like a broken image. Trying to solve this, I replicated the form in kobotoolbox server and works fine. Inspecting the code generated in the form I got:

<img class="active" 
data-offline-src="/media/get/https/kc.kobotoolbox.org/javib94/xformsMedia/1061170/1602325.png" 
src="blob:https://ee.kobotoolbox.org/415533f5-fd79-4831-b3de-2a6366545611" 
data-itext-id="/a5kuiZcZEdYeaE7zFQKa7a/logo:label" 
alt="image" lang="default">

The code generated in my own server:

<img lang="default" 
class="active" 
data-offline-src="jr://images/LOGO.png" 
src="" 
data-itext-id="/ag8hTQHsyU9snKgP7G4PDu/logo:label" 
alt="image">

As you can see the field src is empty, Am i missing any configuration? or can you give some path to aboard this issue? I’ll appreciate it. Thank you!

Hello,
did you deploy AFTER uploading the image?
Do you use multiple languages in the form?

1 Like

Yes, I redeployed the form multiple times, and No, my form is not available in multiple languages.

Hi, months later, I found the solution in another forum. We have to change the “ip filtering” enketo configuration, the file is in ~/kobo-env/enketo_express/config.json.

Notice that when the server is in a private datacenter, usually the public IP is not directly associated with the machine, so thats why we have to change the allowPrivateIPAddress property to true.

 "ip filtering": {
        "allowIPAddressList": [],
        "allowMetaIPAddress": false,
        "allowPrivateIPAddress": true,
        "denyAddressList": []
    },
2 Likes

@javib94, :clap: :heart: :partying_face:

wow thanks A LOT for that, I could not possibly have figured that out. Problem solved.

1 Like

Hi, thank you for the information. I had the exact same issue, and i did the change you mentioned, but i’m still having the problem with the media files. So i don’t know if is it necessary to do something with the containers in order to see the change reflected on the server.
image

You can try to restart the enketo express container, just a docker restart < container_name >

2 Likes

@javib94, :clap: :heart: :partying_face: