Kibana Status Code : 302

Hi @vansh

Apologies that you have some challenges, but I can not really debug all these issues I would suggest taking some of our free training or perhaps someone else can help.

Your Basic License is not valid for all the feature you have enabled, I am not sure how all those features got enabled if you never got the cluster running.

I do not know if you already have data in the cluster, otherwise I would start from scratch with a single node / single kibana with all the defaults until you learn / are comfortable with configurations.

You could also deploy a small cluster in Elastic Cloud and you would have none of these issues.

Thanks Stephen for all your help !! really appreciate it :slight_smile:
Elasticsearch is running fine, but Kibana is still giving the 302 error , will try debugging more or as you suggested will try starting from scratch.

[2021-03-15T06:40:46,700][INFO ][o.e.n.Node               ] [cre-node1] initialized
[2021-03-15T06:40:46,701][INFO ][o.e.n.Node               ] [cre-node1] starting ...
[2021-03-15T06:40:46,753][INFO ][o.e.x.s.c.PersistentCache] [cre-node1] persistent cache index loaded
[2021-03-15T06:40:46,907][INFO ][o.e.t.TransportService   ] [cre-node1] publish_address {10.204.104.90:9300}, bound_addresses {0.0.0.0:9300}
[2021-03-15T06:40:47,569][INFO ][o.e.b.BootstrapChecks    ] [cre-node1] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2021-03-15T06:40:47,593][INFO ][o.e.c.c.Coordinator      ] [cre-node1] cluster UUID [Q1jbi0QkRGidUcMo4uD_9A]
[2021-03-15T06:40:47,838][INFO ][o.e.c.s.MasterService    ] [cre-node1] elected-as-master ([1] nodes joined)[{cre-node1}{MJl2F-JYQBGDcC7Z-lXr3Q}{-QKKTpfaSTyus-5yQ7LEWQ}{10.204.104.90}{10.204.104.90:9300}{cdhilmrstw}{ml.machine_memory=1927581696, xpack.installed=true, transform.node=true, ml.max_open_jobs=20, ml.max_jvm_size=964689920} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 6, version: 104, delta: master node changed {previous [], current [{cre-node1}{MJl2F-JYQBGDcC7Z-lXr3Q}{-QKKTpfaSTyus-5yQ7LEWQ}{10.204.104.90}{10.204.104.90:9300}{cdhilmrstw}{ml.machine_memory=1927581696, xpack.installed=true, transform.node=true, ml.max_open_jobs=20, ml.max_jvm_size=964689920}]}
[2021-03-15T06:40:48,050][INFO ][o.e.c.s.ClusterApplierService] [cre-node1] master node changed {previous [], current [{cre-node1}{MJl2F-JYQBGDcC7Z-lXr3Q}{-QKKTpfaSTyus-5yQ7LEWQ}{10.204.104.90}{10.204.104.90:9300}{cdhilmrstw}{ml.machine_memory=1927581696, xpack.installed=true, transform.node=true, ml.max_open_jobs=20, ml.max_jvm_size=964689920}]}, term: 6, version: 104, reason: Publication{term=6, version=104}
[2021-03-15T06:40:48,213][INFO ][o.e.h.AbstractHttpServerTransport] [cre-node1] publish_address {10.204.104.90:9200}, bound_addresses {0.0.0.0:9200}
[2021-03-15T06:40:48,214][INFO ][o.e.n.Node               ] [cre-node1] started
[2021-03-15T06:40:48,679][INFO ][o.e.l.LicenseService     ] [cre-node1] license [87bf7671-4ee4-46d9-969e-741d36417b09] mode [basic] - valid
[2021-03-15T06:40:48,681][INFO ][o.e.x.s.s.SecurityStatusChangeListener] [cre-node1] Active license is now [BASIC]; Security is disabled
[2021-03-15T06:40:48,685][INFO ][o.e.g.GatewayService     ] [cre-node1] recovered [6] indices into cluster_state
[2021-03-15T06:40:50,764][INFO ][o.e.c.r.a.AllocationService] [cre-node1] Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[.kibana-event-log-7.11.0-000001][0]]]

below are kibana logs

