Skip to content

[BUG] Getting attachment on Docker #415

Description

@Huggy56

Hi,

We have a problem when getting the contentString of attachments when using OIE on Docker.
More errors occurs when 2 or more channels do the same things.

we use this code :
var attachmentIdRegex = /${ATTACH:([0-9a-fA-F-]{36})}/;
var attachmentId = segment['OBX.5']['OBX.5.5'].toString();

attachmentId = attachmentId.match(attachmentIdRegex)[1];

var attachmentContent = AttachmentUtil.getMessageAttachment(connectorMessage, attachmentId).getContentString();

And the error :
TypeError: Cannot call method "getContentString" of null

But just, reprocess the message and it's sometimes ok, and if we have a lot of messages when the error occurs all the files after have the same issues.

We tried this on other mirth :
On windows with sqlserver => never happened
On linux with mariaDb => never happened

It's seems that the problem comes with Docker.

We also tried to solve this problem using a sleep before the getContentString and we have fewer errors

Source config of the channel:
Image

The attachment is not found after 10 attemps:
Image

Notes : We reproduce the same errors with Mirth 4.5.2 in the same configuration.

The config :

services:

mariadb_oie:
image: mariadb:10.11
container_name: mariadb_oie
restart: always

command:
  [
    '--server-id=1',
    '--max_connections=300',
    '--character-set-server=latin1',
    '--collation-server=latin1_swedish_ci',
    '--default-authentication-plugin=mysql_native_password',
    '--sql-mode=NO_ENGINE_SUBSTITUTION'
  ]

ports:
  - "3308:3306"

environment:
  MARIADB_ROOT_PASSWORD: root123
  MARIADB_DATABASE: oiedb
  MARIADB_USER: oie
  MARIADB_PASSWORD: oie123

volumes:
  - /data/oie/mysql:/var/lib/mysql

networks:
  - oie_net

oie:
image: openintegrationengine/engine:latest
container_name: oie

restart: always

depends_on:
  - mariadb_oie

ports:
  - "9444:8443"
  - "9081:8080"

environment:
  DATABASE: mysql
  DATABASE_URL: jdbc:mysql://mariadb_oie:3306/oiedb?useUnicode=false&characterEncoding=latin1&useSSL=false&allowPublicKeyRetrieval=true
  DATABASE_USERNAME: oie
  DATABASE_PASSWORD: oie123

  MIRTH_ADMIN_USERNAME: toto
  MIRTH_ADMIN_PASSWORD: toto

volumes:
  - /data/oie/appdata:/opt/connect/appdata

networks:
  - oie_net

networks:
oie_net:
driver: bridge

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions