Browser + version: current versions of Safari & Chrome
Hi everyone, I’m new to Zammad but have a little knowledge of Ruby on Rails / Console. We are in the midst of configuring our own instance of Zammad and come across this unusual configuration setting. I’m wondering if anyone might know how to fix it. It’s not causing any apparent issues through so probably not critical.
Expected behaviour:
I was expecting to have just one outbound email configuration. In our test implementation this was correct.
Actual behavior:
Some how, our production installation has now got 4 outbound email accounts or 4 instances of the same and they all have the same address. I’ve attached a screen shot for context.
Sending email seems to work fine though so I think this is just a bug or duplicated records/configuration?
So talking to my team, it turns out someone was running db:seed when restarting the server. So I’m pretty sure thats the reason why there are duplicates. Even though in the channels.rb seed file it should only create if it doesn’t exist!?
So now my question is, does anyone know how I can safely remove these records from the DB or via the console?
I’d be interested for the reason for that.
Seeding the database in a productive system should never be required, not during upgrading nor rebooting your system or restarting services.
The maximum one would have to run would either be a reindex if technically required or a db:migrate if migrations failed during upgrading. (This shouldn’t happen too often).
According to the seeds file seeding the db shouldn’t add tons of new notification channels.
In fact however it does:
The following rails script (run within zammad run rails c) should solve your issue, if you have a default installation that isn’t somehow different. This removes all notification channels without further questions if it’s not the default 2 first ones.
Double check that you have at least one notification channel active within your Zammad UI afterwards.
Channel.where(area: 'Email::Notification').each {|channel|
next if channel.id == 1
next if channel.id == 2
channel.destroy
}