{"type":"log","@timestamp":"2021-03-15T06:41:16-05:00","tags":["info","plugins-service"],"pid":23732,"message":"Plugin \"visTypeXy\" is disabled."}
{"type":"log","@timestamp":"2021-03-15T06:41:17-05:00","tags":["warning","config","deprecation"],"pid":23732,"message":"Setting [elasticsearch.username] to \"kibana\" is deprecated. You should use the \"kibana_system\" user instead."}
{"type":"log","@timestamp":"2021-03-15T06:41:17-05:00","tags":["warning","config","deprecation"],"pid":23732,"message":"Config key [monitoring.cluster_alerts.email_notifications.email_address] will be required for email notifications to work in 8.0.\""}
{"type":"log","@timestamp":"2021-03-15T06:41:17-05:00","tags":["warning","config","deprecation"],"pid":23732,"message":"Setting [monitoring.username] to \"kibana\" is deprecated. You should use the \"kibana_system\" user instead."}
{"type":"log","@timestamp":"2021-03-15T06:41:17-05:00","tags":["info","plugins-system"],"pid":23732,"message":"Setting up [101] plugins: [taskManager,licensing,globalSearch,globalSearchProviders,code,usageCollection,xpackLegacy,telemetryCollectionManager,telemetry,telemetryCollectionXpack,kibanaUsageCollection,securityOss,newsfeed,mapsLegacy,kibanaLegacy,translations,bfetch,share,legacyExport,embeddable,uiActionsEnhanced,expressions,data,home,observability,console,consoleExtensions,apmOss,searchprofiler,painlessLab,grokdebugger,management,indexPatternManagement,advancedSettings,fileUpload,savedObjects,visualizations,visTypeTimelion,features,licenseManagement,dataEnhanced,visTypeVega,visTypeTable,visTypeMarkdown,tileMap,regionMap,mapsOss,lensOss,inputControlVis,graph,timelion,dashboard,dashboardEnhanced,visualize,charts,visTypeTimeseries,visTypeTimeseriesEnhanced,visTypeVislib,visTypeMetric,visTypeTagcloud,watcher,canvas,discover,discoverEnhanced,savedObjectsManagement,spaces,security,savedObjectsTagging,maps,lens,reporting,lists,encryptedSavedObjects,dashboardMode,cloud,upgradeAssistant,snapshotRestore,fleet,indexManagement,rollup,remoteClusters,crossClusterReplication,indexLifecycleManagement,enterpriseSearch,ml,beatsManagement,transform,ingestPipelines,eventLog,actions,alerts,triggersActionsUi,securitySolution,case,stackAlerts,infra,apm,monitoring,logstash,uptime,esUiShared]"}
{"type":"log","@timestamp":"2021-03-15T06:41:17-05:00","tags":["info","plugins","taskManager"],"pid":23732,"message":"TaskManager is identified by the Kibana UUID: 06152e09-f6ce-49e1-a3c9-0fcd5c3cc566"}
{"type":"log","@timestamp":"2021-03-15T06:41:17-05:00","tags":["warning","plugins","security","config"],"pid":23732,"message":"Generating a random key for xpack.security.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.security.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command."}
{"type":"log","@timestamp":"2021-03-15T06:41:17-05:00","tags":["warning","plugins","security","config"],"pid":23732,"message":"Session cookies will be transmitted over insecure connections. This is not recommended."}
{"type":"log","@timestamp":"2021-03-15T06:41:17-05:00","tags":["warning","plugins","reporting","config"],"pid":23732,"message":"Generating a random key for xpack.reporting.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.reporting.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command."}
{"type":"log","@timestamp":"2021-03-15T06:41:17-05:00","tags":["warning","plugins","reporting","config"],"pid":23732,"message":"Chromium sandbox provides an additional layer of protection, but is not supported for Linux Red Hat Linux 7.9 OS. Automatically setting 'xpack.reporting.capture.browser.chromium.disableSandbox: true'."}
{"type":"log","@timestamp":"2021-03-15T06:41:17-05:00","tags":["warning","plugins","encryptedSavedObjects","config"],"pid":23732,"message":"Generating a random key for xpack.encryptedSavedObjects.encryptionKey. To decrypt encrypted saved objects attributes after restart, please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command."}
{"type":"log","@timestamp":"2021-03-15T06:41:17-05:00","tags":["warning","plugins","fleet"],"pid":23732,"message":"Fleet APIs are disabled because the Encrypted Saved Objects plugin uses an ephemeral encryption key. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command."}
{"type":"log","@timestamp":"2021-03-15T06:41:18-05:00","tags":["warning","plugins","actions","actions"],"pid":23732,"message":"APIs are disabled because the Encrypted Saved Objects plugin uses an ephemeral encryption key. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command."}
{"type":"log","@timestamp":"2021-03-15T06:41:18-05:00","tags":["warning","plugins","alerts","plugins","alerting"],"pid":23732,"message":"APIs are disabled because the Encrypted Saved Objects plugin uses an ephemeral encryption key. Please set xpack.encryptedSavedObjects.encryptionKey in the kibana.yml or use the bin/kibana-encryption-keys command."}
{"type":"log","@timestamp":"2021-03-15T06:41:18-05:00","tags":["info","plugins","monitoring","monitoring"],"pid":23732,"message":"config sourced from: production cluster"}
{"type":"log","@timestamp":"2021-03-15T06:41:18-05:00","tags":["info","savedobjects-service"],"pid":23732,"message":"Waiting until all Elasticsearch nodes are compatible with Kibana before starting saved objects migrations..."}
{"type":"log","@timestamp":"2021-03-15T06:41:18-05:00","tags":["info","savedobjects-service"],"pid":23732,"message":"Starting saved objects migrations"}
{"type":"log","@timestamp":"2021-03-15T06:41:19-05:00","tags":["info","plugins-system"],"pid":23732,"message":"Starting [101] plugins: [taskManager,licensing,globalSearch,globalSearchProviders,code,usageCollection,xpackLegacy,telemetryCollectionManager,telemetry,telemetryCollectionXpack,kibanaUsageCollection,securityOss,newsfeed,mapsLegacy,kibanaLegacy,translations,bfetch,share,legacyExport,embeddable,uiActionsEnhanced,expressions,data,home,observability,console,consoleExtensions,apmOss,searchprofiler,painlessLab,grokdebugger,management,indexPatternManagement,advancedSettings,fileUpload,savedObjects,visualizations,visTypeTimelion,features,licenseManagement,dataEnhanced,visTypeVega,visTypeTable,visTypeMarkdown,tileMap,regionMap,mapsOss,lensOss,inputControlVis,graph,timelion,dashboard,dashboardEnhanced,visualize,charts,visTypeTimeseries,visTypeTimeseriesEnhanced,visTypeVislib,visTypeMetric,visTypeTagcloud,watcher,canvas,discover,discoverEnhanced,savedObjectsManagement,spaces,security,savedObjectsTagging,maps,lens,reporting,lists,encryptedSavedObjects,dashboardMode,cloud,upgradeAssistant,snapshotRestore,fleet,indexManagement,rollup,remoteClusters,crossClusterReplication,indexLifecycleManagement,enterpriseSearch,ml,beatsManagement,transform,ingestPipelines,eventLog,actions,alerts,triggersActionsUi,securitySolution,case,stackAlerts,infra,apm,monitoring,logstash,uptime,esUiShared]"}
{"type":"log","@timestamp":"2021-03-15T06:41:21-05:00","tags":["info","plugins","watcher"],"pid":23732,"message":"Your basic license does not support watcher. Please upgrade your license."}
{"type":"log","@timestamp":"2021-03-15T06:41:21-05:00","tags":["info","plugins","crossClusterReplication"],"pid":23732,"message":"Your basic license does not support crossClusterReplication. Please upgrade your license."}
{"type":"log","@timestamp":"2021-03-15T06:41:21-05:00","tags":["info","plugins","monitoring","monitoring","kibana-monitoring"],"pid":23732,"message":"Starting monitoring stats collection"}
{"type":"log","@timestamp":"2021-03-15T06:41:23-05:00","tags":["info","http","server","Kibana"],"pid":23732,"message":"http server running at http://0.0.0.0:5601"}
{"type":"log","@timestamp":"2021-03-15T06:41:22-05:00","tags":["listening","info"],"pid":23732,"message":"Server running at http://0.0.0.0:5601"}
{"type":"log","@timestamp":"2021-03-15T06:41:24-05:00","tags":["warning","plugins","reporting"],"pid":23732,"message":"Enabling the Chromium sandbox provides an additional layer of protection."}
{"type":"response","@timestamp":"2021-03-15T06:52:38-05:00","tags":[],"pid":23732,"method":"get","statusCode":302,"req":{"url":"/","method":"get","headers":{"accept-encoding":"gzip;q=1.0,deflate;q=0.6,identity;q=0.3","accept":"*/*","user-agent":"Ruby","connection":"close","host":"localhost:5601"},"remoteAddress":"127.0.0.1","userAgent":"Ruby"},"res":{"statusCode":302,"responseTime":104,"contentLength":9},"message":"GET / 302 104ms - 9.0B"}

Actually the 302 Response Code is not an error is is the intended , designed behavior it's just a HTTP Found Code for a redirect from the Kibana root URL to the correct URL, is there an issue that is causing you?

If you use a proper path and header you will get a 200, but it will result in a bunch of content because it is a web page

$ curl -i -H "Accept: */*" http://localhost:5601/app/home 
HTTP/1.1 200 OK
content-type: text/html; charset=utf-8
content-security-policy: script-src 'unsafe-eval' 'self'; worker-src blob: 'self'; style-src 'unsafe-inline' 'self'
kbn-name: kibana
kbn-license-sig: 8edffb183e7306a5f3348dd7ff491f3b8538027992bdee1f57e821202eb24146
cache-control: private, no-cache, no-store, must-revalidate
content-length: 126029
vary: accept-encoding
accept-ranges: bytes
Date: Mon, 15 Mar 2021 14:41:54 GMT
Connection: keep-alive
Keep-Alive: timeout=120
....

If you actually tell curl to do the redirect you can see it happen.

$  curl -i -L -H "Accept: */*" http://localhost:5601/
HTTP/1.1 302 Found
location: /spaces/enter
kbn-name: kibana
kbn-license-sig: 8edffb183e7306a5f3348dd7ff491f3b8538027992bdee1f57e821202eb24146
cache-control: private, no-cache, no-store, must-revalidate
content-length: 0
Date: Mon, 15 Mar 2021 14:46:49 GMT
Connection: keep-alive
Keep-Alive: timeout=120

