Not able to login into elastic enterprise search

I am using elasticsearch and enterprise search version 7.9.2

I was able to successfully connect to app search without enabling elasticssearch security. Since workplace search requires security, after enabling I am not able login.

I tried following:

removed all enterprise search software to reinstall it a new

sudo apt purge enterprise-search
# removed directories
# /usr/share/enterprise-search
# /var/log/enterprise-search

Installed elasticsearch with security enabled, created password with sudo bin/elasticsearch-setup-passwords auto.

Installed enterprise search and started it:
sudo /usr/share/enterprise-search/bin/enterprise-search

logs, could not find password in the log.

Enterprise Search is starting...
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules (file:/usr/share/enterprise-search/lib/war/lib/jruby-core-9.2.9.0-complete.jar) to method sun.nio.ch.NativeThread.signal(long)
WARNING: Please consider reporting this to the maintainers of com.headius.backport9.modules.Modules
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Creating log directory: /usr/share/enterprise-search/log
[2020-10-08T06:40:29.177+00:00][12034][2002][app-server][INFO]: Enterprise Search version=7.9.2, JRuby version=9.2.9.0, Ruby version=2.5.7, Rails version=4.2.11.3
[2020-10-08T06:40:29.727+00:00][12034][2002][app-server][INFO]: Successfully connected to Elasticsearch
[2020-10-08T06:40:46.133+00:00][12034][2002][app-server][INFO]: [db_lock] [installation] Status: [Starting] Ensuring migrations tracking index exists
[2020-10-08T06:40:46.315+00:00][12034][2002][app-server][INFO]: [db_lock] [installation] Status: [Finished] Ensuring migrations tracking index exists
[2020-10-08T06:40:47.429+00:00][12034][2002][app-server][INFO]: Enterprise Search indices are ready
[2020-10-08T06:40:47.432+00:00][12034][2002][app-server][INFO]: [db_lock] [installation] Status: [Starting] Creating a default Elasticsearch cluster configuration record
[2020-10-08T06:40:47.627+00:00][12034][2002][app-server][INFO]: [db_lock] [installation] Status: [Finished] Creating a default Elasticsearch cluster configuration record
[2020-10-08T06:40:50.527+00:00][12034][2002][app-server][INFO]: Starting HTTP server...
2020-10-08 09:40:50.559:INFO::main: Logging initialized @36966ms to org.eclipse.jetty.util.log.StdErrLog
[2020-10-08T06:40:50.572+00:00][12034][2002][app-server][INFO]: Invoking Jetty Runner with the following params: ["--host", "0.0.0.0", "--port", "3002", "--config", "/usr/share/enterprise-search/lib/war/WEB-INF/webserver.xml", "/usr/share/enterprise-search/lib/war"]
WARNING: jetty-runner is deprecated.
         See Jetty Documentation for startup options
         https://www.eclipse.org/jetty/documentation/
2020-10-08 09:40:50.575:INFO:oejr.Runner:main: Runner
2020-10-08 09:40:50.977:INFO:oejs.Server:main: jetty-9.4.30.v20200611; built: 2020-06-11T12:34:51.929Z; git: 271836e4c1f4612f12b7bb13ef5a92a927634b0d; jvm 11.0.8+10-post-Debian-1deb10u1
2020-10-08 09:40:51.256:WARN:oeja.AnnotationParser:main: Unrecognized ASM version, assuming ASM7
2020-10-08 09:40:51.874:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=615ms
2020-10-08 09:40:52.062:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2020-10-08 09:40:52.062:INFO:oejs.session:main: No SessionScavenger set, using defaults
2020-10-08 09:40:52.064:INFO:oejs.session:main: node0 Scavenging every 600000ms
jruby: warning: unknown property jruby.worker.thread.count
2020-10-08 09:40:52.085:INFO:oejshC.ROOT:main: INFO: jruby 9.2.9.0 (2.5.7) 2019-10-30 458ad3e OpenJDK 64-Bit Server VM 11.0.8+10-post-Debian-1deb10u1 on 11.0.8+10-post-Debian-1deb10u1 +jit [linux-x86_64]
2020-10-08 09:40:52.087:INFO:oejshC.ROOT:main: INFO: using a shared (threadsafe!) runtime
[2020-10-08T06:40:58.160+00:00][12034][2194][app-server][INFO]: Enterprise Search version=7.9.2, JRuby version=9.2.9.0, Ruby version=2.5.7, Rails version=4.2.11.3
[2020-10-08T06:40:58.559+00:00][12034][2194][app-server][INFO]: Successfully connected to Elasticsearch
[2020-10-08T06:41:12.230+00:00][12034][2194][app-server][INFO]: 

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

