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