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

HTTP Error Not Found #9

Open
manni8 opened this issue Mar 26, 2018 · 24 comments
Open

HTTP Error Not Found #9

manni8 opened this issue Mar 26, 2018 · 24 comments

Comments

@manni8
Copy link

manni8 commented Mar 26, 2018

kibana v6.2.3
grafana v5.0.3

Install cmd :
grafana-cli --pluginUrl https://github.com/gbrian/grafana-timelion-datasource/archive/master.zip plugins install grafana-timelion-datasource

Timelion host-url:
http://localhost:5601/app/timelion (works witch curl and browser)

Grafana UI-Response :

HTTP Error Not Found

grafana.log:

lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/10/run status=404 remote_addr=127.0.0.1 time_ms=9 size=69 referer=https://my-pub-url/datasources/edit/10

Some one else with the same issue ?

@Mitrofanov
Copy link

Same issue.
Kibana 6.0.1
Grafana 5.1.2

Plugin tries to execute GET method on /run location. But, as soon as i using AWS ES stack, only POST method allowed.

@gbrian
Copy link
Owner

gbrian commented May 10, 2018

HI @Mitrofanov ,
Where did you read about POST for AWS? Can you post the link and I'll try to make it compatible
Thanks
@repofunding support repofunding

@repofunding
Copy link

👋 Hi, @repofunding is helping @manni8 on maintaining this repository. We are an open source initiative aiming to help developers on maintain their projects by using crowdfunding.

Why using repofunding for this project?

Supporting

  • You can support this repository by providing a pull request here
  • Crowdfunding this issue with:

Important

@repofunding status is prototye be patiente 😉 don't hesitate to contact us Join the chat at https://gitter.im/repofunding/Lobby

tags: crowdfunding

@gbrian
Copy link
Owner

gbrian commented May 10, 2018

@manni8
http://localhost:5601/app/timelion used with grafana proxy mode will resolve to the same machine as grafana. Is that correct?

@Mitrofanov
Copy link

@gbrian I've just tried to debug the error message and tried to GET the config url. I get the following from AWS ES service:

{"error":"Incorrect HTTP method for uri [/api/timelion] and method [GET], allowed: [POST]","status":405}

@gbrian
Copy link
Owner

gbrian commented May 11, 2018

@Mitrofanov ,
Ok, found. The GET request is executed as part of the TESTmethod during data source definition.

image

Currently, you can ignore this error and just try the Timelion data source on a dashboard.
I'll fix this behavior asap.
Hope this helps.

@Mitrofanov
Copy link

Mitrofanov commented May 14, 2018

So i tried to use plugin but looks like it's not works. It returns no datapoints. Here is Grafana's query inspector output:

xhrStatus:"complete"
request:Object
method:"POST"
url:"api/datasources/proxy/8/run"
data:Object
sheet:Array[1]
0:",.es(*)"
time:Object
from:"2018-05-12T16:17:06 +0300"
interval:"auto"
mode:"absolute"
timezone:"GMT"
to:"2018-05-14T16:17:06 +0300"
response:Object
_index:"api"
_type:"timelion"
_id:"run"
_version:22
result:"updated"
_shards:Object
total:2
successful:2
failed:0
_seq_no:21
_primary_term:1

@gbrian Could you help with this?

@gbrian
Copy link
Owner

gbrian commented May 14, 2018

Hi @Mitrofanov ,
I see an error in the query caused by a known bug. I committed new version this morning.
I recommend to update to the latest version first and try again your test.
Please let me know if the error persists with the latest version.
Thanks

@Mitrofanov
Copy link

