OTRS 6 CE Migration: Validation failed: Name contains invalid path (ActiveRecord::RecordInvalid)

Infos:

  • Used Zammad version: 6.2.0-1703255094.f178071a.bookworm
  • Used Zammad installation type: package
  • Operating system: Debian 12
  • Browser + version: irrelevant

Expected behavior:

  • Migration should complete without errors

Actual behavior:

  • Migration terminates with Validation failed: Name contains invalid path (ActiveRecord::RecordInvalid)

Steps to reproduce the behavior:

  • We ran a migration (both from webui and cli) to import our OTRS 6 CE instance according to docs
  • In the early output, the migration stops issuing the given error.

Further details

I assume there is a invalid value at some place in our OTRS database, but as a non-rails-developer it’s hard to debug at this point.

Is there someone who can give me a hint?

Thanks in advance
Simon

Log output

I, [2023-12-26T14:30:39.237855#13686-142140]  INFO -- : thread#-: loading Priority...
I, [2023-12-26T14:30:39.237960#13686-142140]  INFO -- : thread#-: POST: https://hostname/otrs/public.pl?Action=ZammadMigrator
I, [2023-12-26T14:30:39.238027#13686-142140]  INFO -- : thread#-: PARAMS: {:Subaction=>"Export", :Object=>"Priority", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>"key"}
I, [2023-12-26T14:30:39.606234#13686-142140]  INFO -- : thread#-: update Ticket::Priority.find_by(id: 1)
I, [2023-12-26T14:30:39.621378#13686-142140]  INFO -- : thread#-: update Ticket::Priority.find_by(id: 2)
I, [2023-12-26T14:30:39.627506#13686-142140]  INFO -- : thread#-: update Ticket::Priority.find_by(id: 3)
I, [2023-12-26T14:30:39.632519#13686-142140]  INFO -- : thread#-: add Ticket::Priority.find_by(id: 4)
I, [2023-12-26T14:30:39.640114#13686-142140]  INFO -- : thread#-: add Ticket::Priority.find_by(id: 5)
I, [2023-12-26T14:30:39.650302#13686-142140]  INFO -- : thread#-: loading Queue...
I, [2023-12-26T14:30:39.650378#13686-142140]  INFO -- : thread#-: POST: https://hostname/otrs/public.pl?Action=ZammadMigrator
I, [2023-12-26T14:30:39.650421#13686-142140]  INFO -- : thread#-: PARAMS: {:Subaction=>"Export", :Object=>"Queue", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>"key"}
I, [2023-12-26T14:30:40.038626#13686-142140]  INFO -- : thread#-: update Group.find_by(id: 1)
I, [2023-12-26T14:30:40.079625#13686-142140]  INFO -- : thread#-: add Group.find_by(id: 10)
E, [2023-12-26T14:30:40.101174#13686-142140] ERROR -- : Validation failed: Name contains invalid path (ActiveRecord::RecordInvalid)
app/models/group.rb:53:in `guess_name_last_and_parent'
app/models/group.rb:68:in `ensure_name_last_and_parent'
lib/import/otrs/queue.rb:48:in `create'
lib/import/otrs/queue.rb:32:in `create_or_update'
lib/import/otrs/queue.rb:26:in `import'
lib/import/otrs/queue.rb:20:in `initialize'
lib/import/base_factory.rb:36:in `new'
lib/import/base_factory.rb:36:in `create_instance'
lib/import/base_factory.rb:12:in `block in import_action'
lib/import/base_factory.rb:40:in `each'
lib/import/base_factory.rb:40:in `import_loop'
lib/import/base_factory.rb:9:in `import_action'
lib/import/otrs.rb:134:in `import_action'
lib/import/otrs.rb:58:in `import'
lib/import/otrs.rb:150:in `updateable_objects'
lib/import/otrs.rb:28:in `start'
lib/import/otrs/async.rb:29:in `start_bg'
app/jobs/async_otrs_import_job.rb:5:in `perform'
lib/background_services/service/process_delayed_jobs.rb:25:in `block (2 levels) in launch'
lib/background_services/service/process_delayed_jobs.rb:23:in `block in launch'
lib/background_services/service/process_delayed_jobs.rb:20:in `loop'
lib/background_services/service/process_delayed_jobs.rb:20:in `launch'
lib/background_services/service.rb:27:in `block in run'
lib/application_handle_info.rb:19:in `use'
lib/background_services/service.rb:33:in `block in run_in_service_context'
lib/background_services/service.rb:32:in `run_in_service_context'
lib/background_services/service.rb:26:in `run'
lib/background_services.rb:67:in `block in start_as_thread'

Could be that with the new group hierarchy feature, the import has some problems, when the queues are not imported in the correct order (maybe a parent group is missing).
The current exception has no group name output, but are you using a hierarchy/tree inside your OTRS queues?

Yes, there is one nested group in our OTRS setup.

I digged into the details and enabled query logging.
I’ve seen that there are queries for group names of our OTRS groups which does not exist in the Postgres database at this point. None of our groups were migrated.

As a quickfix I created the groups in the WebUI and re-tried the import successfully.

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