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

[Uptime] ML job creation fails on some monitor names #164

Closed
andrewvc opened this issue Apr 1, 2020 · 0 comments · Fixed by elastic/kibana#62293
Closed

[Uptime] ML job creation fails on some monitor names #164

andrewvc opened this issue Apr 1, 2020 · 0 comments · Fixed by elastic/kibana#62293
Assignees
Labels
bug Something isn't working Team:Uptime Label for the Uptime team v7.7.0

Comments

@andrewvc
Copy link
Contributor

andrewvc commented Apr 1, 2020

I tried to enable ML on a monitor with an autogenerated ID and got the following error:

image

Looking in the network debugger I see the following response:

We should:

  1. Surface the error visibly to the user
  2. Only send valid job names. I'm a bit confused because the job name seems valid. We need to see what's up here.
{
	"JSON": {
		"jobs": [{
			"id": "auto-icmp-0X270404C479E6C53A_high_latency_by_geo",
			"success": false,
			"error": {
				"msg": "[illegal_argument_exception] Invalid job_id; 'auto-icmp-0X270404C479E6C53A_high_latency_by_geo' can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; must start and end with alphanumeric",
				"path": "/_ml/anomaly_detectors/auto-icmp-0X270404C479E6C53A_high_latency_by_geo",
				"query": {},
				"body": "{\"job_type\":\"anomaly_detector\",\"groups\":[\"uptime\"],\"description\":\"Uptime Heartbeat: Identify periods of increased latency across geographical regions.\",\"analysis_config\":{\"bucket_span\":\"15m\",\"detectors\":[{\"detector_description\":\"increased latency\",\"function\":\"high_mean\",\"field_name\":\"monitor.duration.us\",\"partition_field_name\":\"observer.geo.name\",\"use_null\":true}],\"influencers\":[\"monitor.id\",\"monitor.name\",\"observer.geo.name\"]},\"allow_lazy_open\":true,\"analysis_limits\":{\"model_memory_limit\":\"32mb\"},\"data_description\":{\"time_field\":\"@timestamp\"},\"custom_settings\":{\"created_by\":\"ml-module-uptime-heartbeat\",\"custom_urls\":[]}}",
				"statusCode": 400,
				"response": "{\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"Invalid job_id; 'auto-icmp-0X270404C479E6C53A_high_latency_by_geo' can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; must start and end with alphanumeric\"}],\"type\":\"illegal_argument_exception\",\"reason\":\"Invalid job_id; 'auto-icmp-0X270404C479E6C53A_high_latency_by_geo' can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; must start and end with alphanumeric\"},\"status\":400}"
			}
		}],
		"datafeeds": [{
			"id": "datafeed-auto-icmp-0X270404C479E6C53A_high_latency_by_geo",
			"success": false,
			"started": false,
			"error": {
				"msg": "[status_exception] Invalid datafeed_id; 'datafeed-auto-icmp-0X270404C479E6C53A_high_latency_by_geo' can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; must start and end with alphanumeric",
				"path": "/_ml/datafeeds/datafeed-auto-icmp-0X270404C479E6C53A_high_latency_by_geo",
				"query": {},
				"body": "{\"job_id\":\"auto-icmp-0X270404C479E6C53A_high_latency_by_geo\",\"indices\":[\"heartbeat-8*\"],\"max_empty_searches\":10,\"query\":{\"bool\":{\"filter\":[{\"term\":{\"monitor.id\":\"auto-icmp-0X270404C479E6C53A\"}}]}}}",
				"statusCode": 400,
				"response": "{\"error\":{\"root_cause\":[{\"type\":\"status_exception\",\"reason\":\"Invalid datafeed_id; 'datafeed-auto-icmp-0X270404C479E6C53A_high_latency_by_geo' can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; must start and end with alphanumeric\"}],\"type\":\"status_exception\",\"reason\":\"Invalid datafeed_id; 'datafeed-auto-icmp-0X270404C479E6C53A_high_latency_by_geo' can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; must start and end with alphanumeric\"},\"status\":400}"
			}
		}],
		"kibana": {}
	},
	"Response Payload": {
		"EDITOR_CONFIG": {
			"text": "{\"jobs\":[{\"id\":\"auto-icmp-0X270404C479E6C53A_high_latency_by_geo\",\"success\":false,\"error\":{\"msg\":\"[illegal_argument_exception] Invalid job_id; 'auto-icmp-0X270404C479E6C53A_high_latency_by_geo' can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; must start and end with alphanumeric\",\"path\":\"/_ml/anomaly_detectors/auto-icmp-0X270404C479E6C53A_high_latency_by_geo\",\"query\":{},\"body\":\"{\\\"job_type\\\":\\\"anomaly_detector\\\",\\\"groups\\\":[\\\"uptime\\\"],\\\"description\\\":\\\"Uptime Heartbeat: Identify periods of increased latency across geographical regions.\\\",\\\"analysis_config\\\":{\\\"bucket_span\\\":\\\"15m\\\",\\\"detectors\\\":[{\\\"detector_description\\\":\\\"increased latency\\\",\\\"function\\\":\\\"high_mean\\\",\\\"field_name\\\":\\\"monitor.duration.us\\\",\\\"partition_field_name\\\":\\\"observer.geo.name\\\",\\\"use_null\\\":true}],\\\"influencers\\\":[\\\"monitor.id\\\",\\\"monitor.name\\\",\\\"observer.geo.name\\\"]},\\\"allow_lazy_open\\\":true,\\\"analysis_limits\\\":{\\\"model_memory_limit\\\":\\\"32mb\\\"},\\\"data_description\\\":{\\\"time_field\\\":\\\"@timestamp\\\"},\\\"custom_settings\\\":{\\\"created_by\\\":\\\"ml-module-uptime-heartbeat\\\",\\\"custom_urls\\\":[]}}\",\"statusCode\":400,\"response\":\"{\\\"error\\\":{\\\"root_cause\\\":[{\\\"type\\\":\\\"illegal_argument_exception\\\",\\\"reason\\\":\\\"Invalid job_id; 'auto-icmp-0X270404C479E6C53A_high_latency_by_geo' can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; must start and end with alphanumeric\\\"}],\\\"type\\\":\\\"illegal_argument_exception\\\",\\\"reason\\\":\\\"Invalid job_id; 'auto-icmp-0X270404C479E6C53A_high_latency_by_geo' can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; must start and end with alphanumeric\\\"},\\\"status\\\":400}\"}}],\"datafeeds\":[{\"id\":\"datafeed-auto-icmp-0X270404C479E6C53A_high_latency_by_geo\",\"success\":false,\"started\":false,\"error\":{\"msg\":\"[status_exception] Invalid datafeed_id; 'datafeed-auto-icmp-0X270404C479E6C53A_high_latency_by_geo' can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; must start and end with alphanumeric\",\"path\":\"/_ml/datafeeds/datafeed-auto-icmp-0X270404C479E6C53A_high_latency_by_geo\",\"query\":{},\"body\":\"{\\\"job_id\\\":\\\"auto-icmp-0X270404C479E6C53A_high_latency_by_geo\\\",\\\"indices\\\":[\\\"heartbeat-8*\\\"],\\\"max_empty_searches\\\":10,\\\"query\\\":{\\\"bool\\\":{\\\"filter\\\":[{\\\"term\\\":{\\\"monitor.id\\\":\\\"auto-icmp-0X270404C479E6C53A\\\"}}]}}}\",\"statusCode\":400,\"response\":\"{\\\"error\\\":{\\\"root_cause\\\":[{\\\"type\\\":\\\"status_exception\\\",\\\"reason\\\":\\\"Invalid datafeed_id; 'datafeed-auto-icmp-0X270404C479E6C53A_high_latency_by_geo' can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; must start and end with alphanumeric\\\"}],\\\"type\\\":\\\"status_exception\\\",\\\"reason\\\":\\\"Invalid datafeed_id; 'datafeed-auto-icmp-0X270404C479E6C53A_high_latency_by_geo' can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; must start and end with alphanumeric\\\"},\\\"status\\\":400}\"}}],\"kibana\":{}}",
			"mode": "application/json"
		}
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Team:Uptime Label for the Uptime team v7.7.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants