koushii
(koushii)
June 2, 2024, 10:21am
1
Hey Everyone,
I'm stuck at a point of importing dashboard(ndjson) file which I exported into kibana using API.
I've tried below commands as per AWS Official documentation.
curl -X POST https://<kibana_URL>/_plugin/kibana/auth/login -H "kbn-xsrf: true" -H "content-type:application/json" -d '{"username":"user", "password" : "pass"} ' -c auth.txt
curl -X POST https://<kibana_URL>/_plugin/kibana/api/saved_objects/_import -H "kbn-xsrf:true" -b auth.txt --form file=@test.ndjson
I'm able to login and export the dashboard. But when i try to import it's giving below error.
It was taking 1 min of time and later throwing below error. Even for very small dashboards as well it's the same error.
Can some one please help me. Stuck at this point since 3 restless days.
====================
We are completely uploaded and fine
< HTTP/1.1 504 Gateway Time-out
< Server: nginx
< Date: Sun, 02 Jun 2024 10:12:08 GMT
< Content-Type: text/html
< Content-Length: 160
< Connection: keep-alive
<
504 Gateway Time-out
504 Gateway Time-out
nginx
* Connection #0 to host left intact
==============
koushii
(koushii)
June 2, 2024, 10:22am
2
I'm able to import this via UI. The issue i'm facing from is via API.
dadoonet
(David Pilato)
June 2, 2024, 2:22pm
3
Welcome!
What do you mean? Kibana is made by elastic.
Sounds like the error message is from nginx and not Kibana. I suspect that you are not running a real version of Kibana. Which version is Elasticsearch?
koushii
(koushii)
June 2, 2024, 6:47pm
4
Hey, Thanks for your swift response.
The version I'm using is 7.9
dadoonet
(David Pilato)
June 2, 2024, 7:26pm
5
Upgrade to 7.17 at least or 8.13.4.
koushii
(koushii)
June 2, 2024, 8:33pm
6
You are saying error is w.r.t nginx. How could version upgrade solve this issue.
Please let me know
dadoonet
(David Pilato)
June 2, 2024, 8:50pm
7
I don't know if it will solve your issue. Probably not, but at least you will use a "safe" version and not an outdated one.
koushii
(koushii)
June 3, 2024, 4:03am
8
I was able to import dashboards from UI. But when I try from kibana import api
https://<kibana_URL>/_plugin/kibana/api/saved_objects/_import
Then I'm facing this issue. I wonder that import API worked some time for me and later it started giving this error.
koushii
(koushii)
June 3, 2024, 4:34am
9
On executing below approach it seems like I was able to send the ndjson file to kibana. But Kibana was unable to process.
curl -X POST -v <kibana_URL>/_plugin/kibana/api/saved_objects/_import -H "kbn-xsrf:true" -b auth.txt --form file=@test.ndjson
===================================
Note: Unnecessary use of -X or --request, POST is already inferred.
Host <kibana_URL>:443 was resolved.
IPv6: (none)
IPv4: 13.54.149.250
Trying 13.54.149.250:443...
Connected to <kibana_URL> (13.54.149.250) port 443
ALPN: curl offers h2,http/1.1
(304) (OUT), TLS handshake, Client hello (1):
CAfile: /etc/ssl/cert.pem
CApath: none
(304) (IN), TLS handshake, Server hello (2):
(304) (IN), TLS handshake, Unknown (8):
(304) (IN), TLS handshake, Certificate (11):
(304) (IN), TLS handshake, CERT verify (15):
(304) (IN), TLS handshake, Finished (20):
(304) (OUT), TLS handshake, Finished (20):
SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384 / [blank] / UNDEF
ALPN: server accepted http/1.1
Server certificate:
subject: C=GB; L=London; O=IMImobile Limited; CN=*.imiconnect.com
start date: Sep 20 00:00:00 2023 GMT
expire date: Oct 20 23:59:59 2024 GMT
issuer: C=US; O=DigiCert Inc; CN=DigiCert Global G2 TLS RSA SHA256 2020 CA1
SSL certificate verify ok.
using HTTP/1.x
POST /_plugin/kibana/api/saved_objects/_import HTTP/1.1
User-Agent: curl/8.6.0
Accept: /
Cookie: security_authentication=Fe26.2**10139ab39834bb569f5b843f0aef738a7bb640410d82033483b7H3dqsxNMSWnu3sKKxPijZpIq2kGb4ZqeQOQW20ZdBagwAvMDO-CeP8lEvwM1caefeed253eb76298c0d4015270e4455480bfb597265fa8bea6b4321f14b6*iwasJTjQKfrRiw3r2GQYrjPv9w_wtMgSdBy6Ubjt7GA
kbn-xsrf:true
Content-Length: 23644
Content-Type: multipart/form-data; boundary=------------------------5DKENfBvBQAP78uMqgiNOT
We are completely uploaded and fine
< HTTP/1.1 504 Gateway Time-out
< Server: nginx
< Date: Sun, 02 Jun 2024 10:12:08 GMT
< Content-Type: text/html
< Content-Length: 160
< Connection: keep-alive
<
504 Gateway Time-out
504 Gateway Time-out
nginx
Connection #0 to host <Kibana_URL> left intact
===================================
dadoonet
(David Pilato)
June 3, 2024, 6:47am
10
Do you have nginx running? Could directly call kibana instead ?
Also check the content-type. You are not providing it when running the curl command.