vsergeyev/loudml-grafana-app

The method is not allowed for the requested URL

Opened this issue · 7 comments

I am trying to create the ML model with regard to the following steps but no luck.

select a time frame
click “Create Baseline” button, wait for ML model to be created
click “Train model” button, wait for training to complete
run a prediction with “Play” button
observe anomalies (as annotations on graph)

It shown this error when i press “Create Baseline” button:
error

Log under Loud ML server:
172.17.0.2 - - [2020-05-07 16:12:27] "POST /models HTTP/1.1" 405 220 0.002024

The environment as below
Grafana: v6.7.3
Loud ML server: 1.5
InfluxDB: 1.7.9

Can you try this: (example)

curl -H "Content-Type: application/json" -X POST loudml:8077/models --data-binary @model.json

model.json

{
  "bucket_interval": "1m",
  "default_bucket": "temperature-bucket",
  "features": [
    {
      "default": 0,
      "field": "temp2",
      "metric": "avg",
      "name": "avg_temp_feature"
    }
  ],
  "interval": 60,
  "max_evals": 10,
  "name": "avg_temp2-model",
  "offset": 30,
  "span": 5,
  "max_threshold": 90,
  "min_threshold": 50,
  "type": "donut"
}

What is the result?

Regards,
Fadjar

Hi Fadjar,

The response is same as the above error message.

# curl -H "Content-Type: application/json" -X POST 127.0.0.1:8077/models --data-binary @model.json {"message": "The method is not allowed for the requested URL."}

Thanks,
ib

It means, not the loudml-grafana-app problem, it's loudml server problem.

Please ensure you can create model in the loudml server using curl. then the loudml-grafana-app will do the rest.

Regards,
Fadjar

May you try to open http://127.0.0.1:8077/models in your web browser?

This should display you a list of models you have / empty list.

Just wondering why curl not working.

V.

Hi Fadjar,

The model can be created after upgraded the loudml server to v1.6; however, the "loudml-grafana-app" module somehow cannot create the model when there is "fill(0)" option under influxdb query with below error:

invalid field features.0.match_all: not a valid value

I suspect this error is related to the double quote around the '0' in the JSON post by "loudml-grafana-app" module.

...
"features": [
    {
      "default": **"0",**
...

Even though the model can be created by manually post the JSON to the loudml server through the curl command, it is not able to save the model after the training is completed by clicking the train button in Grafana... May I ask is this module compatible with the latest version of loudML server?

TypeError: 'Not JSON Serializable'

@ifan-boy addressed this in latest 1.3.0

Wow 1.3.0...