Alert notification emails are not sent
While testing the support for alerts from external Prometheus servers I've noticed that alert notification emails are not being sent and fail with an error ActiveJob::SerializationError: Unsupported argument type: ActionController::Parameters
.
I guess this is breaking since the upgrade to rails5. Strangely, specs did not catch that error.
Possible solution
- Pass payload as Hash when sending mails synchronously using e.g.
#as_json
. - Allow
ActionController::Parameters
to be serialized.
Personally, I prefer solution 1 as it's simpler.
Sentry error
We have corresponding Sentry issues for this e.g.:
https://sentry.gitlab.net/gitlab/gitlabcom/issues/616474/
ActiveJob::SerializationError: Unsupported argument type: ActionController::Parameters
active_job/arguments.rb:83:in `serialize_argument'
raise SerializationError.new("Unsupported argument type: #{argument.class.name}")
active_job/arguments.rb:72:in `block in serialize_argument'
argument.map { |arg| serialize_argument(arg) }
active_job/arguments.rb:72:in `map'
argument.map { |arg| serialize_argument(arg) }
active_job/arguments.rb:72:in `serialize_argument'
argument.map { |arg| serialize_argument(arg) }
active_job/arguments.rb:44:in `block in serialize'
arguments.map { |argument| serialize_argument(argument) }
...
(137 additional frame(s) were not displayed)
ActiveJob::SerializationError: Unsupported argument type: ActionController::Parameters