# Unable to login

**URL:** https://discuss.elastic.co/t/unable-to-login/257605
**Category:** Elastic Search
**Created:** [December 4, 2020, 4:13am UTC](https://discuss.elastic.co/t/unable-to-login/257605 "2020-12-04T04:13:36Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![georgina](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@georgina](https://discuss.elastic.co/u/georgina)
#### Post date: [December 4, 2020, 4:13am UTC](https://discuss.elastic.co/t/unable-to-login/257605/1 "2020-12-04T04:13:36Z")

</div>

Hi,

I've just installed Elasticsearch, Kibana and Enterprise Search via docker on desktop.  
It is a three node elastic cluster with Kibana and enterprise search [https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.html#get-started-docker-tls](https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.html)

I can see in the logs

```auto
#########################################################

Success! Elastic Enterprise Search is starting successfully.

In a few moments, you'll be able to login at the following address:

 * URL: http://localhost:3002
 * If this is your first time starting Enterprise Search, check the console output above for your user authentication credentials.

    etc

#########################################################

```

and also

```auto
#########################################################
***Default user credentials have been setup. These are only printed once, so please ensure they are recorded.***

username: enterprise_search
password: ****

#########################################################

```

However when I attempt to access [https://localhost:3002/login](https://localhost:3002/login)  
using the enterprise\_search user and password from the console I get "Username or password is incorrect"

The password displayed is the same as ENT\_SEARCH\_DEFAULT\_PASSWORD from the docker compose file.

I've also tried the elastic password, but same result "Username or password is incorrect"

I've checked the log files and there isn't anything useful in there.

Any ideas?

Thanks Georgina

---

<div class="post-metadata">

### Author: ![georgina](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@georgina](https://discuss.elastic.co/u/georgina)
#### Post date: [December 4, 2020, 4:40am UTC](https://discuss.elastic.co/t/unable-to-login/257605/2 "2020-12-04T04:40:12Z")

</div>

Additionally I have tried the docker compose files at

> [@Enterprise Search 7.x - Docker Compose example](https://discuss.elastic.co/t/enterprise-search-docker-compose-example/239782):
>
> Here is a simple way to start Enterprise Search (App Search and Workplace Search) with docker-compose. Elasticsearch File: docker-compose-elasticsearch.yml --- version: '3' services: elasticsearch: image: $IMG\_ELASTICSEARCH:$ELASTIC\_VERSION environment: - bootstrap.memory\_lock=true - discovery.type=single-node - "ES\_JAVA\_OPTS=-Xms3g -Xmx3g" - cluster.routing.allocation.disk.threshold\_enabled=false - ELASTIC\_PASSWORD=$ELASTIC\_PASSWORD - xpack.secu…

And when everything has started  
Open [http://localhost:3002](http://localhost:3002/) and attempted to login with `enterprise_search` / `changeme` account.

with the same result "Username or password is incorrect".

---

<div class="post-metadata">

### Author: ![MadsOhm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/madsohm/32/69154_2.png) [@MadsOhm](https://discuss.elastic.co/u/MadsOhm)
#### Post date: [December 4, 2020, 10:42am UTC](https://discuss.elastic.co/t/unable-to-login/257605/3 "2020-12-04T10:42:28Z")

</div>

That's really weird. Can you paste the Dockerfile / Docker compose file you're using (without your password, of course)?

Did you change anything from David's post? I just followed his walkthrough of using docker-compose and it worked beautifully.

---

<div class="post-metadata">

### Author: ![georgina](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@georgina](https://discuss.elastic.co/u/georgina)
#### Post date: [December 7, 2020, 3:11am UTC](https://discuss.elastic.co/t/unable-to-login/257605/4 "2020-12-07T03:11:46Z")

</div>

I used David's files exactly as is, simply copy/pasted into new files on my local computer and ran  
` docker-compose -f docker-compose.yml -f docker-compose-enterprise-search.yml up`

I have found the following lines in the logs that suggest a problem when attempting to login as enterprise\_search. However, I'm not sure how to fix it.

```auto
enterprisesearch_1 | [2020-12-07T02:56:51.687+00:00][1][2512][app-server][INFO]: [d315be3b-f601-4318-b644-d542a17a9d18] Started POST "/authenticate/sign_in" for 172.25.0.1 at 2020-12-07 02:56:51 +0000
enterprisesearch_1 | [2020-12-07T02:56:51.698+00:00][1][2512][action_controller][INFO]: [d315be3b-f601-4318-b644-d542a17a9d18] Processing by SharedTogo::AuthenticateController#login as */*
enterprisesearch_1 | [2020-12-07T02:56:51.699+00:00][1][2512][action_controller][INFO]: [d315be3b-f601-4318-b644-d542a17a9d18] Parameters: {"auth_strategy"=>"password", "user"=>{"email"=>"enterprise_search", "password"=>"[FILTERED]"}, "host"=>"localhost:3002", "protocol"=>"http"}
enterprisesearch_1 | [2020-12-07T02:56:51.703+00:00][1][2512][action_controller][WARN]: [d315be3b-f601-4318-b644-d542a17a9d18] Can't verify CSRF token authenticity
enterprisesearch_1 | [2020-12-07T02:56:51.705+00:00][1][2512][action_controller][INFO]: [d315be3b-f601-4318-b644-d542a17a9d18] Completed 422 Unprocessable Entity in 5ms
enterprisesearch_1 | [2020-12-07T02:56:51.714+00:00][1][2512][app-server][ERROR]: [d315be3b-f601-4318-b644-d542a17a9d18] Exception: ActionController::InvalidAuthenticityToken: ActionController::InvalidAuthenticityToken
enterprisesearch_1 | /usr/share/enterprise-search/lib/war/gems/gems/actionpack-4.2.11.3/lib/action_controller/metal/request_forgery_protection.rb:181:in `handle_unverified_request': ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken)
enterprisesearch_1 | from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-4.2.11.3/lib/action_controller/metal/request_forgery_protection.rb:209:in `handle_unverified_request'
enterprisesearch_1 | from /usr/share/enterprise-search/lib/war/gems/gems/devise-4.7.1/lib/devise/controllers/helpers.rb:255:in `handle_unverified_request'
enterprisesearch_1 | from /usr/share/enterprise-search/lib/war/gems/gems/actionpack-4.2.11.3/lib/action_controller/metal/request_forgery_protection.rb:204:in `verify_authenticity_token'

```

docker-compose.yml

```auto
version: '3'
services:

  elasticsearch:
    image: $IMG_ELASTICSEARCH:$ELASTIC_VERSION
    environment:
      - bootstrap.memory_lock=true
      - discovery.type=single-node
      - "ES_JAVA_OPTS=-Xms3g -Xmx3g"
      - cluster.routing.allocation.disk.threshold_enabled=false
      - ELASTIC_PASSWORD=$ELASTIC_PASSWORD
      - xpack.security.enabled=true
      - xpack.security.authc.api_key.enabled=true
      - xpack.ml.enabled=false
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports: ["$ELASTICSEARCH_PORT:$ELASTICSEARCH_PORT"]
    networks: ['fscrawler_it']

networks:
  fscrawler_it: {}

```

docker-compose-enterprise-search.yml

```auto
version: '3'
services:

  enterprisesearch:
    image: $IMG_ENTERPRISE_SEARCH:$ELASTIC_VERSION
    environment:
      - "ent_search.auth.source=standard"
      - "elasticsearch.username=elastic"
      - "elasticsearch.password=$ELASTIC_PASSWORD"
      - "elasticsearch.host=http://elasticsearch:9200"
      - "allow_es_settings_modification=true"
      - "secret_management.encryption_keys=[XYZ]"
      - "ENT_SEARCH_DEFAULT_PASSWORD=$ELASTIC_PASSWORD"
    ports: ["$ENTERPRISE_SEARCH_PORT:$ENTERPRISE_SEARCH_PORT"]
    networks: ['fscrawler_it']
    links: ['elasticsearch']
    depends_on: ['elasticsearch']
    restart: always

networks:
  fscrawler_it: {}

```

.env

```auto
# Elastic Stack settings
ELASTIC_VERSION=7.10.0
ELASTIC_PASSWORD=changeme

# Elasticsearch settings
IMG_ELASTICSEARCH=docker.elastic.co/elasticsearch/elasticsearch
ELASTICSEARCH_PORT=9200

# Enterprise Search settings
IMG_ENTERPRISE_SEARCH=docker.elastic.co/enterprise-search/enterprise-search
ENTERPRISE_SEARCH_PORT=3002

```

---

<div class="post-metadata">

### Author: ![MadsOhm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/madsohm/32/69154_2.png) [@MadsOhm](https://discuss.elastic.co/u/MadsOhm)
#### Post date: [December 7, 2020, 7:11am UTC](https://discuss.elastic.co/t/unable-to-login/257605/5 "2020-12-07T07:11:59Z")

</div>

How are you connecting to the running instance? I see the IP `172.25.0.1` in there. Enterprise Search is running on your localhost. Are you visiting [http://localhost:3002](http://localhost:3002) in order to log in?

Do you have the latest docker images? Does it help to run `docker-compose pull`?

---

<div class="post-metadata">

### Author: ![georgina](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@georgina](https://discuss.elastic.co/u/georgina)
#### Post date: [December 8, 2020, 5:24am UTC](https://discuss.elastic.co/t/unable-to-login/257605/6 "2020-12-08T05:24:47Z")

</div>

Hi,

I am visiting [http://localhost:3002](http://localhost:3002/) , and I have run docker-compose pull to make sure I am running the latest docker images.  
I even tried changing version to 7.9.3 to see if a different version would be any different, but no.  
Same result and same error messages.

I am running docker desktop on windows, would that make a difference?

---

<div class="post-metadata">

### Author: ![MadsOhm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/madsohm/32/69154_2.png) [@MadsOhm](https://discuss.elastic.co/u/MadsOhm)
#### Post date: [December 8, 2020, 3:58pm UTC](https://discuss.elastic.co/t/unable-to-login/257605/7 "2020-12-08T15:58:37Z")

</div>

I just asked a colleague, who had an excellent idea. Maybe your browser is storing an old session cookie for the last instance you had running. Could you try and clear the `_st_togo_session` cookie in your browser and see if that helps?

---

<div class="post-metadata">

### Author: ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)
#### Post date: [December 8, 2020, 4:32pm UTC](https://discuss.elastic.co/t/unable-to-login/257605/8 "2020-12-08T16:32:34Z")

</div>

FWIW, I tried reproducing with a simplified docker-compose setup and could not:

```auto
---
version: '3'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.10.0
    environment:
      - "discovery.type=single-node"
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - "xpack.security.enabled=true"
      - "xpack.security.authc.api_key.enabled=true"
      - "ELASTIC_PASSWORD=changeme"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
    
  enterprisesearch:
    image: docker.elastic.co/enterprise-search/enterprise-search:7.10.0
    depends_on:
      - "elasticsearch"
    environment:
      - "ENT_SEARCH_DEFAULT_PASSWORD=changeme"
      - "elasticsearch.username=elastic"
      - "elasticsearch.password=changeme"
      - "elasticsearch.host=http://elasticsearch:9200"
      - "allow_es_settings_modification=true"
      - "secret_management.encryption_keys=[4a2cd3f81d39bf28738c10db0ca782095ffac07279561809eecc722e0c20eb09]"
      - "JAVA_OPTS=-Xms2g -Xmx2g"
    ports:
      - 3002:3002

```

Using the above, I was able to log in successfully with enterprise\_search / changeme.

---

<div class="post-metadata">

### Author: ![georgina](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@georgina](https://discuss.elastic.co/u/georgina)
#### Post date: [December 9, 2020, 4:21am UTC](https://discuss.elastic.co/t/unable-to-login/257605/9 "2020-12-09T04:21:08Z")

</div>

Clearing the `_st_togo_session` cookie did the trick.

So I am now able successfully login.

---

<div class="post-metadata">

### Author: ![V\_Adding](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@V\_Adding](https://discuss.elastic.co/u/V_Adding)
#### Post date: [January 25, 2021, 3:25pm UTC](https://discuss.elastic.co/t/unable-to-login/257605/10 "2021-01-25T15:25:36Z")

</div>

```auto

Hello,

I'm in the same situation. I can't log in with any user. I have tried to delete cookies but without success.

With the user enterprise_search I can log into ElasticSearch.

I have tried multiple versions of Enterprise Search without success. I've tried mapping the enterprise-search.yml file inside the volumes section, but it doesn't recognize it.

Any ideas?

```

---

<div class="post-metadata">

### Author: ![georgina](https://avatars.discourse-cdn.com/v4/letter/g/ba8739/32.png) [@georgina](https://discuss.elastic.co/u/georgina)
#### Post date: [January 28, 2021, 2:56am UTC](https://discuss.elastic.co/t/unable-to-login/257605/11 "2021-01-28T02:56:58Z")

</div>

Are you using a docker compose file as above?

---

<div class="post-metadata">

### Author: ![V\_Adding](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@V\_Adding](https://discuss.elastic.co/u/V_Adding)
#### Post date: [January 28, 2021, 7:23am UTC](https://discuss.elastic.co/t/unable-to-login/257605/12 "2021-01-28T07:23:57Z")

</div>

Hello Georgina,

My docker.compose is

* * *

enterprise-search:  
#image: [docker.elastic.co/enterprise-search/enterprise-search:7.10.1](http://docker.elastic.co/enterprise-search/enterprise-search:7.10.1)  
image: [docker.elastic.co/enterprise-search/enterprise-search:7.9.0](http://docker.elastic.co/enterprise-search/enterprise-search:7.9.0)  
container\_name: enterprise-search  
ports:  
- 3002:3002  
environment:  
- ENT\_SEARCH\_DEFAULT\_PASSWORD="4b4tj4zxnzp3bctv"  
- elasticsearch.host=http://elasticsearch:9200  
- elasticsearch.username="elastic"  
- elasticsearch.password="Admelastic"  
- allow\_es\_settings\_modification=true  
- secret\_management.encryption\_keys=[4a2cd3f81d39bf28738c10db0ca782095ffac07279561809eecc722e0c20eb09]  
- TZ=Europe/Madrid  
#volumes:  
# - /opt/appdata/enterprise-search:/usr/share/enterprise-search  
# - /opt/appdata/enterprise-search/config/enterprise-search.yml:/usr/share/enterprise-search/config/enterprise-search.yml

```
restart: on-failure

```

* * *

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [November 4, 2022, 8:19am UTC](https://discuss.elastic.co/t/unable-to-login/257605/13 "2022-11-04T08:19:02Z")

</div>


