grafana / oncall

Developer-friendly incident response with brilliant Slack integration
GNU Affero General Public License v3.0
3.49k stars 288 forks source link

Pagerduty Migration failed in migrate mode #2917

Closed pramodh-b closed 1 year ago

pramodh-b commented 1 year ago

What went wrong?

What happened:

File "/app/migrator/oncall_api_client.py", line 46, in api_call raise requests.exceptions.HTTPError( requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://URL/api/v1/personal_notification_rules, response payload JSON: {'type': 'Invalid type'}

What did you expect to happen: I was expecting a successful migration in migrate mode.

How do we reproduce it?

By running Pager duty migrator in migrate mode we can reproduce this error

Grafana OnCall Version

1.3.27

Product Area

Other

Grafana OnCall Platform?

Kubernetes

User's Browser?

No response

Anything else to add?

Are you using OSS or Grafana Cloud? Ans: OSS What’s the version of OnCall on your instance? Ans: Onall plugin version: 1.3.27, Grafana version: 9.5.3 Which types of user notification rules are used on your PD instance? (e.g. email, SMS, etc.) Ans: Email, Call, SMS, App notification

Used helm package manager to install oncall and configure. helm install my-oncall grafana/oncall --version 1.3.27

vadimkerr commented 1 year ago

👋 @pramodh-b could you please try setting .Values.oncall.smtp.enabled to true and running the migration again and see if it helps?

pramodh-b commented 1 year ago

Hi @vadimkerr its still same issue.

vadimkerr commented 1 year ago

I'm not able to reproduce the issue when passing --set oncall.smtp.enabled=true to Helm. Maybe some values are not getting propagated on your deployment @pramodh-b?

pramodh-b commented 1 year ago

As you suggested changes SMTP values to true and provided the details. Now there is another error with migrate mode in the Migrating schedule step. below is the error.

▶ Migrating schedules... Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/app/migrator/main.py", line 184, in main() File "/app/migrator/main.py", line 157, in main migrate_schedule(schedule, user_id_map) File "/app/migrator/resources/schedules.py", line 45, in migrate_schedule "ical_url_primary": schedule["http_cal_url"],


KeyError: 'http_cal_url'
vadimkerr commented 1 year ago

The issue should be fixed in this PR by setting oncall.smtp.enabled=true by default.

@pramodh-b regarding the http_cal_url error, please make sure you're using a User Token REST API Key and not a General Access REST API Key as per the instruction. If that doesn't help, feel free to open a new issue here in the GH repo.