@gbrian I just tried to use new version but with no luck. So my issue is:

  1. I added Timelion datasource (got error in validation but trying to work with it)
  2. I trying to get some data from my datasource- i executing .es(*) query (tested in Kibana's timelion- it has some data)
  3. When i try it in grafana i get no datapoints, although i don't see any errors in query inspector:
  "xhrStatus": "complete",
  "request": {
    "method": "POST",
    "url": "api/datasources/proxy/8/run",
    "data": {
      "sheet": [
        ",.es(*)"
      ],
      "time": {
        "from": "2018-05-15T05:28:37 +0300",
        "interval": "auto",
        "mode": "absolute",
        "timezone": "GMT",
        "to": "2018-05-15T11:28:37 +0300"
      }
    }
  },
  "response": {
    "_index": "api",
    "_type": "timelion",
    "_id": "run",
    "_version": 41,
    "result": "updated",
    "_shards": {
      "total": 2,
      "successful": 2,
      "failed": 0
    },
    "_seq_no": 40,
    "_primary_term": 1
  }
}```

Could you please help?

@gbrian
Copy link
Owner

gbrian commented May 15, 2018

@Mitrofanov I have to apologize, bug still there 😔
image

I'm checking code right now, I'll keep you posted. Sorry again and thanks for your patience

@gbrian
Copy link
Owner

gbrian commented May 15, 2018

@Mitrofanov ,
I can not see this behavior with the latest version 🤔 please, remember to restart grafana after updating the plugin.
image

@Mitrofanov
Copy link

Mitrofanov commented May 15, 2018

@gbrian Very strange. Just checked again- this bug seems fixed to me but no data on graph again. This is query inspector response:

{
  "xhrStatus": "complete",
  "request": {
    "method": "POST",
    "url": "api/datasources/proxy/8/run",
    "data": {
      "sheet": [
        ".es(*)"
      ],
      "time": {
        "from": "2018-05-15T15:59:17 +0300",
        "interval": "auto",
        "mode": "absolute",
        "timezone": "GMT",
        "to": "2018-05-15T21:59:17 +0300"
      }
    }
  },
  "response": {
    "_index": "api",
    "_type": "timelion",
    "_id": "run",
    "_version": 45,
    "result": "updated",
    "_shards": {
      "total": 2,
      "successful": 2,
      "failed": 0
    },
    "_seq_no": 44,
    "_primary_term": 1
  }
}

@gbrian
Copy link
Owner

gbrian commented May 15, 2018

Dammit!
@Mitrofanov , Please post Chrome/Firefox Network view and check Preview tab you must see something like

image

@Mitrofanov
Copy link

@gbrian Here it is:
screen shot 2018-05-16 at 08 10 32

@gbrian
Copy link
Owner

gbrian commented May 16, 2018

@Mitrofanov
😥 It seems to be posting to an ES index... check if an "api" index has been created on your ES.
Please be sure your Timelion's plugin setup is in the form of: http://192.168.182.186:5601/api/timelion
image

Take care: the port is the Kibana's port 5601 or your specific, do not point to ES port 9200
BTW please post the Headers section as well (removing sensitive data)

@Mitrofanov
Copy link

Mitrofanov commented May 16, 2018

@gbrian Looks like this issues related to AWS ES setup. Let me explain:
In AWS ES service has a build-in kibana. All that stuff are available via single port (443), but uses different locations (/_plugin/kibana/app/kibana for kibana; / for ES). Also i don't nave api index in ES (as soon as nobody uses that). Here is my timelion config settings in Kibana (may be it would be helpful):
screen shot 2018-05-16 at 09 40 33

@gbrian
Copy link
Owner

gbrian commented May 16, 2018

@Mitrofanov ok!

So, the best way to know which URL to use is to spy kibana's Timelion page:
image

Copy paste that url and fingers crossed there's no CORS restriction in place 😨

@Mitrofanov
Copy link

@gbrian Another round: i checked URI and it appears to be like follow: /_plugin/kibana/api/timelion/run. But i get 404 if i run queries against it:

{
  "xhrStatus": "complete",
  "request": {
    "method": "POST",
    "url": "api/datasources/proxy/8/run",
    "data": {
      "sheet": [
        ".es(*)"
      ],
      "time": {
        "from": "2018-05-16T05:59:50 +0300",
        "interval": "auto",
        "mode": "absolute",
        "timezone": "GMT",
        "to": "2018-05-16T11:59:50 +0300"
      }
    }
  },
  "response": {
    "statusCode": 404,
    "error": "Not Found",
    "message": "Not Found"
  }
}

Could be it something not related to CORS, or in another case looks like it's our finish here.

@repofunding
Copy link

Never surrender, CORS does not apply in proxy mode and i realized your using this mode 👍
Just try to reach the whole url from your browser:
http://ec....amazon.../...//_plugin/kibana/api/timelion/run
If its directly accesible will get some error back about the http method used
Good luck

@gbrian
Copy link
Owner

gbrian commented May 16, 2018

Ops. Wrong account above!

@Mitrofanov
Copy link

@gbrian Now i got 400 error on run POST

@gbrian
Copy link
Owner

gbrian commented May 17, 2018

@Mitrofanov ,

I set up an ES on amazon but need to know your configuration. (https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-ac.html)
If it's open or you can share with me( temporary login) I'll be glad on checking and test myself, as I'm really curious about this issue.

BTW is grafana running on AWS as well?
Thanks.

@Mitrofanov
Copy link

@gbrian So i can tell you my config:
My ES running inside of VPC. Access control allows all from such VPC to access it:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:*****:******:domain/*****-es6/*"
    }
  ]
}

Grafana runs on ECS cluster in docker within the same VPC (so no connectivity issues here). Also we do have a lot of dashboards with ES datasource in this grafana, and they works well.

@phillbaker
Copy link

Just following up on this. Would be interested in a similar set up - AWS ES cluster running in a VPC with grafana hosted in the same VPC (probably not on ECS though).

Any luck getting the queries to run correctly or figuring out the networking issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants