Nextcloud Office insert image from Nextcloud to text document fails

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 32.0.3
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.58
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • (none)
  • PHP version (e.g, 8.3):
    • 8.4
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • (unknown)
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • bare metal
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

When I try to insert an image from Nextcloud to a document, it always says “Unknown image format”:

It also doesn’t matter which format the image has. JPG, PNG - none works.

However, inserting a local image works fine.

Collabora 25.04.8.1 runs in a Docker container.

Steps to replicate it (hint: details matter!):

  1. Create a Nextcloud office new text document and open it.

  2. Click in “Insert Image” → “Insert image …” (or “Insert” → “Image …” in the compact view menu).

  3. Select an image stored in Nextcloud.

  4. Click “Insert file”

  5. See the error.

Log entries

There none - neither in the browser console, nor in the Nextcloud server log.

Nextcloud

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'xxxx',
  'passwordsalt' => 'xxxx',
  'secret' => 'xxxx',
  'trusted_domains' => 
  array (
    0 => 'xxxx',
  ),
  'datadirectory' => '/mnt/nextcloud-data',
  'skeletondirectory' => '',
  'overwrite.cli.url' => 'xxxx',
  'dbtype' => 'mysql',
  'version' => '32.0.3.2',
  'installed' => true,
  'htaccess.RewriteBase' => '/',
  'maintenance' => false,
  'dbname' => 'xxxx',
  'dbhost' => 'xxxx',
  'dbuser' => 'xxxx',
  'dbpassword' => 'xxxx',
  'dbpersistent' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/run/redis/redis-server.sock',
    'port' => 0,
    'dbindex' => 0,
  ),
  'knowledgebaseenabled' => false,
  'theme' => '',
  'simpleSignUpLink.shown' => false,
  'loglevel' => 2,
  'log_authfailip' => true,
  'mysql.utf8mb4' => true,
  'mail_from_address' => 'xxxx',
  'mail_domain' => 'xxxx',
  'mail_smtpmode' => 'sendmail',
  'mail_smtphost' => 'xxxx',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpname' => 'xxxx',
  'mail_smtppassword' => 'xxxx',
  'updater.release.channel' => 'stable',
  'trashbin_retention_obligation' => 'auto, 30',
  'versions_retention_obligation' => 'auto, 180',
  'has_rebuilt_cache' => true,
  'default_language' => 'de',
  'default_phone_region' => 'DE',
  'check_data_directory_permissions' => false,
  'log_rotate_size' => 10485760,
  'profile.enabled' => false,
  'preview_max_x' => 1920,
  'preview_max_y' => 1920,
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauth' => true,
  'mail_smtpport' => '465',
  'trusted_proxies' => 
  array (
    0 => 'xxxx',
    1 => 'xxxx',
    2 => '127.0.0.1',
    3 => '::1',
  ),
  'auth.bruteforce.protection.enabled' => true,
  'ratelimit.protection.enabled' => true,
  'reference_opengraph' => false,
  'integrity.check.disabled' => false,
  'defaultapp' => 'files',
  'maintenance_window_start' => 22,
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
  ),
  'app_install_overwrite' => 
  array (
  ),
  'forbidden_filename_characters' => 
  array (
    0 => '\\',
    1 => '/',
  ),
  'forbidden_filename_extensions' => 
  array (
    0 => '.filepart',
    1 => '.part',
  ),
  'memories.db.triggers.fcu' => true,
  'memories.exiftool' => '/var/www/nextcloud/apps/memories/bin-ext/exiftool-amd64-glibc',
  'memories.vod.path' => '/var/www/nextcloud/apps/memories/bin-ext/go-vod-amd64',
  'memories.index.path.blacklist' => 'xxxx',
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\HEIC',
    4 => 'OC\\Preview\\BMP',
    5 => 'OC\\Preview\\XBitmap',
    6 => 'OC\\Preview\\MP3',
    7 => 'OC\\Preview\\TXT',
    8 => 'OC\\Preview\\MarkDown',
    9 => 'OC\\Preview\\Movie',
    10 => 'OC\\Preview\\MKV',
    11 => 'OC\\Preview\\MP4',
    12 => 'OC\\Preview\\AVI',
    13 => 'OC\\Preview\\Image',
    14 => 'OC\\Preview\\Imaginary',
  ),
  'dbtableprefix' => 'oc_',
  'memories.gis_type' => 1,
  'memories.vod.ffmpeg' => '/usr/bin/ffmpeg',
  'memories.vod.ffprobe' => '/usr/bin/ffprobe',
  'enable_previews' => true,
  'preview_imaginary_url' => 'http://127.0.0.1:9000',
);

Apps

The output of occ app:list (if possible).

Enabled:
  - activity: 5.0.0-dev.0
  - admin_audit: 1.22.0
  - app_api: 32.0.0
  - bookmarks: 16.0.1
  - bruteforcesettings: 5.0.0-dev.0
  - calendar: 6.1.4
  - circles: 32.0.0
  - cloud_federation_api: 1.16.0
  - collectives: 3.5.0
  - comments: 1.22.0
  - contacts: 8.2.1
  - contactsinteraction: 1.13.1
  - dav: 1.34.2
  - dav_push: 1.0.0
  - deck: 1.16.3
  - drawio: 3.1.2
  - external: 7.0.0
  - federatedfilesharing: 1.22.0
  - federation: 1.22.0
  - files: 2.4.0
  - files_downloadlimit: 5.0.0-dev.0
  - files_pdfviewer: 5.0.0-dev.0
  - files_reminders: 1.5.0
  - files_sharing: 1.24.1
  - files_trashbin: 1.22.0
  - files_versions: 1.25.0
  - flow_notifications: 3.0.0
  - impersonate: 3.0.1
  - logcleaner: 1.2.3
  - logreader: 5.0.0-dev.0
  - lookup_server_connector: 1.20.0
  - memories: 7.7.0
  - nextcloud_announcements: 4.0.0-dev.0
  - notes: 4.12.4
  - notifications: 5.0.0-dev.0
  - notify_push: 1.3.0
  - oauth2: 1.20.0
  - password_policy: 4.0.0-dev.0
  - photos: 5.0.0-dev.1
  - previewgenerator: 5.11.0
  - privacy: 4.0.0-dev.0
  - profile: 1.1.0
  - provisioning_api: 1.22.0
  - richdocuments: 9.0.2
  - serverinfo: 4.0.0-dev.0
  - settings: 1.15.1
  - sharebymail: 1.22.0
  - spreed: 22.0.7
  - support: 4.0.0-dev.0
  - survey_client: 4.0.0-dev.0
  - systemtags: 1.22.0
  - text: 6.0.1
  - theming: 2.7.0
  - theming_customcss: 1.19.0
  - twofactor_backupcodes: 1.21.0
  - twofactor_webauthn: 2.4.1
  - updatenotification: 1.22.0
  - viewer: 5.0.0-dev.0
  - webhook_listeners: 1.3.0
  - whiteboard: 1.5.1
  - workflowengine: 2.14.0
Disabled:
  - dashboard: 7.12.0 (installed 7.8.0)
  - dicomviewer: 2.3.1 (installed 2.3.1)
  - encryption: 2.20.0 (installed 2.13.0)
  - files_external: 1.24.0 (installed 1.19.0)
  - firstrunwizard: 5.0.0-dev.0 (installed 5.0.0-dev.0)
  - jsloader: 2.0.0 (installed 2.0.0)
  - recommendations: 5.0.0-dev.0 (installed 0.4.0)
  - related_resources: 3.0.0-dev.0 (installed 1.1.0-alpha1)
  - suspicious_login: 10.0.0-dev.0
  - twofactor_nextcloud_notification: 6.0.0-dev.0
  - twofactor_totp: 14.0.0
  - user_ldap: 1.23.0
  - user_status: 1.12.0 (installed 1.5.0)
  - weather_status: 1.12.0 (installed 1.3.0)

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

I have NC32 and CODE 25.04.5.2 as dedicated docker install behind traefik v3 reverse proxy, client Debian Trixie and Firefox

COOLWSD version: 25.04.5.2(git hash: f497e19646 (E))
LOKit version: Collabora Office 25.04.5.2(git hash: 2404805e4d)
Served by: Debian GNU/Linux 13 (trixie)
Server ID: e9f95207
WOPI host: nextcloud 32.0.3.2 - richdocuments 9.0.2
  • copy&paste :check_mark:
  • insert local image :check_mark:
  • insert image :check_mark: (insert from cloud)

Yes, it may work with 25.04.5.2 - but I have 25.04.8.1.

Update: just tested with with 25.04.5.2 - does not work either. How exactly do you start CODE in Docker?

nothing special, likely you can use Collabora CODE for Nextcloud with Docker

# docker compose config collabora
services:
  collabora:
    cap_add:
      - MKNOD
    cpus: 2
    container_name: collabora
    environment:
      VIRTUAL_HOST: collabora.mydomain.tld
      VIRTUAL_PORT: "9980"
      VIRTUAL_PROTO: http
      aliasgroup1: https://nc.mydomain.tld:443
      aliasgroup2: https://dev-nc.techisfun.net:443
      aliasgroup3: https://test-nc.techisfun.net:443
      dictionaries: de_DE en_US es_ES ru
      extra_params: --o:ssl.enable=false --o:ssl.termination=true --o:user_interface.mode=compact --o:remote_font_config.url=https://dev-nc.techisfun.net:443/apps/richdocuments/settings/fonts.json --o:logging.level=warning
      password: ***mysecretpwd***
      username: ***admin user***
    expose:
      - "9980"
    image: collabora/code:25.04.5.2.1
    labels:
      traefik.enable: "true"
      traefik.http.routers.collabora.middlewares: secHeaders5@file
      traefik.http.routers.collabora.rule: Host(`collabora.mydomain.tld`)
      traefik.http.routers.collabora.tls: "true"
      traefik.http.routers.collabora.tls.certresolver: letsencryptresolver
      traefik.http.services.collabora.loadbalancer.server.port: "9980"
    mem_limit: "8589934592"
    networks:
      proxy: null
    restart: unless-stopped
    tty: true
    volumes:
      - type: bind
        source: /etc/timezone
        target: /etc/timezone
        read_only: true
        bind:
          create_host_path: true
      - type: bind
        source: /etc/localtime
        target: /etc/localtime
        read_only: true
        bind:
          create_host_path: true
      - type: bind
        source: /ssd/infra/code_no_welcome
        target: /usr/share/coolwsd/browser/dist/welcome
        read_only: true
        bind:
          create_host_path: true
networks:
  proxy:
    name: proxy
    external: true

Thanks - but this does not work either here. Same result - on all instances where I tested it.

The logs in Docker:

kit-00228-00228 2026-01-16 00:26:41.409761 +0000 [ kitbroker_002 ] ERR  ToMaster-009: CALLBACK_ERROR: { "code": 24581, "kind": "network", "cmd": "insert"}| kit/ChildSession.cpp:3737
kit-00228-00228 2026-01-16 00:26:41.409827 +0000 [ kitbroker_002 ] ERR  ToMaster-009: error: cmd=insert kind=network code=24581| common/Session.hpp:159
kit-00228-00228 2026-01-16 00:26:41.409879 +0000 [ kitbroker_002 ] ERR  ToMaster-009: CALLBACK_ERROR: { "code": 24581, "kind": "network", "cmd": "insert"}| kit/ChildSession.cpp:3737
kit-00228-00228 2026-01-16 00:26:41.409904 +0000 [ kitbroker_002 ] ERR  ToMaster-009: error: cmd=insert kind=network code=24581| common/Session.hpp:159
wsd-00001-00650 2026-01-16 00:26:41.409926 +0000 [ docbroker_002 ] ERR  ToClient-009: insert error failure: network| wsd/ClientSession.cpp:2407
wsd-00001-00650 2026-01-16 00:26:41.410046 +0000 [ docbroker_002 ] ERR  ToClient-009: insert error failure: network| wsd/ClientSession.cpp:2407

look here maybe related: Inserting image doesn't work : lok_allow not taking alias_group into account. · Issue #13727 · CollaboraOnline/online · GitHub

but on the other side

sounds like network issue. did you try other ways to insert the file? copy&paste and “cloud file”

Thanks for the pointer to Github, I’ll check this as well.

Copy&paste does not work either. Only upload a local file from my computer into the document works.

Ok, I’m about to give up.

On one instance it works. On another instance with the exactly identical configuration (/etc/coolwsd/coolwsd.xml is exactly the same, only the host names in the post allow list and alias groups are different) it does not work. And I triple checked everything.

The only thing which always works is uploading a local image. But inserting images from Nextcloud fails always on the “bad” instance, no matter what I do. And now there is even no error message any longer in Docker - it will just not work.

Finally solved it!

Besides the missing aliasgroup for the Nextcloud host (which can also be passed as parameter to docker run), the other issue was, that Docker on the “bad” instance has IPv6 enabled and there where WOPI requests coming in using the IPv6 global address of the Docker network. However this address was missing and therefore the request was denied.

So I added the global IPv6 address also to the WOPI allow list in the Nextcloud configuration as well and now it works as expected.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.