HTTP/1.1 302 Found
location: /app/home
kbn-name: kibana
kbn-license-sig: 8edffb183e7306a5f3348dd7ff491f3b8538027992bdee1f57e821202eb24146
cache-control: private, no-cache, no-store, must-revalidate
content-length: 0
Date: Mon, 15 Mar 2021 14:46:49 GMT
Connection: keep-alive
Keep-Alive: timeout=120

HTTP/1.1 200 OK
content-type: text/html; charset=utf-8
content-security-policy: script-src 'unsafe-eval' 'self'; worker-src blob: 'self'; style-src 'unsafe-inline' 'self'
kbn-name: kibana
kbn-license-sig: 8edffb183e7306a5f3348dd7ff491f3b8538027992bdee1f57e821202eb24146
cache-control: private, no-cache, no-store, must-revalidate
content-length: 126029
vary: accept-encoding
accept-ranges: bytes
Date: Mon, 15 Mar 2021 14:46:49 GMT
Connection: keep-alive
Keep-Alive: timeout=120

<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/><meta name="viewport" content="width=device-width"/><title>Elastic</title><style>
.....

If you have authentication enabled you can use

$  curl -i -H "Accept: */*"  https://localhost:5601/login
HTTP/2 200 
accept-ranges: bytes
....
1 Like

Yes that is what I am getting . So what is it that I need to correct ??

$ curl -i -L -H "Accept: */*" http://10.204.104.90:5601/
HTTP/1.1 302 Found
location: /spaces/enter
kbn-name: CRE-KIBANA
kbn-license-sig: fbf2b98444840abad7b90502afce0ea4044fc4cdd844f93abfa42ec79ac70160
cache-control: private, no-cache, no-store, must-revalidate
content-length: 0
Date: Mon, 15 Mar 2021 15:16:20 GMT
Connection: keep-alive
Keep-Alive: timeout=120

