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

Generation of database broken in current master, ElasticSearch errors #6783

Closed
TheOnlyJoey opened this issue Sep 22, 2017 · 15 comments
Closed
Assignees

Comments

@TheOnlyJoey
Copy link

When using current master (checkout d5e1d01) generation of database (php bin/console pim:installer:db --env=prod) errors out on ElasticSearch and does not continue generation of database.

foo@akeneo-dev:~/pim-community-dev$ php bin/console pim:installer:db --env=prod
Prepare database schema
Dropped database for connection named akeneo_pim
Created database akeneo_pim for connection named default
ATTENTION: This operation should not be executed in a production environment.

Creating database schema...
Database schema created successfully!
Nothing to update - your database is already in sync with the current entity metadata.
Reset elasticsearch indexes

[Elasticsearch\Common\Exceptions\NoNodesAvailableException]
No alive nodes found in your cluster

Installed using a combination of current information on master documentation on Ubuntu server 17.04

@KarenMayo
Copy link
Contributor

Hi @TheOnlyJoey,

This error is not coming from the PIM, but from Elasticsearch, it seems it doesn't find any alive nodes .

I'd suggest you, to have a look at the existing questions already raised on Elasticsearch forum concerning this error i.e:

elastic/elasticsearch-php#519
elastic/elasticsearch-php#300

Elasticsearch documentation:
https://www.elastic.co/start
https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started.html

I hope this information helps you!

Regards,
Karen

@KarenMayo KarenMayo self-assigned this Sep 25, 2017
@TheOnlyJoey
Copy link
Author

Hey Karen,

So i actually tried multiple version of ElasticSearch already and verified this was not a problem of my local version.
I also had contact with the ElasticSearch developers and they mention its probably the implementation in Akeneo that causes this.

The composer builds fine, so ElasticSearch has build and setup correctly.

I tested on 2 different systems (Ubuntu 16.04 and Debian Sid) and both had the exact same issue regardless of setup.

This error breaks Akeneo from generating a correct database, I think these types of errors are quite lethal a couple of days before release.

@KarenMayo
Copy link
Contributor

@TheOnlyJoey,

Could you share with us your system file information?

Thanks,
Karen

@TheOnlyJoey
Copy link
Author

Tested systems are (as mentioned) Ubuntu 16.04 with dependencies installed from the Akeneo documentation (from master) and Debian Sid with latest packages.

Also tested on Ubuntu 17.04 initially. All systems use PHP7.1 as recommended.

@KarenMayo
Copy link
Contributor

@TheOnlyJoey,

We think this could be a connection issue related as this error is usually appearing when using the default value for parameter 'index_hosts' ('localhost:9200').

The working config value is ':@:', by default 'elastic:changeme@localhost:9200' (edited)

You can find the 'index_hosts' param in app/config/parameters.yml

Regards,
Karen

@TheOnlyJoey
Copy link
Author

Changing the value to ':@:' results in:

[Elasticsearch\Common\Exceptions\InvalidArgumentException]
Could not parse URI

Also as you can see in https://github.com/akeneo/pim-community-dev/blob/master/app/config/parameters.yml.dist#L13 the default value for index_hosts is 'localhost:9200'

@KarenMayo
Copy link
Contributor

Hello @TheOnlyJoey

Sorry there was a problem on the value's display in the previous comment.

The working config value is:
'<user>:<password>@<server>:<port>'

it is indeed by default 'elastic:changeme@localhost:9200'

Regards,
Karen

@TheOnlyJoey
Copy link
Author

TheOnlyJoey commented Sep 26, 2017

It seems that there is no warning or check if ElasticSearch is running, Composer seems to originally have killed the ElasticSearch service.
Restarting the process forced fixed the issue, using normal localhost:9200.

It might be a good idea to make sure ElasticSearch is running in the console pim:installer:db script, since without this, the install will not complete.

@simonmaass
Copy link

i am trying to get akeneo to run with an aws elastic search cluster... getting
In StaticNoPingConnectionPool.php line 51:

No alive nodes found in your cluster

In app/config/parameters.yml i changed the index_host to the aws vpc endpoint - does anyone have any idea?

@lewisvoncken
Copy link

In my case the index_host value in app/config/parameters.yml was:

localhost :9200

So I removed the white space and now it works fine:

localhost:9200

@simonmaass
Copy link

the solution was port:80... aws uses port 80...

@d0p3fish
Copy link

d0p3fish commented Feb 26, 2019

Hi,

i wasted so much time to get this.

localhost:9200 didnt work
localhost: 9200 didnt work

Dont know why akeneo isnt shipping out of the box working containers.

take a look at the documentation
https://docs.akeneo.com/3.0/install_pim/docker/installation_docker.html

in your parameters.yml.dist you have to set
elastic:changeme@elasticsearch:9200

After this:
cleanup the container
docker-compose down -v

start the container
docker-compose up -d

bin/docker/pim-dependencies.sh
bin/docker/pim-initialize.sh

and elasticsearch should work.

So the conneciton string for ElasticSearch Head google chrome plugin is:
(here you can also check if the elasticsearch machine is running)
http://localhost:9210/

elastic : default username for elasticsearch, nowhere set
changeme: default password for elasticsearch, nowhere set
elasticsearch: in the docker-compose.yml you should find "elasticsearch", thats the hostname which is used here.

9200: the used port is set in
docker-compose.override.yml
- '9210:9200'
9200 docker machine port
9210 external port for connecting from your host machine

@Rud5G
Copy link

Rud5G commented Jun 26, 2019

i am trying to get akeneo to run with an aws elastic search cluster... getting
In StaticNoPingConnectionPool.php line 51:

No alive nodes found in your cluster

In app/config/parameters.yml i changed the index_host to the aws vpc endpoint - does anyone have any idea?

did you solve this already?

@simonmaass
Copy link

@Rud5G yes... aws uses port 80...

@Anagbo
Copy link

Anagbo commented Sep 21, 2019

Please, can someone help me out? I facing the same challenge and I have been on it for hours without any progress.

`In StaticNoPingConnectionPool.php line 53:

No alive nodes found in your cluster

The command terminated with an error code: 1.
Error during PIM installation. The command terminated with an error code: 1.
`
I have followed through all the suggested solutions listed above but there is no change. I am using Akeneo version 3.2.

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

8 participants