Zammad sporadic not work


If you are a Zammad Support or hosted customer and experience a technical issue, please refer to: using your zammad-hostname / or company contract.

  • Used Zammad version: 2.8
  • Used Zammad installation source: (source, package, …) source
  • Operating system: OpenSuSE 42.3
  • Browser + version: Chrome 70

Our ticket system always hangs up sporadically and then no more mails are retrieved from the ticket system. We have had this error since version 2.7. Also all agents get a message in the browser window with a 5xx error code.

I don’t know what the problem is, you’re going to have to look at all the logs on your server.

If you just had the browser 5xx errors I would say check your postgresql logs for a message like psql: FATAL: remaining connection slots are reserved for non-replication superuser connections but since you have other errors with it not fetching mail that might not be an issue. you should check the postgresql logs regardless.

Do you have zammad set up to keep mail on the mail server? I’ve seen ages ago someone have that setting and when an email arrived that zammad chokes on it never moves past it and stops collecting mail.

Here is the log after the above error message has occurred.

ERROR – : #<JSON::ParserError: 765: unexpected token at ‘’>
I, [2018-12-11T07:59:59.126826 #1999-47057526562380] INFO – : Completed 200 OK in 1611ms (Views: 68.4ms | ActiveRecord: 1317.9ms)
E, [2018-12-11T07:59:59.180331 #31830-47195043899460] ERROR – : error in reading/parsing session file ‘/opt/zammad/tmp/websocket_production/3396696125/session’, remove session.
I, [2018-12-11T07:59:59.127280 #31554-47057533065080] INFO – : Completed 200 OK in 2270ms (Views: 0.7ms | ActiveRecord: 2.1ms)
I, [2018-12-11T07:59:59.127280 #1999-47057534677920] INFO – : Completed 200 OK in 2406ms (Views: 0.7ms | ActiveRecord: 2.1ms)
E, [2018-12-11T07:59:59.191212 #31373-70114370615420] ERROR – : Invalid client_id in receive loop! (Exceptions::UnprocessableEntity)
[2018-12-11T08:00:04.307109 #31830-47194993774420] ERROR – : Can’t reconnect to database #<PG::Error: invalid encoding name: utf8>

2018-12-11 07:33:52 CET zammad zammad LOG: Dauer: 1149.718 ms Anweisung: SELECT 1
2018-12-11 07:35:34 CET zammad zammad LOG: Dauer: 479.392 ms Anweisung: SELECT 1
2018-12-11 08:00:02 CET zammad zammad FATAL: die verbleibenden Verbindungen sind für Superuser auf Nicht-Replikationsverbindungen reserviert

well, google translate says that means you’ve used all the available connections to postgresql, you need to increase max_connections in postgresql.conf. I think the default is 100, but I don’t know what a good value is. and I don’t know why zammad uses so many, it doesn’t look like it’s using connection pools.

away, head on over to and put in the details, maybe make the number of connections 200 or 300, for memory, it’s another guess, elasticsearch out of the box uses 2gig, so total memory - 2g, and maybe put in a 1/3 of of what’s left. so if you had 8gigs total, (8 - 2) / 3. Tuning postgres is an art, that’s just a starting point. the main thing is to increase max_connections.

You need to either raise the max_connections or configure pooling.
The more Agents you have, the more connections Zammad might take and need.

how do you configure pooling?

The following page might help you:

This is kinda out of scope for me at the moment. :wink:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.