HTTP/1.1 302 Found
location: /app/home
kbn-name: CRE-KIBANA
kbn-license-sig: fbf2b98444840abad7b90502afce0ea4044fc4cdd844f93abfa42ec79ac70160
cache-control: private, no-cache, no-store, must-revalidate
content-length: 0
Date: Mon, 15 Mar 2021 15:16:20 GMT
Connection: keep-alive
Keep-Alive: timeout=120

HTTP/1.1 200 OK
content-type: text/html; charset=utf-8
content-security-policy: script-src 'unsafe-eval' 'self'; worker-src blob: 'self'; style-src 'unsafe-inline' 'self'
kbn-name: CRE-KIBANA
kbn-license-sig: fbf2b98444840abad7b90502afce0ea4044fc4cdd844f93abfa42ec79ac70160
cache-control: private, no-cache, no-store, must-revalidate
content-length: 125834
vary: accept-encoding
accept-ranges: bytes
Date: Mon, 15 Mar 2021 15:16:20 GMT
Connection: keep-alive
Keep-Alive: timeout=120

<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/><meta name="viewport" content="width=device-width"/><title>Elastic</title><style>

You do not need to correct anything the 302 means Kibana is functioning fine / as designed.

The 302 is exactly what http://10.204.104.90:5601/ is supposed to return

Why are you so concerned with the 302... are you trying to perform a Health check or Something? Is your browser not redirecting?

Kibana is a web app in general you don't interact with it with curl.

If you want to get to the elasticsearch data then you need to use the elasticsearch url.

I am not concerned with 302, but that is all i get in logs .
I cannot access Kibana through browser .
as i had mentioned in the starting while going to this link http://10.204.104.90:5601/
I get the below message:

This site can’t be reached

10.204.104.90 took too long to respond.

Try:

ERR_CONNECTION_TIMED_OUT

in browser http://10.204.104.90:9200/ this link gives the intended response

{
  "name" : "cre-node1",
  "cluster_name" : "cre-cluster",
  "cluster_uuid" : "Q1jbi0QkRGidUcMo4uD_9A",
  "version" : {
    "number" : "7.11.1",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "ff17057114c2199c9c1bbecc727003a907c0db7a",
    "build_date" : "2021-02-15T13:44:09.394032Z",
    "build_snapshot" : false,
    "lucene_version" : "8.7.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

but 5601 is not working .

That is something else not related to the 302... did that curl command result in a lot of output... if so kibana is fine.

Are you running the curl from the same box you are trying kibana through the browser?

if so, You most likely have an issue with your browser settings, some network, firewall settings, are you using a proxy etc. but Kibana is fine that is what the logs and curl are saying.

yes, we have VPN in our system and there was a lot of log after running the curl command.
we have Kibana installed on one of our other servers, and i can access it with no issues through browser.

Flush your browser history, cookies etc.... Not sure what to tell you ... it appears you have a connectivity issue between your browser and kibana... Timeout means the browser can get there....The curl command shows kibana is fine.

hmm, i have tried all that, nothing is working. Is there anything that needs to be set in kibana or elasticsearch. yml for it ???

this is the crux of my yml files:
Elasticsearch:

cluster.initial_master_nodes: 
  - cre-node1
cluster.name: cre-cluster
discovery.seed_hosts: 
  - "10.204.104.90"
  - "192.168.0.10"
network.host: "0.0.0.0"
node.name: cre-node1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch

Kibana:

elasticsearch.hosts: 
  - "http://10.204.104.90:9200"
elasticsearch.password: kibana
elasticsearch.ssl.verificationMode: certificate
elasticsearch.username: kibana
server.host: "0.0.0.0"
server.name: CRE-KIBANA

I Don't know... when you find it we will be both... Oh Shoot of Course!

You can try turning on the Dev / Debug tools in Chrome or Firefox and see what is happening...

Did you try from someone elses Browser?

lol, true.
I tried that too, it says timeout. not sure what is the issue.
ya ,I did , others are getting the same result .

I have an Idea.... Just for a test...

Try to put Kibana on your desktop (where your browser is) and point that Kibana to the elasticsearch cluster / instance and see what happens should only take a few minutes just download unzip / untar set the settings and try hitting the local Kibana, just to see what happens.

Thanks Bhavya...That worked like a charm in incognito window.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.