Success! Elastic Enterprise Search is starting successfully.

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

* URL: http://search-1.test.kfupm.edu.sa:3002
  * If this is your first time starting Enterprise Search, check the console output above for your user authentication credentials.
  * Visit the documentation: https://www.elastic.co/guide/en/enterprise-search

Secret session key has been generated.

Set the key in your config file to persist user sessions through process restarts:

secret_session_key: 26b64fa4b93b1a6cd468b5784bbbe067b9611754af187ebf5198cc0dd761545600a26f8c63c43f982219dd29407ae28de12afd6d9c5ede2e7aad1b1a6854e521


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

Tried:

sudo ENT_SEARCH_DEFAULT_PASSWORD=password /usr/share/enterprise-search/bin/enterprise-search

But could not login with password:"password".

Logs generated at the time of login:

[2020-10-08T06:22:29.225+00:00][8100][2452][app-server][INFO]: [71e7e947-04a3-4353-8926-b50c9b76e087] Started POST "/authenticate/sign_in" for 10.14.206.28 at 2020-10-08 06:22:29 +0000
[2020-10-08T06:22:29.243+00:00][8100][2452][action_controller][INFO]: [71e7e947-04a3-4353-8926-b50c9b76e087] Processing by SharedTogo::AuthenticateController#login as */*
[2020-10-08T06:22:29.245+00:00][8100][2452][action_controller][INFO]: [71e7e947-04a3-4353-8926-b50c9b76e087]   Parameters: {"auth_strategy"=>"password", "user"=>{"email"=>"enterprise_search", "password"=>"[FILTERED]"}, "host"=>"search-1.test.kfupm.edu.sa:3002", "protocol"=>"http"}
[2020-10-08T06:22:29.303+00:00][8100][2452][action_view][INFO]: [71e7e947-04a3-4353-8926-b50c9b76e087]   Rendered text template (0.2ms)
[2020-10-08T06:22:29.307+00:00][8100][2452][action_controller][INFO]: [71e7e947-04a3-4353-8926-b50c9b76e087] Completed 403 Forbidden in 60ms (Views: 5.5ms)

Following this question, tried

sudo ENT_SEARCH_DEFAULT_PASSWORD=passwordexample /usr/share/enterprise-search/bin/enterprise-search --reset-auth

but I could not proceed to enter "y", bash shell freezed.

Found java executable in PATH
Java version detected: 11.0.8 (major version: 11)
Enterprise Search is starting...
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules (file:/usr/share/enterprise-search/lib/war/lib/jruby-core-9.2.9.0-complete.jar) to method sun.nio.ch.NativeThread.signal(long)
WARNING: Please consider reporting this to the maintainers of com.headius.backport9.modules.Modules
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[2020-10-08T06:47:31.021+00:00][12664][2002][script][INFO]: Enterprise Search version=7.9.2, JRuby version=9.2.9.0, Ruby version=2.5.7, Rails version=4.2.11.3
This operation will reset the password of the default user: enterprise_search.
Please confirm that you would like to continue [y/N]:

then tried:

y | sudo ENT_SEARCH_DEFAULT_PASSWORD=passwordexample /usr/share/enterprise-search/bin/enterprise-search --reset-auth

logs:

Enterprise Search is starting...
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules (file:/usr/share/enterprise-search/lib/war/lib/jruby-core-9.2.9.0-complete.jar) to method sun.nio.ch.NativeThread.signal(long)
WARNING: Please consider reporting this to the maintainers of com.headius.backport9.modules.Modules
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[2020-10-08T06:51:43.638+00:00][12805][2002][script][INFO]: Enterprise Search version=7.9.2, JRuby version=9.2.9.0, Ruby version=2.5.7, Rails version=4.2.11.3
This operation will reset the password of the default user: enterprise_search.
Please confirm that you would like to continue [y/N]:jaavedkhan@search-1:~$ 

this did not work either.

UPDATE:

this worked:

echo "y" | sudo ENT_SEARCH_DEFAULT_PASSWORD=passwordexample /usr/share/enterprise-search/bin/enterprise-search --reset-auth
# and then
sudo /usr/share/enterprise-search/bin/enterprise-search

1 Like

Thanks for posting what worked for you Jaaved!

bin/enterprise-search --reset-auth

is generally the right way to go. Very strange that your terminal/bash instance was freezing on y - hopefully not the case in the future, but the echo "y" | beforehand was super clever and definitely works!

Thanks for the tip!

I had the same problem with freezing terminal during password reset