{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/puppet-elasticsearch/issues/514","labels_url":"https://api.github.com/repos/elastic/puppet-elasticsearch/issues/514/labels{/name}","comments_url":"https://api.github.com/repos/elastic/puppet-elasticsearch/issues/514/comments","events_url":"https://api.github.com/repos/elastic/puppet-elasticsearch/issues/514/events","html_url":"https://github.com/elastic/puppet-elasticsearch/issues/514","id":121210784,"number":514,"title":"shield plugin installation fails at the first puppet run","user":{"login":"tobiasschaber","id":5949651,"avatar_url":"https://avatars.githubusercontent.com/u/5949651?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiasschaber","html_url":"https://github.com/tobiasschaber","followers_url":"https://api.github.com/users/tobiasschaber/followers","following_url":"https://api.github.com/users/tobiasschaber/following{/other_user}","gists_url":"https://api.github.com/users/tobiasschaber/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiasschaber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiasschaber/subscriptions","organizations_url":"https://api.github.com/users/tobiasschaber/orgs","repos_url":"https://api.github.com/users/tobiasschaber/repos","events_url":"https://api.github.com/users/tobiasschaber/events{/privacy}","received_events_url":"https://api.github.com/users/tobiasschaber/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-09T10:53:34Z","updated_at":"2015-12-09T11:50:09Z","closed_at":null,"body":"\r\n\r\nHey guys,\r\n\r\nI'm currently running into an issue while trying to install the shield plugin.\r\n\r\nEnvironment:\r\n\r\nOS: CentOS 7.1 in a vagrant box with virtualbox and puppet 3.8.4.\r\n\r\nThis is the hiera config I use:\r\n\r\n```\r\nelasticsearch::restart_on_change: true\r\nelasticsearch::plugins_hiera_merge: true\r\nelasticsearch::package_url: http://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/rpm/elasticsearch/2.1.0/elasticsearch-2.1.0.rpm\r\nelasticsearch::package_provider: package\r\nelasticsearch::java_install: true\r\nelasticsearch::java_package: jdk1.8.0_65.x86_64\r\nelasticsearch::elasticsearch_user: elasticsearch\r\nelasticsearch::elasticsearch_group: elasticsearch\r\nelasticsearch::plugins:\r\n  elasticsearch/license/latest:\r\n    instances:\r\n      - es-01\r\n  marvel-agent:\r\n    instances:\r\n      - es-01\r\n  elasticsearch/watcher/latest:\r\n    instances:\r\n      - es-01\r\n  elasticsearch/shield/latest:\r\n    instances:\r\n      - es-01\r\nelasticsearch::config:\r\n  cluster:\r\n    name: elkcluster\r\n  discovery:\r\n    zen.ping.multicast.enabled: false\r\n    zen.ping.unicast.hosts:\r\n     - 10.0.3.101\r\n  shield:\r\n    authc.realms:\r\n      esusers_default:\r\n        type: esusers\r\n        order: 0\r\n        files.users: /etc/elasticsearch/es-01/shield/users\r\n        files.users_roles: /etc/elasticsearch/es-01/shield/users_roles\r\n    ssl:\r\n      keystore.path: /etc/elasticsearch/es-01/shield/es01-keystore.jks\r\n      keystore.password: codecentric\r\n      keystore.key_password: codecentric\r\n      hostname_verification: false\r\n      truststore.path: /etc/elasticsearch/es-01/shield/es01-truststore.jks\r\n      truststore.password: codecentric\r\n    transport.ssl: true\r\n    http.ssl: true    \r\n```\r\nIn every run there is no problem while installing all the other plugins, but the shield plugin always fails after all retries.\r\n\r\nIf I then login into the machine and run the plugin installer command:\r\n\r\n/usr/share/elasticsearch/bin/plugin install elasticsearch/shield/latest\r\n\r\nthe installation proceeds and is finished on first try within seconds.\r\n\r\n\r\nThis is my puppet debug output if the plugin installation part:\r\n\r\n```\r\n==> elkdata1: Debug: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[marvel-agent]/Exec[install_plugin_marvel-agent]/returns: Exec try 1/19\r\n==> elkdata1: Debug: Exec[install_plugin_marvel-agent](provider=posix): Executing '/usr/share/elasticsearch/bin/plugin install marvel-agent'\r\n==> elkdata1: Debug: Executing '/usr/share/elasticsearch/bin/plugin install marvel-agent'\r\n==> elkdata1: Notice: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[marvel-agent]/Exec[install_plugin_marvel-agent]/returns: executed successfully\r\n==> elkdata1: Debug: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[marvel-agent]/Exec[install_plugin_marvel-agent]: The container Elasticsearch::Plugin[marvel-agent] will propagate my refresh event\r\n==> elkdata1: Info: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[marvel-agent]/Exec[install_plugin_marvel-agent]: Scheduling refresh of Elasticsearch::Service[es-01]\r\n==> elkdata1: Debug: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[elasticsearch/shield/latest]/Exec[install_plugin_elasticsearch/shield/latest]/returns: Exec try 1/19\r\n==> elkdata1: Debug: Exec[install_plugin_elasticsearch/shield/latest](provider=posix): Executing '/usr/share/elasticsearch/bin/plugin install elasticsearch/shield/latest'\r\n==> elkdata1: Debug: Executing '/usr/share/elasticsearch/bin/plugin install elasticsearch/shield/latest'\r\n==> elkdata1: Debug: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[elasticsearch/shield/latest]/Exec[install_plugin_elasticsearch/shield/latest]/returns: Sleeping for 10.0 seconds between tries\r\n==> elkdata1: Notice: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[elasticsearch/shield/latest]/Exec[install_plugin_elasticsearch/shield/latest]/returns: -> Installing elasticsearch/shield/latest...\r\n==> elkdata1: Notice: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[elasticsearch/shield/latest]/Exec[install_plugin_elasticsearch/shield/latest]/returns: Trying https://download.elastic.co/elasticsearch/shield/shield-latest.zip ...\r\n==> elkdata1: Notice: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[elasticsearch/shield/latest]/Exec[install_plugin_elasticsearch/shield/latest]/returns: Downloading ....................................................................................................................................DONE\r\n==> elkdata1: Notice: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[elasticsearch/shield/latest]/Exec[install_plugin_elasticsearch/shield/latest]/returns: Verifying https://download.elastic.co/elasticsearch/shield/shield-latest.zip checksums if available ...\r\n==> elkdata1: Notice: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[elasticsearch/shield/latest]/Exec[install_plugin_elasticsearch/shield/latest]/returns: Downloading .DONE\r\n==> elkdata1: Notice: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[elasticsearch/shield/latest]/Exec[install_plugin_elasticsearch/shield/latest]/returns: Installed shield into /usr/share/elasticsearch/plugins/shield\r\n==> elkdata1: Notice: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[elasticsearch/shield/latest]/Exec[install_plugin_elasticsearch/shield/latest]/returns: ERROR: Error copying config directory [/usr/share/elasticsearch/plugins/shield/config] to [/etc/elasticsearch/shield], cleaning up, reason: AccessDeniedException[/etc/elasticsearch/shield]\r\n==> elkdata1: Notice: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[elasticsearch/shield/latest]/Exec[install_plugin_elasticsearch/shield/latest]/returns: ERROR: /etc/elasticsearch/shield\r\n==> elkdata1: Error: /usr/share/elasticsearch/bin/plugin install elasticsearch/shield/latest returned 74 instead of one of [0]\r\n==> elkdata1: Error: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[elasticsearch/shield/latest]/Exec[install_plugin_elasticsearch/shield/latest]/returns: change from notrun to 0 failed: /usr/share/elasticsearch/bin/plugin install elasticsearch/shield/latest returned 74 instead of one of [0]\r\n==> elkdata1: Notice: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[elasticsearch/shield/latest]/File[/usr/share/elasticsearch/plugins/shield/.name]: Dependency Exec[install_plugin_elasticsearch/shield/latest] has failures: true\r\n==> elkdata1: Warning: /Stage[main]/Elasticsearch/Elasticsearch::Plugin[elasticsearch/shield/latest]/File[/usr/share/elasticsearch/plugins/shield/.name]: Skipping because of failed dependencies\r\n==> elkdata1: Debug: Augeas[/etc/sysconfig/elasticsearch](provider=augeas): Opening augeas with root /, lens path , flags 64\r\n==> elkdata1: Debug: Augeas[/etc/sysconfig/elasticsearch](provider=augeas): Augeas version 1.1.0 is installed\r\n==> elkdata1: Debug: Augeas[/etc/sysconfig/elasticsearch](provider=augeas): Will attempt to save and only run if files changed\r\n==> elkdata1: Debug: Augeas[/etc/sysconfig/elasticsearch](provider=augeas): sending command 'set' with params [\"/files/etc/sysconfig/elasticsearch/CONF_DIR\", \"/etc/elasticsearch\"]\r\n==> elkdata1: Debug: Augeas[/etc/sysconfig/elasticsearch](provider=augeas): Files changed, should execute\r\n==> elkdata1: Debug: Augeas[/etc/sysconfig/elasticsearch](provider=augeas): sending command 'set' with params [\"/files/etc/sysconfig/elasticsearch/CONF_DIR\", \"/etc/elasticsearch\"]\r\n==> elkdata1: Debug: Augeas[/etc/sysconfig/elasticsearch](provider=augeas): Closed the augeas connection\r\n==> elkdata1: Notice: /Stage[main]/Elasticsearch::Config/Augeas[/etc/sysconfig/elasticsearch]/returns: executed successfully\r\n==> elkdata1: Debug: /Stage[main]/Elasticsearch::Config/Augeas[/etc/sysconfig/elasticsearch]: The container Class[Elasticsearch::Config] will propagate my refresh event    \r\n```\r\n\r\nAll other plugins (license, marvel-agent, watcher) are correctly installed.\r\n\r\nI also tried with \r\nelasticsearch::restart_on_change: false\r\nelasticsearch::plugins_hiera_merge: (not set)\r\nbut no difference.\r\n\r\nAnother strange thing is: If I perform a re-run of the puppet script, it will install the shield plugin correctly on the first run!\r\n\r\nIt would be really nice if you could have a look at that.\r\n\r\nThanks and kind regards,\r\n\r\nTobias\r\n"},"comment":{"url":"https://api.github.com/repos/elastic/puppet-elasticsearch/issues/comments/163199488","html_url":"https://github.com/elastic/puppet-elasticsearch/issues/514#issuecomment-163199488","issue_url":"https://api.github.com/repos/elastic/puppet-elasticsearch/issues/514","id":163199488,"user":{"login":"tobiasschaber","id":5949651,"avatar_url":"https://avatars.githubusercontent.com/u/5949651?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiasschaber","html_url":"https://github.com/tobiasschaber","followers_url":"https://api.github.com/users/tobiasschaber/followers","following_url":"https://api.github.com/users/tobiasschaber/following{/other_user}","gists_url":"https://api.github.com/users/tobiasschaber/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiasschaber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiasschaber/subscriptions","organizations_url":"https://api.github.com/users/tobiasschaber/orgs","repos_url":"https://api.github.com/users/tobiasschaber/repos","events_url":"https://api.github.com/users/tobiasschaber/events{/privacy}","received_events_url":"https://api.github.com/users/tobiasschaber/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T11:50:09Z","updated_at":"2015-12-09T11:50:09Z","body":"Thanks for you quick reply! Did not see that there was already an issue open.\r\nI will follow this!\r\n\r\nKind regards,\r\nTobias"}}