Thanks for the logfile, that’s definitely helping.
First of all: Please restart your Zammad-Service.
You’re experiencing several problems - the biggest one might be your database server refusing connections:
I, [2019-03-06T11:52:17.803120 #109335-47095824027420] INFO -- : Completed 422 Unprocessable Entity in 9210ms (Views: 0.3ms | ActiveRecord: 8713.1ms)
E, [2019-03-06T11:52:17.804911 #109335-69873216173500] ERROR -- : PG::UnableToSend: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
(Regarding this, you might want to raise max_connections
inside the postgresql config, something like 250 and higher should be good enough. You might also want to restart your postgresql service before your zammad service, as it might also be that your operating system is killing processes because of insuficient memory.
(The following error actually seems to proove me right)
E, [2019-03-06T12:50:32.683663 #10289-69916700177060] ERROR -- : thread_client 47182414241020 exited with error #<PG::ConnectionBad: FATAL: remaining connection slots are reserved for non-replication superuser connections
Your second problem (has been) elasticsearch - I’ve seen on the end of your log that you seemed to fixed that one so it should be fine.
E, [2019-03-06T11:53:23.019631 #1070-47204663792540] ERROR -- : Error performing SearchIndexJob (Job ID: 632215e3-1b05-4831-8059-d9f5cdba2e45) from DelayedJob(default) in 24.04ms: RuntimeError (Unable to process POST request to elasticsearch URL 'http://localhost:9200/zammad.localdomain_zammad_production/User/243?pipeline=zammad-attachment'. Elasticsearch is not reachable, probably because it's not running or even installed.
After elasticsearch errors, your database issue appeared again (you really should check that), the database server is also the reason why the scheduler can’t run - Zammad needs a working database connection, thus fetching your mail accounts did not happen/work:
E, [2019-03-06T12:31:50.033255 #1070-69857077089060] ERROR -- : execute Channel.fetch (try_count 1) exited with error #<ActiveRecord::StatementInvalid: PG::ConnectionBad: PQsocket() can't get socket descriptor: BEGIN>
E, [2019-03-06T12:31:50.033540 #1070-69857077089060] ERROR -- : Can't reconnect to database #<PG::Error: invalid encoding name: utf8>
E, [2019-03-06T12:31:52.034510 #1070-69857077089060] ERROR -- : execute Channel.fetch (try_count 2) exited with error #<ActiveRecord::StatementInvalid: PG::ConnectionBad: PQsocket() can't get socket descriptor: BEGIN>
E, [2019-03-06T12:31:52.034782 #1070-69857077089060] ERROR -- : Can't reconnect to database #<PG::Error: invalid encoding name: utf8>
E, [2019-03-06T12:31:55.035760 #1070-69857077089060] ERROR -- : execute Channel.fetch (try_count 3) exited with error #<ActiveRecord::StatementInvalid: PG::ConnectionBad: PQsocket() can't get socket descriptor: BEGIN>
E, [2019-03-06T12:31:55.036114 #1070-69857077089060] ERROR -- : Can't reconnect to database #<PG::Error: invalid encoding name: utf8>
E, [2019-03-06T12:31:59.037101 #1070-69857077089060] ERROR -- : execute Channel.fetch (try_count 4) exited with error #<ActiveRecord::StatementInvalid: PG::ConnectionBad: PQsocket() can't get socket descriptor: BEGIN>
E, [2019-03-06T12:31:59.037386 #1070-69857077089060] ERROR -- : Can't reconnect to database #<PG::Error: invalid encoding name: utf8>
E, [2019-03-06T12:32:04.038205 #1070-69857077089060] ERROR -- : execute Channel.fetch (try_count 5) exited with error #<ActiveRecord::StatementInvalid: PG::ConnectionBad: PQsocket() can't get socket descriptor: BEGIN>
E, [2019-03-06T12:32:04.038451 #1070-69857077089060] ERROR -- : Can't reconnect to database #<PG::Error: invalid encoding name: utf8>
E, [2019-03-06T12:32:10.039367 #1070-69857077089060] ERROR -- : execute Channel.fetch (try_count 6) exited with error #<ActiveRecord::StatementInvalid: PG::ConnectionBad: PQsocket() can't get socket descriptor: BEGIN>
E, [2019-03-06T12:32:10.039652 #1070-69857077089060] ERROR -- : Can't reconnect to database #<PG::Error: invalid encoding name: utf8>
E, [2019-03-06T12:32:17.040612 #1070-69857077089060] ERROR -- : execute Channel.fetch (try_count 7) exited with error #<ActiveRecord::StatementInvalid: PG::ConnectionBad: PQsocket() can't get socket descriptor: BEGIN>
E, [2019-03-06T12:32:17.040907 #1070-69857077089060] ERROR -- : Can't reconnect to database #<PG::Error: invalid encoding name: utf8>
E, [2019-03-06T12:32:25.041713 #1070-69857077089060] ERROR -- : execute Channel.fetch (try_count 8) exited with error #<ActiveRecord::StatementInvalid: PG::ConnectionBad: PQsocket() can't get socket descriptor: BEGIN>
E, [2019-03-06T12:32:25.041948 #1070-69857077089060] ERROR -- : Can't reconnect to database #<PG::Error: invalid encoding name: utf8>
E, [2019-03-06T12:32:34.042734 #1070-69857077089060] ERROR -- : execute Channel.fetch (try_count 9) exited with error #<ActiveRecord::StatementInvalid: PG::ConnectionBad: PQsocket() can't get socket descriptor: BEGIN>
If you fix the above errors, Zammad should recover and the Delayed::Job.count
should decrease over time. You should be good to go then. 