Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in Adding Monitor to Status Page for Uptime Robot #352

Open
kahootali opened this issue Jun 22, 2021 · 5 comments
Open

Issue in Adding Monitor to Status Page for Uptime Robot #352

kahootali opened this issue Jun 22, 2021 · 5 comments
Assignees
Labels
kind/bug Something isn't working workflow/todo

Comments

@kahootali
Copy link
Contributor

I have created a Status Page on Uptime Robot and got the id of it by running curl -d "api_key=MY_API_KEY" -X POST https://api.uptimerobot.com/v2/getPSPs and used that ID in my EndpointMonitor

apiVersion: endpointmonitor.stakater.com/v1alpha1
kind: EndpointMonitor
metadata:
  name: test
spec:
  forceHttps: true
  url: https://test.DOMAIN
  uptimeRobotConfig:
    interval: 300
    monitorType: http
    statusPages: "ID_FROM_ABOVE"

But it isn't working and gives an error in the logs as below

2021-06-22T09:09:24.563Z	INFO	uptime-monitor-test	Monitor Updated: test
2021-06-22T09:09:25.365Z	ERROR	uptime-monitor-test	Unable to unmarshal JSON	{"error": "json: cannot unmarshal number into Go struct field UptimePublicStatusPage.psps.monitors of type []int"}
github.com/go-logr/zapr.(*zapLogger).Error
	/go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:132
sigs.k8s.io/controller-runtime/pkg/log.(*DelegatingLogger).Error
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/deleg.go:144
github.com/stakater/IngressMonitorController/pkg/monitors/uptimerobot.(*UpTimeStatusPageService).Get
	/workspace/pkg/monitors/uptimerobot/uptime-status-page.go:209
github.com/stakater/IngressMonitorController/pkg/monitors/uptimerobot.(*UpTimeStatusPageService).AddMonitorToStatusPage
	/workspace/pkg/monitors/uptimerobot/uptime-status-page.go:101
github.com/stakater/IngressMonitorController/pkg/monitors/uptimerobot.(*UpTimeMonitorService).updateStatusPages
	/workspace/pkg/monitors/uptimerobot/uptime-monitor.go:280
github.com/stakater/IngressMonitorController/pkg/monitors/uptimerobot.(*UpTimeMonitorService).handleStatusPagesConfig
	/workspace/pkg/monitors/uptimerobot/uptime-monitor.go:273
github.com/stakater/IngressMonitorController/pkg/monitors/uptimerobot.(*UpTimeMonitorService).Update
	/workspace/pkg/monitors/uptimerobot/uptime-monitor.go:169
github.com/stakater/IngressMonitorController/pkg/monitors.(*MonitorServiceProxy).Update
	/workspace/pkg/monitors/monitor-proxy.go:96
github.com/stakater/IngressMonitorController/pkg/controllers.(*EndpointMonitorReconciler).handleUpdate
	/workspace/pkg/controllers/endpointmonitor_updated.go:26
github.com/stakater/IngressMonitorController/pkg/controllers.(*EndpointMonitorReconciler).Reconcile
	/workspace/pkg/controllers/endpointmonitor_controller.go:95
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:298
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:253
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.2
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:216
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1
	/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:185
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1
	/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:155
k8s.io/apimachinery/pkg/util/wait.BackoffUntil
	/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:156
k8s.io/apimachinery/pkg/util/wait.JitterUntil
	/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:133
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext
	/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:185
k8s.io/apimachinery/pkg/util/wait.UntilWithContext
	/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:99
2021-06-22T09:09:26.193Z	INFO	uptime-monitor-test	Updated Page Request failed. Status Code: 500
2021-06-22T09:09:26.193Z	INFO	uptime-monitor-test	Monitor couldn't be added to status page: Updated Page Request failed. Status Code: 500

Not sure if I am missing something

@ahmedwaleedmalik
Copy link
Contributor

@kahootali I went through this issue and it's a limitation from the UptimeRobot API. From documentation of newPSPs from https://uptimerobot.com/api/,

  1. The field monitors can have either an integer or a list of integers as a response.
  2. By default it just returns 0 as a response which breaks the whole functionality in the code.

You'll have to open a support ticket at their end to fix this issue.

https://github.com/stakater/IngressMonitorController/blob/master/pkg/monitors/uptimerobot/uptime-responses.go#L72

@karl-johan-grahn
Copy link
Contributor

@kahootali do you still experience this issue?

@github-actions
Copy link

This issue is stale because it has been open for 60 days with no activity.

@github-actions github-actions bot added the stale label Apr 13, 2023
@github-actions
Copy link

This issue was closed because it has been inactive for 30 days since being marked as stale.

@karl-johan-grahn
Copy link
Contributor

Reopening issues that inadvertently were closed as stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working workflow/todo
Projects
None yet
Development

No branches or pull requests

4 participants