Skip to content

db_ddl.sql is missing sent_file_name column — breaks DbTrackingModule when schema is created manually #537

@ricardopsj

Description

@ricardopsj

Environment

  • OpenAS2 v4.8.2 (built from source — no binary published in this release)
  • Java 21 (OpenJDK)
  • H2 embedded (file mode), tcp_server_start="false"
  • Debian 13

Issue

config/db_ddl.sql (used to bootstrap the H2 tracking schema) does not include the
SENT_FILE_NAME column that is present in the authoritative DDL Utils schema at
resources/db/openas2-schema.xml.

When DbTrackingModule tries to insert a tracking record after a successful outbound,
it fails because the column is missing in the actual table.

Reproduction

  1. Configure DbTrackingModule with tcp_server_start="false" and embedded H2.
  2. Initialize the schema using db_ddl.sql via org.h2.tools.RunScript
    (since create_db_table.sh requires ant + TCP 9092, both unavailable in a
    typical hardened deployment).
  3. Send any outbound message.
  4. DbTrackingModule logs an error trying to write sent_file_name.

Workaround

Add the missing column manually to db_ddl.sql before running it:
ALTER TABLE msg_metadata ADD COLUMN sent_file_name VARCHAR(255);
(or include it in the original CREATE TABLE statement, aligning with
resources/db/openas2-schema.xml).

Suggested fix

Regenerate config/db_ddl.sql from resources/db/openas2-schema.xml so the two
stay in sync; or remove db_ddl.sql from the distro and document the schema
bootstrap to use openas2-schema.xml directly through DDL Utils.

Side note

openas2-schema.xml cannot be used directly with org.h2.tools.RunScript
because it's DDL Utils XML, not plain SQL — users without ant end up using
db_ddl.sql, which is why the missing column matters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions