Hello guys,
I am trying to deploy the self-hosted version of Zammad in our organization.
So far what I’ve done:
- Create a EC2 Instance on AWS - Ubuntu 20.04 LTS
- Download Zammad 3.5.0 binary and install using bundler etc.
- Download Elasticsearch 6.8.13 and install it, connect Zammad to it
- Connect to our RDS PostgreSQL instance
- Connect to our G-Suite so members of the organization will use it to login
The monitoring if Zammad shows the following:
{
"actions": [],
"healthy": false,
"issues": [
"Failed to run background job #1 'SearchIndexJob' 10 time(s) with 169 attempt(s)."
],
"message": "Failed to run background job #1 'SearchIndexJob' 10 time(s) with 169 attempt(s).",
"token": "MY_TOKEN"
}
production.log:
RUNNING
I, [2020-10-27T09:00:09.466241 #9445-47348311935480] INFO -- : Performing SearchIndexJob (Job ID: b63e3d04-36cc-4912-ab30-9c14496f9ada) from DelayedJob(default) with arguments: "StatsStore", 1
I, [2020-10-27T09:00:09.484391 #9445-47348311935480] INFO -- : # curl -X post "http://localhost:9200/zammad_production/StatsStore/1"
I, [2020-10-27T09:00:09.498774 #9445-47348311935480] INFO -- : # 400
E, [2020-10-27T09:00:09.500255 #9445-47348311935480] ERROR -- : Unable to process post request to elasticsearch URL 'http://localhost:9200/zammad_production/StatsStore/1'. Check the response and payload for detailed information:
Response:
#<UserAgent::Result:0x000056204692d008 @success=false, @body="{\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"Rejecting mapping update to [zammad_production] as the final mapping would have more than 1 type: [User, StatsStore]\"}],\"type\":\"illegal_argument_exception\",\"reason\":\"Rejecting mapping update to [zammad_production] as the final mapping would have more than 1 type: [User, StatsStore]\"},\"status\":400}", @data=nil, @code="400", @content_type=nil, @error="Client Error: #<Net::HTTPBadRequest 400 Bad Request readbody=true>!">
Payload:
{"id":1,"stats_store_object_id":1,"o_id":3,"key":"dashboard","related_stats_store_object_id":null,"data":{"StatsTicketReopen":{"used_for_average":0.0,"percent":0.0,"average_per_agent":0.0,"state":"supergood","count":0,"total":3},"StatsTicketWaitingTime":{"handling_time":0,"average_per_agent":0,"state":"supergood","percent":0.0},"StatsTicketEscalation":{"used_for_average":0,"average_per_agent":0.0,"state":"supergood","own":0,"total":0},"StatsTicketChannelDistribution":{"channels":{"email":{"icon":"email","inbound":0,"outbound":0,"inbound_in_percent":0,"outbound_in_percent":0},"phone":{"icon":"phone","inbound":3,"outbound":0,"inbound_in_percent":100,"outbound_in_percent":0},"web":{"icon":"web","inbound":0,"outbound":0,"inbound_in_percent":0,"outbound_in_percent":0}}},"StatsTicketLoadMeasure":{"used_for_average":0,"average_per_agent":0.0,"percent":0,"state":"supergood","own":0,"total":0},"StatsTicketInProcess":{"used_for_average":100.0,"average_per_agent":100.0,"state":"supergood","in_process":3,"percent":100.0,"total":3}},"created_by_id":1,"created_at":"2020-10-27T07:47:31.937Z","updated_at":"2020-10-27T08:45:03.004Z","stats_store_object":"User","stats_store_object_ref":{"id":3,"organization_id":null,"login":"shmuel@humanz.ai","firstname":"Shmuel","lastname":"Goldfarb","email":"shmuel@humanz.ai","web":"","phone":"","fax":"","mobile":"","department":"","street":"","zip":"","city":"","country":"","address":"","vip":false,"verified":false,"active":true,"note":"","last_login":"2020-10-27T08:32:38.881Z","out_of_office":false,"out_of_office_start_at":null,"out_of_office_end_at":null,"out_of_office_replacement_id":null,"preferences":{"notification_config":{"matrix":{"create":{"criteria":{"owned_by_me":true,"owned_by_nobody":true},"channel":{"email":true,"online":true}},"update":{"criteria":{"owned_by_me":true,"owned_by_nobody":true},"channel":{"email":true,"online":true}},"reminder_reached":{"criteria":{"owned_by_me":true},"channel":{"email":true,"online":true}},"escalation":{"criteria":{"owned_by_me":true},"channel":{"email":true,"online":true}}},"group_ids":["1"]},"locale":"en-us","intro":true,"notification_sound":{"file":"Xylo.mp3","enabled":false}},"updated_by_id":3,"created_by_id":1,"created_at":"2020-10-27T07:40:37.463Z","updated_at":"2020-10-27T08:44:28.355Z","permissions":["admin","admin.user","admin.group","admin.role","admin.organization","admin.overview","admin.text_module","admin.time_accounting","admin.macro","admin.tag","admin.calendar","admin.sla","admin.trigger","admin.scheduler","admin.report_profile","admin.channel_web","admin.channel_formular","admin.channel_email","admin.channel_twitter","admin.channel_facebook","admin.channel_telegram","admin.channel_sms","admin.channel_chat","admin.branding","admin.setting_system","admin.security","admin.ticket","admin.package","admin.integration","admin.api","admin.object","admin.translation","admin.monitoring","admin.data_privacy","admin.maintenance","admin.session","user_preferences","user_preferences.password","user_preferences.notifications","user_preferences.access_token","user_preferences.language","user_preferences.linked_accounts","user_preferences.device","user_preferences.avatar","user_preferences.calendar","user_preferences.out_of_office","report","ticket.agent","chat.agent","cti.agent","admin.knowledge_base","knowledge_base.editor","knowledge_base.reader"],"role_ids":[1,2]}}
Payload size: 0M
E, [2020-10-27T09:00:09.501548 #9445-47348311935480] ERROR -- : Error performing SearchIndexJob (Job ID: b63e3d04-36cc-4912-ab30-9c14496f9ada) from DelayedJob(default) in 35.18ms: RuntimeError (Unable to process post request to elasticsearch URL 'http://localhost:9200/zammad_production/StatsStore/1'. Check the response and payload for detailed information:
Response:
#<UserAgent::Result:0x000056204692d008 @success=false, @body="{\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"Rejecting mapping update to [zammad_production] as the final mapping would have more than 1 type: [User, StatsStore]\"}],\"type\":\"illegal_argument_exception\",\"reason\":\"Rejecting mapping update to [zammad_production] as the final mapping would have more than 1 type: [User, StatsStore]\"},\"status\":400}", @data=nil, @code="400", @content_type=nil, @error="Client Error: #<Net::HTTPBadRequest 400 Bad Request readbody=true>!">
Payload:
{"id":1,"stats_store_object_id":1,"o_id":3,"key":"dashboard","related_stats_store_object_id":null,"data":{"StatsTicketReopen":{"used_for_average":0.0,"percent":0.0,"average_per_agent":0.0,"state":"supergood","count":0,"total":3},"StatsTicketWaitingTime":{"handling_time":0,"average_per_agent":0,"state":"supergood","percent":0.0},"StatsTicketEscalation":{"used_for_average":0,"average_per_agent":0.0,"state":"supergood","own":0,"total":0},"StatsTicketChannelDistribution":{"channels":{"email":{"icon":"email","inbound":0,"outbound":0,"inbound_in_percent":0,"outbound_in_percent":0},"phone":{"icon":"phone","inbound":3,"outbound":0,"inbound_in_percent":100,"outbound_in_percent":0},"web":{"icon":"web","inbound":0,"outbound":0,"inbound_in_percent":0,"outbound_in_percent":0}}},"StatsTicketLoadMeasure":{"used_for_average":0,"average_per_agent":0.0,"percent":0,"state":"supergood","own":0,"total":0},"StatsTicketInProcess":{"used_for_average":100.0,"average_per_agent":100.0,"state":"supergood","in_process":3,"percent":100.0,"total":3}},"created_by_id":1,"created_at":"2020-10-27T07:47:31.937Z","updated_at":"2020-10-27T08:45:03.004Z","stats_store_object":"User","stats_store_object_ref":{"id":3,"organization_id":null,"login":"shmuel@humanz.ai","firstname":"Shmuel","lastname":"Goldfarb","email":"shmuel@humanz.ai","web":"","phone":"","fax":"","mobile":"","department":"","street":"","zip":"","city":"","country":"","address":"","vip":false,"verified":false,"active":true,"note":"","last_login":"2020-10-27T08:32:38.881Z","out_of_office":false,"out_of_office_start_at":null,"out_of_office_end_at":null,"out_of_office_replacement_id":null,"preferences":{"notification_config":{"matrix":{"create":{"criteria":{"owned_by_me":true,"owned_by_nobody":true},"channel":{"email":true,"online":true}},"update":{"criteria":{"owned_by_me":true,"owned_by_nobody":true},"channel":{"email":true,"online":true}},"reminder_reached":{"criteria":{"owned_by_me":true},"channel":{"email":true,"online":true}},"escalation":{"criteria":{"owned_by_me":true},"channel":{"email":true,"online":true}}},"group_ids":["1"]},"locale":"en-us","intro":true,"notification_sound":{"file":"Xylo.mp3","enabled":false}},"updated_by_id":3,"created_by_id":1,"created_at":"2020-10-27T07:40:37.463Z","updated_at":"2020-10-27T08:44:28.355Z","permissions":["admin","admin.user","admin.group","admin.role","admin.organization","admin.overview","admin.text_module","admin.time_accounting","admin.macro","admin.tag","admin.calendar","admin.sla","admin.trigger","admin.scheduler","admin.report_profile","admin.channel_web","admin.channel_formular","admin.channel_email","admin.channel_twitter","admin.channel_facebook","admin.channel_telegram","admin.channel_sms","admin.channel_chat","admin.branding","admin.setting_system","admin.security","admin.ticket","admin.package","admin.integration","admin.api","admin.object","admin.translation","admin.monitoring","admin.data_privacy","admin.maintenance","admin.session","user_preferences","user_preferences.password","user_preferences.notifications","user_preferences.access_token","user_preferences.language","user_preferences.linked_accounts","user_preferences.device","user_preferences.avatar","user_preferences.calendar","user_preferences.out_of_office","report","ticket.agent","chat.agent","cti.agent","admin.knowledge_base","knowledge_base.editor","knowledge_base.reader"],"role_ids":[1,2]}}
Payload size: 0M):
/home/ubuntu/zammad/lib/search_index_backend.rb:895:in `make_request_and_validate'
/home/ubuntu/zammad/lib/search_index_backend.rb:145:in `add'
/home/ubuntu/zammad/app/models/concerns/has_search_index_backend.rb:168:in `search_index_update_backend'
/home/ubuntu/zammad/app/jobs/search_index_job.rb:26:in `update_search_index'
/home/ubuntu/zammad/app/jobs/search_index_job.rb:22:in `perform'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activejob-5.2.4.4/lib/active_job/execution.rb:39:in `block in perform_now'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:109:in `block in run_callbacks'
/home/ubuntu/zammad/app/jobs/concerns/has_active_job_lock.rb:12:in `block (2 levels) in <module:HasActiveJobLock>'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:118:in `instance_exec'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/i18n-1.8.3/lib/i18n.rb:313:in `with_locale'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activejob-5.2.4.4/lib/active_job/translation.rb:9:in `block (2 levels) in <module:Translation>'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:118:in `instance_exec'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activejob-5.2.4.4/lib/active_job/logging.rb:26:in `block (4 levels) in <module:Logging>'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:168:in `block in instrument'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/notifications.rb:168:in `instrument'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activejob-5.2.4.4/lib/active_job/logging.rb:25:in `block (3 levels) in <module:Logging>'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activejob-5.2.4.4/lib/active_job/logging.rb:46:in `block in tag_logger'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:71:in `block in tagged'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:28:in `tagged'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/tagged_logging.rb:71:in `tagged'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activejob-5.2.4.4/lib/active_job/logging.rb:46:in `tag_logger'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activejob-5.2.4.4/lib/active_job/logging.rb:22:in `block (2 levels) in <module:Logging>'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:118:in `instance_exec'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:136:in `run_callbacks'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activejob-5.2.4.4/lib/active_job/execution.rb:38:in `perform_now'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activejob-5.2.4.4/lib/active_job/execution.rb:24:in `block in execute'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:109:in `block in run_callbacks'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activejob-5.2.4.4/lib/active_job/railtie.rb:28:in `block (4 levels) in <class:Railtie>'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/execution_wrapper.rb:87:in `wrap'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/reloader.rb:73:in `block in wrap'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/execution_wrapper.rb:87:in `wrap'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/reloader.rb:72:in `wrap'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activejob-5.2.4.4/lib/active_job/railtie.rb:27:in `block (3 levels) in <class:Railtie>'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:118:in `instance_exec'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:136:in `run_callbacks'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activejob-5.2.4.4/lib/active_job/execution.rb:22:in `execute'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/activejob-5.2.4.4/lib/active_job/queue_adapters/delayed_job_adapter.rb:42:in `perform'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/backend/base.rb:81:in `block in invoke_job'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/lifecycle.rb:61:in `block in initialize'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/lifecycle.rb:66:in `execute'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/backend/base.rb:78:in `invoke_job'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/worker.rb:230:in `block (2 levels) in run'
/home/ubuntu/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/timeout.rb:93:in `block in timeout'
/home/ubuntu/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/timeout.rb:103:in `timeout'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/worker.rb:230:in `block in run'
/home/ubuntu/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/worker.rb:229:in `run'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/worker.rb:312:in `block in reserve_and_run_one_job'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/lifecycle.rb:61:in `block in initialize'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/lifecycle.rb:66:in `execute'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/lifecycle.rb:40:in `run_callbacks'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/worker.rb:312:in `reserve_and_run_one_job'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/worker.rb:213:in `block in work_off'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/worker.rb:212:in `times'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/delayed_job-4.1.7/lib/delayed/worker.rb:212:in `work_off'
/home/ubuntu/zammad/app/models/scheduler.rb:372:in `block (3 levels) in worker'
/home/ubuntu/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
/home/ubuntu/zammad/app/models/scheduler.rb:370:in `block (2 levels) in worker'
/home/ubuntu/zammad/app/models/scheduler.rb:366:in `loop'
/home/ubuntu/zammad/app/models/scheduler.rb:366:in `block in worker'
/home/ubuntu/.rvm/gems/ruby-2.6.6/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
E, [2020-10-27T09:00:09.501675 #9445-47348311935480] ERROR -- : Retrying SearchIndexJob in #<Proc:0x0000562044de54a8@/home/ubuntu/zammad/app/jobs/search_index_job.rb:6 (lambda)> seconds, due to a StandardError. The original exception was nil.
I, [2020-10-27T09:00:09.509233 #9445-47348311935480] INFO -- : Enqueued SearchIndexJob (Job ID: b63e3d04-36cc-4912-ab30-9c14496f9ada) to DelayedJob(default) at 2020-10-27 09:03:09 UTC with arguments: "StatsStore", 1
I, [2020-10-27T09:00:09.512800 #9445-47348311935480] INFO -- : 2020-10-27T09:00:09+0000: [Worker(host:ip-172-31-47-254 pid:9445)] Job SearchIndexJob [b63e3d04-36cc-4912-ab30-9c14496f9ada] from DelayedJob(default) with arguments: ["StatsStore", 1] (id=565) (queue=default) COMPLETED after 0.0672
I, [2020-10-27T09:00:14.173745 #9445-47348241086820] INFO -- : Scheduler running...
I, [2020-10-27T09:00:14.227202 #9445-47348311689720] INFO -- : execute Ticket.process_auto_unassign (try_count 0)...
I, [2020-10-27T09:00:14.229010 #9445-47348311689720] INFO -- : ended Ticket.process_auto_unassign took: 0.005843092 seconds.
Any ideas?
Thanks