Problem while upgrading legacy alerting to unified alerting


We just upgraded from Grafana 8 to Grafana 9. Initially, we have opted out for the new alerting system and everything went ok on the upgrade, Grafana was working fine post the operation. Although, now we are planning to adopt the new unified alerting system, after enabling it on the helm chart and disabling the old alerting system Grafana will not start with below error on logs:

{"error":"invalid character '\\n' in string literal","id":"move dashboard alerts to unified alerting","level":"error","logger":"migrator","msg":"Executing migration failed","t":"2022-10-04T17:57:45.676690288Z"}
{"error":"invalid character '\\n' in string literal","level":"error","logger":"migrator","msg":"Exec failed","sql":"code migration","t":"2022-10-04T17:57:45.676780917Z"}
Failed to start grafana. error: migration failed (id = move dashboard alerts to unified alerting): invalid character '\n' in string literal

Any idea on how can i find where is this invalid character coming from? Thanks.