OTRS migration - Validation failed


Hi Zammad Community

Trying to migrate from an old OTRS to Zammad using the Zammad - rails console.

I am already grateful for any help or advice from the community to successfully complete the migration.

  • Used Zammad version: 5.1.1
  • Used OTRS version: 5.0.26
  • installed OTRS packages: FAQ, TimeAccounting
  • Used Zammad installation type: package (zammad_5.1.1-1651218076.e3861908.bullseye_amd64.deb)
  • Operating system: Debian 11.3.0
  • Browser + version: / via Zammad - rails console

Expected behavior:

  • That the OTRS migration will be completed successfully

Actual behavior:

  • After starting the migration the following error message is thrown after a short time: ActiveRecord::RecordInvalid (Validation failed: Data option must have integer for :maxlength)

The full zammad cli log (FQDN, Key and organization were replaced):

root@Hostname:# systemctl stop zammad
root@Hostname:# zammad run rails c
Loading production environment (Rails
irb(main):002:0> Delayed::Worker.max_run_time = 7.days
=> 7 days
irb(main):003:0> Setting.set('import_otrs_endpoint', 'https://internFQDN/otrs/public.pl?Action=ZammadMigrator')
Setting.reset_change_id: set new cache, baf53d76-569b-4c05-9a00-c9b517f79f0d
Setting.set('import_otrs_endpoint', "https://internFQDN/otrs/public.pl?Action=ZammadMigrator")
=> true
irb(main):004:0> Setting.set('import_otrs_endpoint_key', 'KEY')
Setting.reset_change_id: set new cache, 42498711-e6a4-4f40-9a60-8be0c647c676
Setting.set('import_otrs_endpoint_key', "KEY")
=> true
irb(main):005:0> Setting.set('import_mode', true)
Setting.reset_change_id: set new cache, e749bdd5-ef1a-4777-b9b1-35fc4023719e
Setting.set('import_mode', true)
=> true
irb(main):006:0> Import::OTRS.start
thread#-: Start import...
thread#-: POST: https://internFQDN/otrs/public.pl?Action=ZammadMigrator
thread#-: PARAMS: {:Action=>"ZammadMigrator", :Key=>"KEY"}
thread#-: loading SysConfig...
thread#-: POST: https://internFQDN/otrs/public.pl?Action=ZammadMigrator
thread#-: PARAMS: {:Subaction=>"Export", :Object=>"SysConfig", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>"KEY"}
Setting.reset_change_id: set new cache, e8f03c1c-4b3a-4380-ba07-0190fa1ab064
Setting.set('http_type', "https")
Setting.reset_change_id: set new cache, 91051987-75a8-44c7-a3c3-e662f6f6e985
Setting.set('organization', "company Name")
Setting.reset_change_id: set new cache, 300557a9-c641-4f41-992c-284222b6e6d4
Setting.set('system_id', "35")
Setting.reset_change_id: set new cache, 96e3f931-7d84-451e-abbd-f42f89405dd3
Setting.set('ticket_hook', "Ticket#")
Setting.reset_change_id: set new cache, 83549fa7-f2d5-4670-b391-01170e4c1757
Setting.set('ticket_number', "Ticket::Number::Date")
Setting.reset_change_id: set new cache, 77923c9b-3be8-4bda-959f-e94eb17516ad
Setting.set('ticket_number_date', {:checksum=>true})
thread#-: loading DynamicField...
thread#-: POST: https://internFQDN/otrs/public.pl?Action=ZammadMigrator
thread#-: PARAMS: {:Subaction=>"Export", :Object=>"DynamicField", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>"KEY"}
-- add_column("tickets", "pre_proc_application_recorded", :string, {:limit=>255, :null=>true})
   -> 0.0684s
-- add_column("tickets", "pre_proc_days_remaining", :string, {:limit=>255, :null=>true})
   -> 0.0028s
-- add_column("tickets", "pre_proc_vacation_start", :date, {:default=>nil, :null=>true})
   -> 0.0023s
-- add_column("tickets", "pre_proc_vacation_end", :date, {:default=>nil, :null=>true})
   -> 0.0021s
-- add_column("tickets", "pre_proc_days_used", :string, {:limit=>255, :null=>true})
   -> 0.0017s
-- add_column("tickets", "pre_proc_emergency_telephone", :string, {:limit=>255, :null=>true})
   -> 0.0016s
Traceback (most recent call last):
       14: from (irb):6
       13: from lib/import/otrs.rb:26:in `start'
       12: from lib/import/otrs.rb:144:in `base_objects'
       11: from lib/import/otrs.rb:58:in `import'
       10: from lib/import/otrs.rb:134:in `import_action'
        9: from lib/import/base_factory.rb:9:in `import_action'
        8: from lib/import/base_factory.rb:40:in `import_loop'
        7: from lib/import/base_factory.rb:40:in `each'
        6: from lib/import/base_factory.rb:12:in `block in import_action'
        5: from lib/import/base_factory.rb:36:in `create_instance'
        4: from lib/import/base_factory.rb:36:in `new'
        3: from lib/import/otrs/dynamic_field.rb:15:in `initialize'
        2: from lib/import/otrs/dynamic_field.rb:58:in `add'
        1: from app/models/object_manager/attribute.rb:395:in `add'
ActiveRecord::RecordInvalid (Validation failed: Data option must have integer for :maxlength)

After cross-reading the community topics is it possible, that custom dynamic fields in the OTRS instance could be causing this issue?

If needed i have extracted the following (log-)files, before restoring the original system states


  • production.log


  • mariadb.log
  • Apache error_log, access_log, ssl_*_log

HTTP POST - https://internFQDN/otrs/public.pl?Action=ZammadMigrator&Subaction=Export&Key=KEY&Object=DynamicField&Diff=0&Limit=&Offset=

  • public.pl.json

Unfortunately, I have no experience as far as Zammad is concerned and my knowledge of the OTRS instance at hand is also limited. Therefore i am grateful for any help and advice.

Have a look what field comes after pre_proc_emergency_telephone. Due to the error it’s not telling you the name so it’s kinda fishing in the dark. Can’t speak for OTRS - but Zammad is expecting field size limits which is why you receive above error.

I guess the easiest way to solve this is to either update the OTRS field to meet the requirements or drop it. Depending on your options and how the actual original field looks like.