Issue: Migrating OTRS 5.x to Zammad 2.9.0 #2019

Infos:

  • Use Zammad Version : zammad 2.9.0
  • Opertaing System : Ubuntu 16.04
  • OTRS Version : OTRS 5.0.10

Expected behavior:

Migration from OTRS 5.0.10 works as expected

Actual behavior:

When starting import I shortly got the message “undefined method `id’ for nil:NilClass”.
Tested again from cli and here is the full log:

I, [2019-05-20T22:13:15.448300 #943-47023391831600]  INFO -- : Started POST "/api/v1/import/otrs/url_check" for 127.0.0.1 at 2019-05-20 22:13:15 -0400
I, [2019-05-20T22:13:15.453975 #943-47023391831600]  INFO -- : Processing by ImportOtrsController#url_check as JSON
I, [2019-05-20T22:13:15.454083 #943-47023391831600]  INFO -- :   Parameters: {"url"=>"https://xxxxxxxxxx/otrs/public.pl?Action=ZammadMigrator;Key=UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
I, [2019-05-20T22:13:15.802727 #943-47023391831600]  INFO -- : Setting.set('import_backend', "otrs")
I, [2019-05-20T22:13:15.811046 #943-47023391831600]  INFO -- : Setting.set('import_otrs_endpoint', "https://xxxxxxxxxxx/otrs/public.pl?Action=ZammadMigrator")
I, [2019-05-20T22:13:15.817337 #943-47023391831600]  INFO -- : Setting.set('import_otrs_endpoint_key', "UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I")
I, [2019-05-20T22:13:15.820585 #943-47023391831600]  INFO -- : Completed 200 OK in 366ms (Views: 0.2ms | ActiveRecord: 8.2ms)
I, [2019-05-20T22:13:19.619606 #943-47023391830680]  INFO -- : Started POST "/api/v1/import/otrs/import_check" for 127.0.0.1 at 2019-05-20 22:13:19 -0400
I, [2019-05-20T22:13:19.623431 #943-47023391830680]  INFO -- : Processing by ImportOtrsController#import_check as JSON
I, [2019-05-20T22:13:19.623822 #943-47023391830680]  INFO -- : thread#-: POST: https://xxxxxxxxxx/otrs/public.pl?Action=ZammadMigrator
I, [2019-05-20T22:13:19.623903 #943-47023391830680]  INFO -- : thread#-: PARAMS: {:Subaction=>"List", :Action=>"ZammadMigrator", :Key=>"UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
I, [2019-05-20T22:13:20.146733 #943-47023391830680]  INFO -- : thread#-: POST: https://xxxxxxx/otrs/public.pl?Action=ZammadMigrator
I, [2019-05-20T22:13:20.146904 #943-47023391830680]  INFO -- : thread#-: PARAMS: {:Subaction=>"Export", :Object=>"DynamicField", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>"UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
I, [2019-05-20T22:13:20.491335 #943-47023391830680]  INFO -- : thread#-: POST: https://xxxxxxxx/otrs/public.pl?Action=ZammadMigrator
I, [2019-05-20T22:13:20.491507 #943-47023391830680]  INFO -- : thread#-: PARAMS: {:Subaction=>"Export", :Object=>"SysConfig", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>"UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
I, [2019-05-20T22:13:21.252241 #943-47023391830680]  INFO -- : Completed 200 OK in 1629ms (Views: 0.2ms | ActiveRecord: 0.4ms)
I, [2019-05-20T22:13:21.303686 #943-47023391829420]  INFO -- : Started POST "/api/v1/import/otrs/import_start" for 127.0.0.1 at 2019-05-20 22:13:21 -0400
I, [2019-05-20T22:13:21.306894 #943-47023391829420]  INFO -- : Processing by ImportOtrsController#import_start as JSON
I, [2019-05-20T22:13:21.313446 #943-47023391829420]  INFO -- : Setting.set('import_mode', true)
I, [2019-05-20T22:13:21.315201 #943-47023391829420]  INFO -- : thread#-: POST: https://xxxxxxxxxx/otrs/public.pl?Action=ZammadMigrator
I, [2019-05-20T22:13:21.315288 #943-47023391829420]  INFO -- : thread#-: PARAMS: {:Action=>"ZammadMigrator", :Key=>"UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
I, [2019-05-20T22:13:21.720784 #943-47023391829420]  INFO -- : Completed 200 OK in 414ms (Views: 0.2ms | ActiveRecord: 8.0ms)
I, [2019-05-20T22:13:22.655649 #1073-47434002225460]  INFO -- : 2019-05-20T22:13:22-0400: [Worker(host:zammad-server pid:1073)] Job Module#start_bg (id=21) RUNNING
I, [2019-05-20T22:13:22.775326 #1073-47434002225460]  INFO -- : thread#-: POST: https://xxxxxxxxxxx/otrs/public.pl?Action=ZammadMigrator
I, [2019-05-20T22:13:22.775420 #1073-47434002225460]  INFO -- : thread#-: PARAMS: {:Action=>"ZammadMigrator", :Key=>"UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
I, [2019-05-20T22:13:23.123534 #1073-47433990388180]  INFO -- : thread#-: POST: https://xxxxxxxxx/otrs/public.pl?Action=ZammadMigrator
I, [2019-05-20T22:13:23.123682 #1073-47433990388180]  INFO -- : thread#-: PARAMS: {:Subaction=>"List", :Action=>"ZammadMigrator", :Key=>"UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
I, [2019-05-20T22:13:23.775941 #943-47023391832460]  INFO -- : Started GET "/api/v1/import/otrs/import_status?_=1558404483425" for 127.0.0.1 at 2019-05-20 22:13:23 -0400
I, [2019-05-20T22:13:23.779568 #943-47023391832460]  INFO -- : Processing by ImportOtrsController#import_status as JSON
I, [2019-05-20T22:13:23.779654 #943-47023391832460]  INFO -- :   Parameters: {"_"=>"1558404483425"}
I, [2019-05-20T22:13:23.780403 #943-47023391832460]  INFO -- : Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
I, [2019-05-20T22:13:25.112308 #1073-47434002225460]  INFO -- : thread#-: Start import...
I, [2019-05-20T22:13:25.112712 #1073-47434002225460]  INFO -- : thread#-: POST: https://xxxxxxxxxxx/otrs/public.pl?Action=ZammadMigrator
I, [2019-05-20T22:13:25.112796 #1073-47434002225460]  INFO -- : thread#-: PARAMS: {:Action=>"ZammadMigrator", :Key=>"UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
I, [2019-05-20T22:13:25.526818 #1073-47434002225460]  INFO -- : thread#-: loading SysConfig...
I, [2019-05-20T22:13:25.526989 #1073-47434002225460]  INFO -- : thread#-: POST: https://xxxxxxxxxxx/otrs/public.pl?Action=ZammadMigrator
I, [2019-05-20T22:13:25.527061 #1073-47434002225460]  INFO -- : thread#-: PARAMS: {:Subaction=>"Export", :Object=>"SysConfig", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>"UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
I, [2019-05-20T22:13:26.445083 #1073-47434002225460]  INFO -- : Setting.set('http_type', "https")
I, [2019-05-20T22:13:26.451977 #1073-47434002225460]  INFO -- : Setting.set('organization', "Universitas Islam Indonesia")
I, [2019-05-20T22:13:26.462153 #1073-47434002225460]  INFO -- : Setting.set('system_id', "00")
I, [2019-05-20T22:13:26.466363 #1073-47434002225460]  INFO -- : Setting.set('ticket_hook', "Ticket#")
I, [2019-05-20T22:13:26.473581 #1073-47434002225460]  INFO -- : Setting.set('ticket_number', "Ticket::Number::Date")
I, [2019-05-20T22:13:26.481264 #1073-47434002225460]  INFO -- : Setting.set('ticket_number_date', {:checksum=>true})
I, [2019-05-20T22:13:26.481486 #1073-47434002225460]  INFO -- : thread#-: loading DynamicField...
I, [2019-05-20T22:13:26.483652 #1073-47434002225460]  INFO -- : thread#-: POST: https://xxxxxxxxxx/otrs/public.pl?Action=ZammadMigrator
I, [2019-05-20T22:13:26.483738 #1073-47434002225460]  INFO -- : thread#-: PARAMS: {:Subaction=>"Export", :Object=>"DynamicField", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>"UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
I, [2019-05-20T22:13:27.076274 #1073-47434002225460]  INFO -- : thread#-: loading State...
I, [2019-05-20T22:13:27.076467 #1073-47434002225460]  INFO -- : thread#-: POST: https://xxxxxxxxxx/otrs/public.pl?Action=ZammadMigrator
I, [2019-05-20T22:13:27.076555 #1073-47434002225460]  INFO -- : thread#-: PARAMS: {:Subaction=>"Export", :Object=>"State", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>"UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
I, [2019-05-20T22:13:27.405933 #1073-47434002225460]  INFO -- : thread#-: update Ticket::State.find_by(id: 1)
E, [2019-05-20T22:13:27.409548 #1073-47434002225460] ERROR -- : undefined method `id' for nil:NilClass (NoMethodError)
/opt/zammad/lib/import/otrs/state.rb:63:in `state_type_id'
/opt/zammad/lib/import/otrs/state.rb:56:in `map'
/opt/zammad/lib/import/otrs/state.rb:25:in `import'
/opt/zammad/lib/import/otrs/state.rb:19:in `initialize'
/opt/zammad/lib/import/base_factory.rb:34:in `new'
/opt/zammad/lib/import/base_factory.rb:34:in `create_instance'
/opt/zammad/lib/import/base_factory.rb:10:in `block in import_action'
/opt/zammad/lib/import/base_factory.rb:38:in `each'
/opt/zammad/lib/import/base_factory.rb:38:in `import_loop'
/opt/zammad/lib/import/otrs/state_factory.rb:22:in `import_loop'
/opt/zammad/lib/import/base_factory.rb:7:in `import_action'
/opt/zammad/lib/import/transaction_factory.rb:10:in `block in import'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `block in transaction'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/transaction.rb:194:in `block in within_new_transaction'
/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/transaction.rb:191:in `within_new_transaction'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `transaction'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.6.2/lib/active_record/transactions.rb:210:in `transaction'
/opt/zammad/lib/import/transaction_factory.rb:9:in `import'
/opt/zammad/lib/import/otrs.rb:146:in `import_action'
/opt/zammad/lib/import/otrs.rb:71:in `import'
/opt/zammad/lib/import/otrs.rb:160:in `updateable_objects'
/opt/zammad/lib/import/otrs.rb:41:in `start'
/opt/zammad/lib/import/otrs/async.rb:27:in `start_bg'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/performable_method.rb:26:in `perform'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/backend/base.rb:81:in `block in invoke_job'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/lifecycle.rb:61:in `block in initialize'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/lifecycle.rb:66:in `execute'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/backend/base.rb:78:in `invoke_job'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:230:in `block (2 levels) in run'
/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/timeout.rb:93:in `block in timeout'
/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/timeout.rb:103:in `timeout'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:230:in `block in run'
/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:229:in `run'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:312:in `block in reserve_and_run_one_job'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/lifecycle.rb:61:in `block in initialize'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/lifecycle.rb:66:in `execute'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:312:in `reserve_and_run_one_job'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:213:in `block in work_off'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:212:in `times'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:212:in `work_off'
/opt/zammad/app/models/scheduler.rb:367:in `block (3 levels) in worker'
/opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
/opt/zammad/app/models/scheduler.rb:365:in `block (2 levels) in worker'
/opt/zammad/app/models/scheduler.rb:361:in `loop'
/opt/zammad/app/models/scheduler.rb:361:in `block in worker'
/opt/zammad/vendor/bundle/ruby/2.4.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
I, [2019-05-20T22:13:27.412081 #1073-47434002225460]  INFO -- : 2019-05-20T22:13:27-0400: [Worker(host:zammad-server pid:1073)] Job Module#start_bg (id=21) COMPLETED after 4.7563
![image|412x500](upload://RzrQE8tJDQPdHe3oZItuMQQr8X.png) 

From Command Line :

irb(main):005:0> Import::OTRS.start
thread#-: Start import...
thread#-: POST: https://xxxxxxxxx/otrs/public.pl?Action=ZammadMigrator
thread#-: PARAMS: {:Action=>"ZammadMigrator", :Key=>"UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
thread#-: loading SysConfig...
thread#-: POST: https://xxxxxxxxx/otrs/public.pl?Action=ZammadMigrator
thread#-: PARAMS: {:Subaction=>"Export", :Object=>"SysConfig", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>"UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
Setting.reset_change_id: set new cache, 115689666
Setting.set('http_type', "https")
Setting.reset_change_id: set new cache, 779206915
Setting.set('organization', "xxxxxxxxxxxxxx")
Setting.reset_change_id: set new cache, 670984121
Setting.set('system_id', "00")
Setting.reset_change_id: set new cache, 807181797
Setting.set('ticket_hook', "Ticket#")
Setting.reset_change_id: set new cache, 16260864
Setting.set('ticket_number', "Ticket::Number::Date")
Setting.reset_change_id: set new cache, 828754695
Setting.set('ticket_number_date', {:checksum=>true})
thread#-: loading DynamicField...
thread#-: POST: https://xxxxx/otrs/public.pl?Action=ZammadMigrator
thread#-: PARAMS: {:Subaction=>"Export", :Object=>"DynamicField", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>"UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
thread#-: loading State...
thread#-: POST: https://xxxxx/otrs/public.pl?Action=ZammadMigrator
thread#-: PARAMS: {:Subaction=>"Export", :Object=>"State", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>"UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
thread#-: update Ticket::State.find_by(id: 1)
NoMethodError: undefined method `id' for nil:NilClass from lib/import/otrs/state.rb:63:in ` state_type_id'
from lib/import/otrs/state.rb:56:in `map' from lib/import/otrs/state.rb:25:in ` import'
from lib/import/otrs/state.rb:19:in `initialize' from lib/import/base_factory.rb:34:in ` new'
from lib/import/base_factory.rb:34:in `create_instance' from lib/import/base_factory.rb:10:in ` block in import_action'
from lib/import/base_factory.rb:38:in `each' from lib/import/base_factory.rb:38:in ` import_loop'
from lib/import/otrs/state_factory.rb:22:in `import_loop' from lib/import/base_factory.rb:7:in ` import_action'
from lib/import/transaction_factory.rb:10:in `block in import' from lib/import/transaction_factory.rb:9:in ` import'
from lib/import/otrs.rb:146:in `import_action' from lib/import/otrs.rb:71:in ` import'
from lib/import/otrs.rb:160:in `updateable_objects' from lib/import/otrs.rb:41:in ` start'
from (irb):5

@thorsteneckel can you help me to fix this issue?

Hi @imam32 -please post the result of opening the following URL in your browser:

https://xxxxx/otrs/public.pl?Action=ZammadMigrator;Key= UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I;Object=State;Subaction=Export

this the result from browser :

then this is from production.log :

> I, [2019-05-29T03:53:21.593407 #1030-47007336641420]  INFO -- : Started POST "/api/v1/import/otrs/import_check" for 127.0.0.1 at 2019-05-29 03:53:21 -0400
> I, [2019-05-29T03:53:21.596832 #1030-47007336641420]  INFO -- : Processing by ImportOtrsController#import_check as JSON
> I, [2019-05-29T03:53:21.597176 #1030-47007336641420]  INFO -- : thread#-: POST: https://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator
> I, [2019-05-29T03:53:21.597244 #1030-47007336641420]  INFO -- : thread#-: PARAMS: {:Subaction=>"List", :Action=>"ZammadMigrator", :Key=>" UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
> I, [2019-05-29T03:53:22.146503 #1030-47007336641420]  INFO -- : thread#-: POST: https://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator
> I, [2019-05-29T03:53:22.146615 #1030-47007336641420]  INFO -- : thread#-: PARAMS: {:Subaction=>"Export", :Object=>"DynamicField", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>" UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
> I, [2019-05-29T03:53:22.454573 #1030-47007336641420]  INFO -- : thread#-: POST: https://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator
> I, [2019-05-29T03:53:22.454697 #1030-47007336641420]  INFO -- : thread#-: PARAMS: {:Subaction=>"Export", :Object=>"SysConfig", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>" UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
> I, [2019-05-29T03:53:23.032430 #1030-47007336641420]  INFO -- : Completed 200 OK in 1435ms (Views: 0.2ms | ActiveRecord: 0.5ms)
> I, [2019-05-29T03:53:23.087680 #1030-47007336640480]  INFO -- : Started POST "/api/v1/import/otrs/import_start" for 127.0.0.1 at 2019-05-29 03:53:23 -0400
> I, [2019-05-29T03:53:23.093639 #1030-47007336640480]  INFO -- : Processing by ImportOtrsController#import_start as JSON
> I, [2019-05-29T03:53:23.103216 #1030-47007336640480]  INFO -- : Setting.set('import_mode', true)
> I, [2019-05-29T03:53:23.105446 #1030-47007336640480]  INFO -- : thread#-: POST: https://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator
> I, [2019-05-29T03:53:23.105508 #1030-47007336640480]  INFO -- : thread#-: PARAMS: {:Action=>"ZammadMigrator", :Key=>" UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
> I, [2019-05-29T03:53:23.491384 #1030-47007336640480]  INFO -- : Completed 200 OK in 398ms (Views: 0.2ms | ActiveRecord: 8.0ms)
> I, [2019-05-29T03:53:25.595519 #1030-47007336751260]  INFO -- : Started GET "/api/v1/import/otrs/import_status?_=1559116241317" for 127.0.0.1 at 2019-05-29 03:53:25 -0400
> I, [2019-05-29T03:53:25.599012 #1030-47007336751260]  INFO -- : Processing by ImportOtrsController#import_status as JSON
> I, [2019-05-29T03:53:25.599096 #1030-47007336751260]  INFO -- :   Parameters: {"_"=>"1559116241317"}
> I, [2019-05-29T03:53:25.599670 #1030-47007336751260]  INFO -- : Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
> I, [2019-05-29T03:53:27.197889 #1015-47176148954980]  INFO -- : 2019-05-29T03:53:27-0400: [Worker(host:zammad-server pid:1015)] Job Module#start_bg (id=21) RUNNING
> I, [2019-05-29T03:53:27.323925 #1015-47176148954980]  INFO -- : thread#-: POST: https://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator
> I, [2019-05-29T03:53:27.324084 #1015-47176148954980]  INFO -- : thread#-: PARAMS: {:Action=>"ZammadMigrator", :Key=>" UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
> I, [2019-05-29T03:53:27.609420 #1015-69827985124160]  INFO -- : thread#-: POST: https://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator
> I, [2019-05-29T03:53:27.609511 #1015-69827985124160]  INFO -- : thread#-: PARAMS: {:Subaction=>"List", :Action=>"ZammadMigrator", :Key=>" UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
> I, [2019-05-29T03:53:29.604308 #1015-47176148954980]  INFO -- : thread#-: Start import...
> I, [2019-05-29T03:53:29.604550 #1015-47176148954980]  INFO -- : thread#-: POST: https://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator
> I, [2019-05-29T03:53:29.604604 #1015-47176148954980]  INFO -- : thread#-: PARAMS: {:Action=>"ZammadMigrator", :Key=>" UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
> I, [2019-05-29T03:53:29.915861 #1015-47176148954980]  INFO -- : thread#-: loading SysConfig...
> I, [2019-05-29T03:53:29.916009 #1015-47176148954980]  INFO -- : thread#-: POST: https://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator
> I, [2019-05-29T03:53:29.916071 #1015-47176148954980]  INFO -- : thread#-: PARAMS: {:Subaction=>"Export", :Object=>"SysConfig", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>" UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
> I, [2019-05-29T03:53:30.466476 #1015-47176148954980]  INFO -- : Setting.set('http_type', "https")
> I, [2019-05-29T03:53:30.472922 #1015-47176148954980]  INFO -- : Setting.set('organization', "Universitas Islam Indonesia")
> I, [2019-05-29T03:53:30.482339 #1015-47176148954980]  INFO -- : Setting.set('system_id', "00")
> I, [2019-05-29T03:53:30.486188 #1015-47176148954980]  INFO -- : Setting.set('ticket_hook', "Ticket#")
> I, [2019-05-29T03:53:30.492612 #1015-47176148954980]  INFO -- : Setting.set('ticket_number', "Ticket::Number::Date")
> I, [2019-05-29T03:53:30.506999 #1015-47176148954980]  INFO -- : Setting.set('ticket_number_date', {:checksum=>true})
> I, [2019-05-29T03:53:30.507211 #1015-47176148954980]  INFO -- : thread#-: loading DynamicField...
> I, [2019-05-29T03:53:30.509113 #1015-47176148954980]  INFO -- : thread#-: POST: https://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator
> I, [2019-05-29T03:53:30.509175 #1015-47176148954980]  INFO -- : thread#-: PARAMS: {:Subaction=>"Export", :Object=>"DynamicField", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>" UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
> I, [2019-05-29T03:53:30.940532 #1015-47176148954980]  INFO -- : thread#-: loading State...
> I, [2019-05-29T03:53:30.940659 #1015-47176148954980]  INFO -- : thread#-: POST: https://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator
> I, [2019-05-29T03:53:30.940715 #1015-47176148954980]  INFO -- : thread#-: PARAMS: {:Subaction=>"Export", :Object=>"State", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>" UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
> I, [2019-05-29T03:53:31.253038 #1015-47176148954980]  INFO -- : thread#-: update Ticket::State.find_by(id: 1)
> E, [2019-05-29T03:53:31.256451 #1015-47176148954980] ERROR -- : undefined method `id' for nil:NilClass (NoMethodError)
> /opt/zammad/lib/import/otrs/state.rb:63:in `state_type_id'
> /opt/zammad/lib/import/otrs/state.rb:56:in `map'
> /opt/zammad/lib/import/otrs/state.rb:25:in `import'
> /opt/zammad/lib/import/otrs/state.rb:19:in `initialize'
> /opt/zammad/lib/import/base_factory.rb:34:in `new'
> /opt/zammad/lib/import/base_factory.rb:34:in `create_instance'
> /opt/zammad/lib/import/base_factory.rb:10:in `block in import_action'
> /opt/zammad/lib/import/base_factory.rb:38:in `each'
> /opt/zammad/lib/import/base_factory.rb:38:in `import_loop'
> /opt/zammad/lib/import/otrs/state_factory.rb:22:in `import_loop'
> /opt/zammad/lib/import/base_factory.rb:7:in `import_action'
> /opt/zammad/lib/import/transaction_factory.rb:10:in `block in import'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `block in transaction'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/transaction.rb:194:in `block in within_new_transaction'
> /opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/transaction.rb:191:in `within_new_transaction'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.6.2/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `transaction'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.6.2/lib/active_record/transactions.rb:210:in `transaction'
> /opt/zammad/lib/import/transaction_factory.rb:9:in `import'
> /opt/zammad/lib/import/otrs.rb:146:in `import_action'
> /opt/zammad/lib/import/otrs.rb:71:in `import'
> /opt/zammad/lib/import/otrs.rb:160:in `updateable_objects'
> /opt/zammad/lib/import/otrs.rb:41:in `start'
> /opt/zammad/lib/import/otrs/async.rb:27:in `start_bg'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/performable_method.rb:26:in `perform'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/backend/base.rb:81:in `block in invoke_job'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/lifecycle.rb:61:in `block in initialize'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/lifecycle.rb:66:in `execute'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/lifecycle.rb:40:in `run_callbacks'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/backend/base.rb:78:in `invoke_job'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:230:in `block (2 levels) in run'
> /opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/timeout.rb:93:in `block in timeout'
> /opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/timeout.rb:103:in `timeout'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:230:in `block in run'
> /opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:229:in `run'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:312:in `block in reserve_and_run_one_job'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/lifecycle.rb:61:in `block in initialize'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/lifecycle.rb:66:in `execute'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/lifecycle.rb:40:in `run_callbacks'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:312:in `reserve_and_run_one_job'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:213:in `block in work_off'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:212:in `times'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/delayed_job-4.1.3/lib/delayed/worker.rb:212:in `work_off'
> /opt/zammad/app/models/scheduler.rb:367:in `block (3 levels) in worker'
> /opt/zammad/vendor/ruby-2.4.4/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
> /opt/zammad/app/models/scheduler.rb:365:in `block (2 levels) in worker'
> /opt/zammad/app/models/scheduler.rb:361:in `loop'
> /opt/zammad/app/models/scheduler.rb:361:in `block in worker'
> /opt/zammad/vendor/bundle/ruby/2.4.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
> I, [2019-05-29T03:53:31.259046 #1015-47176148954980]  INFO -- : 2019-05-29T03:53:31-0400: [Worker(host:zammad-server pid:1015)] Job Module#start_bg (id=21) COMPLETED after 4.0610
> I, [2019-05-29T03:53:32.150991 #1030-47007336644120]  INFO -- : Started GET "/api/v1/import/otrs/import_status?_=1559116241318" for 127.0.0.1 at 2019-05-29 03:53:32 -0400
> I, [2019-05-29T03:53:32.154387 #1030-47007336644120]  INFO -- : Processing by ImportOtrsController#import_status as JSON
> I, [2019-05-29T03:53:32.154447 #1030-47007336644120]  INFO -- :   Parameters: {"_"=>"1559116241318"}
> I, [2019-05-29T03:53:32.155071 #1030-47007336644120]  INFO -- : Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.0ms)
> I, [2019-05-29T03:53:38.676771 #1030-47007336642380]  INFO -- : Started GET "/api/v1/import/otrs/import_status?_=1559116241319" for 127.0.0.1 at 2019-05-29 03:53:38 -0400
> I, [2019-05-29T03:53:38.682702 #1030-47007336642380]  INFO -- : Processing by ImportOtrsController#import_status as JSON
> I, [2019-05-29T03:53:38.682783 #1030-47007336642380]  INFO -- :   Parameters: {"_"=>"1559116241319"}
> I, [2019-05-29T03:53:38.683341 #1030-47007336642380]  INFO -- : Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
> I, [2019-05-29T03:53:39.142748 #1015-47176095002460]  INFO -- : Scheduler running...
> I, [2019-05-29T03:53:39.148386 #1015-47176095002460]  INFO -- : Running job thread for 'Generate Session data' (Sessions.jobs) status is: sleep
> I, [2019-05-29T03:53:39.148449 #1015-47176095002460]  INFO -- : Running job thread for 'Import OTRS diff load' (Import::OTRS.diff_worker) status is: sleep
> I, [2019-05-29T03:53:39.148491 #1015-47176095002460]  INFO -- : Running job thread for 'Process escalation tickets' (Ticket.process_escalation) status is: sleep
> I, [2019-05-29T03:53:39.148532 #1015-47176095002460]  INFO -- : Running job thread for 'Check Channels' (Channel.fetch) status is: sleep
> I, [2019-05-29T03:53:39.148854 #1015-47176095002460]  INFO -- : Running job thread for 'Check streams for Channel' (Channel.stream) status is: sleep
> I, [2019-05-29T03:53:39.149346 #1015-47176095002460]  INFO -- : Running job thread for 'Execute jobs' (Job.run) status is: sleep
> I, [2019-05-29T03:53:39.171241 #1015-69828081870240]  INFO -- : execute Import::OTRS.diff_worker (try_count 0)...
> I, [2019-05-29T03:53:39.171389 #1015-69828081870240]  INFO -- : thread#-: Start diff...
> I, [2019-05-29T03:53:39.171452 #1015-69828081870240]  INFO -- : thread#-: loading State...
> I, [2019-05-29T03:53:39.171546 #1015-69828081870240]  INFO -- : thread#-: POST: https://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator
> I, [2019-05-29T03:53:39.171594 #1015-69828081870240]  INFO -- : thread#-: PARAMS: {:Subaction=>"Export", :Object=>"State", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>" UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
> I, [2019-05-29T03:53:39.504908 #1015-69828081870240]  INFO -- : thread#-: update Ticket::State.find_by(id: 1)
> E, [2019-05-29T03:53:39.510594 #1015-69828081870240] ERROR -- : execute Import::OTRS.diff_worker (try_count 0) exited with error #<NoMethodError: undefined method `id' for nil:NilClass>
> I, [2019-05-29T03:53:40.521178 #1015-69828081870240]  INFO -- : execute Import::OTRS.diff_worker (try_count 1)...
> I, [2019-05-29T03:53:40.521337 #1015-69828081870240]  INFO -- : thread#-: Start diff...
> I, [2019-05-29T03:53:40.521428 #1015-69828081870240]  INFO -- : thread#-: loading State...
> I, [2019-05-29T03:53:40.521516 #1015-69828081870240]  INFO -- : thread#-: POST: https://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator
> I, [2019-05-29T03:53:40.521579 #1015-69828081870240]  INFO -- : thread#-: PARAMS: {:Subaction=>"Export", :Object=>"State", :Limit=>"", :Offset=>"", :Diff=>0, :Action=>"ZammadMigrator", :Key=>" UvGREanTczAdBsX2E3ZSlrTAnukyTMeCpN8YdM7I"}
> I, [2019-05-29T03:53:40.753596 #1015-69828081870240]  INFO -- : thread#-: update Ticket::State.find_by(id: 1)
> E, [2019-05-29T03:53:40.758794 #1015-69828081870240] ERROR -- : execute Import::OTRS.diff_worker (try_count 1) exited with error #<NoMethodError: undefined method `id' for nil:NilClass>

Please use the URL of the OTRS I provided in the comment above. The screenshot and logs you provided are from the Zammad system. I need the original data exported from OTRS.

sorry sir, my url that im send earlier was wrong, i mean that xxxx is my private website

Please run the quoted URL below and replace xxxxx with your correct hostname

this is the correct hostname sir, im so sorry for given u wrong url

http://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator;Key=REDACTED;Subaction=Export;Object=State

Hi @imam32 - I can see from the result of the API endpoint that you have a custom state type:

{

    "ChangeTime": "2016-04-21 15:52:54",
    "ID": "10",
    "ValidID": "1",
    "TypeID": "8",
    "CreateTime": "2016-04-21 15:52:54",
    "TypeName": "ready close",
    "Comment": "own state type Ready to Close",
    "Name": "ready to close"

},

In a regular OTRS there is no StateType called ready close. The import doesn’t know how to handle that and will fail.
You have to remove this State and StateType and migrate all Tickets to a different State. After that you can import your data correctly.

so, i must config the otrs or the zammad?

You have to remove this State and StateType and migrate all Tickets to a different State. After that you can import your data correctly.

Sorry, OTRS of course.

thank you sir, i will post the result after i re-config the OTRS

1 Like

http://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator;Key= REDACTED ;Subaction=Export;Object=State

sorry sir, i was wrong again, it was actually https so the correct is :
https://help.uii.ac.id/otrs/public.pl?Action=ZammadMigrator;Key=REDACTED;Subaction=Export;Object=State

i’ve already follow your instruction and the result from browser like this :


and from the Command Line :

but i can login with the user from otrs

After that i try to make integration with LDAP/AD and in the middle of creating user show message like this :

What’s in your logs?

im sorry sir, its mt mistake because the LDAP server is not working
now i’m still wait for creating user from LDAP, my bad sir