Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freshdesk-Migration does not like no Companies / Organisations within the source #4051

Closed
MrGeneration opened this issue Apr 8, 2022 · 0 comments
Assignees
Milestone

Comments

@MrGeneration
Copy link
Member

MrGeneration commented Apr 8, 2022

Infos:

  • Used Zammad version: stable 5.1 as of 4pm UTC, 8th April
  • Installation method (source, package, ..): any
  • Operating system: any
  • Database + version: any
  • Elasticsearch version: any
  • Browser + version: any
  • Ticket: #10103590
  • Note: As this is our sequencer involved, it might also affect other sequencer based Migrators.

Expected behavior:

If the migration source does not have any Organisations ("Company" for freshdesk) configured, Zammad will quietly skip the synchronization and finish successfully.

Actual behavior:

If you do not have any Companies configured within Freshdesk, Zammad will die during Contact import as it tries to reference non existing organizations.

E, [2022-04-08T18:13:01.181090 #22474-191100] ERROR -- : ImportJob 'Import::Freshdesk' failed: undefined method `[]' for nil:NilClass
E, [2022-04-08T18:13:01.181210 #22474-191100] ERROR -- : undefined method `[]' for nil:NilClass (NoMethodError)
lib/sequencer/unit/import/freshdesk/contact/mapping.rb:32:in `organization_id'
lib/sequencer/unit/import/freshdesk/contact/mapping.rb:18:in `block in process'
lib/sequencer/unit/import/common/mapping/mixin/provide_mapped.rb:28:in `block in provide_mapped'
lib/sequencer/state.rb:44:in `provide'
lib/sequencer/unit/import/common/mapping/mixin/provide_mapped.rb:27:in `provide_mapped'
lib/sequencer/unit/import/freshdesk/contact/mapping.rb:14:in `process'
lib/sequencer/unit/base.rb:249:in `process'
lib/sequencer.rb:76:in `block (4 levels) in process'
lib/mixin/start_finish_logger.rb:9:in `log_start_finish'
lib/sequencer.rb:75:in `block (3 levels) in process'
lib/sequencer/state.rb:152:in `process'
lib/sequencer.rb:73:in `block (2 levels) in process'
lib/sequencer/units.rb:28:in `block in each'
lib/sequencer/units.rb:27:in `each'
lib/sequencer/units.rb:27:in `each'
lib/sequencer.rb:71:in `each_with_index'
lib/sequencer.rb:71:in `block in process'
lib/mixin/start_finish_logger.rb:9:in `log_start_finish'
lib/sequencer.rb:69:in `process'
lib/sequencer.rb:24:in `process'
lib/sequencer/unit/import/freshdesk/perform.rb:16:in `block in process'
lib/sequencer/unit/import/freshdesk/perform.rb:15:in `each'
lib/sequencer/unit/import/freshdesk/perform.rb:15:in `process'
lib/sequencer/unit/import/common/model/mixin/skip/action.rb:49:in `process'
lib/sequencer/unit/base.rb:249:in `process'
lib/sequencer.rb:76:in `block (4 levels) in process'
lib/mixin/start_finish_logger.rb:9:in `log_start_finish'
lib/sequencer.rb:75:in `block (3 levels) in process'
lib/sequencer/state.rb:152:in `process'
lib/sequencer.rb:73:in `block (2 levels) in process'
lib/sequencer/units.rb:28:in `block in each'
lib/sequencer/units.rb:27:in `each'
lib/sequencer/units.rb:27:in `each'
lib/sequencer.rb:71:in `each_with_index'
lib/sequencer.rb:71:in `block in process'
lib/mixin/start_finish_logger.rb:9:in `log_start_finish'
lib/sequencer.rb:69:in `process'
lib/sequencer.rb:24:in `process'
lib/sequencer/unit/import/freshdesk/sub_sequence/generic.rb:19:in `block in process'
lib/sequencer/unit/import/freshdesk/sub_sequence/generic.rb:17:in `loop'
lib/sequencer/unit/import/freshdesk/sub_sequence/generic.rb:17:in `each_with_index'
lib/sequencer/unit/import/freshdesk/sub_sequence/generic.rb:17:in `process'
lib/sequencer/unit/base.rb:249:in `process'
lib/sequencer.rb:76:in `block (4 levels) in process'
lib/mixin/start_finish_logger.rb:9:in `log_start_finish'
lib/sequencer.rb:75:in `block (3 levels) in process'
lib/sequencer/state.rb:152:in `process'
lib/sequencer.rb:73:in `block (2 levels) in process'
lib/sequencer/units.rb:28:in `block in each'
lib/sequencer/units.rb:27:in `each'
lib/sequencer/units.rb:27:in `each'
lib/sequencer.rb:71:in `each_with_index'
lib/sequencer.rb:71:in `block in process'
lib/mixin/start_finish_logger.rb:9:in `log_start_finish'
lib/sequencer.rb:69:in `process'
lib/sequencer.rb:24:in `process'
lib/import/mixin/sequence.rb:17:in `process'
lib/import/freshdesk.rb:8:in `start'
app/models/import_job.rb:24:in `start'
app/models/import_job.rb:105:in `start'
app/models/import_job.rb:95:in `start_registered'
(eval):1:in `_start_job'
app/models/scheduler.rb:291:in `eval'
app/models/scheduler.rb:291:in `_start_job'
app/models/scheduler.rb:262:in `block in start_job'
I, [2022-04-08T18:13:01.186359 #22474-191100]  INFO -- : ended ImportJob.start_registered took: 4.426772218 seconds.
E, [2022-04-08T18:13:01.592937 #22474-187000] ERROR -- : ImportJob 'Import::Freshdesk' failed: undefined method `[]' for nil:NilClass

A dirty workaround is to remove the following line, the migration then continues.
https://github.com/zammad/zammad/blob/develop/lib/sequencer/unit/import/freshdesk/contact/mapping.rb#L18

Steps to reproduce the behavior:

  • Have a freshdesk instance without a company configured
  • try to migrate fromf reshdesk to Zammad

Yes I'm sure this is a bug and no feature request or a general question.

@dominikklein dominikklein self-assigned this Apr 9, 2022
@dominikklein dominikklein added this to the 5.1.1 milestone Apr 11, 2022
zammad-sync pushed a commit that referenced this issue Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants