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

strange behavior with docker :bug: #300

Closed
hd-deman opened this issue Feb 20, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@hd-deman
Copy link

commented Feb 20, 2015

I try to run this cookbook on docker container with no luck:

       Starting Elasticsearch... [OK]
       [2015-02-20T14:58:38+00:00] INFO: service[elasticsearch] started

           - start service service[elasticsearch]
       [2015-02-20T14:58:38+00:00] INFO: ark[elasticsearch] sending restart action to service[elasticsearch] (delayed)
         * service[elasticsearch] action restart[2015-02-20T14:58:38+00:00] INFO: Processing service[elasticsearch] action restart (elasticsearch::default line 72)
       [2015-02-20T14:58:38+00:00] DEBUG: providers for generic service resource enabled on node include: [Chef::Provider::Service::Debian, Chef::Provider::Service::Init, Chef::Provider::Service::Invokercd, Chef::Provider::Service::Upstart]
       [2015-02-20T14:58:38+00:00] DEBUG: providers that refused resource service[elasticsearch] were: [Chef::Provider::Service::Upstart]
       [2015-02-20T14:58:38+00:00] DEBUG: providers that support resource service[elasticsearch] include: [Chef::Provider::Service::Debian, Chef::Provider::Service::Init, Chef::Provider::Service::Invokercd]
       [2015-02-20T14:58:38+00:00] DEBUG: providers that survived replacement include: [Chef::Provider::Service::Debian]
       [2015-02-20T14:58:38+00:00] DEBUG: service[elasticsearch] supports status, running
       elasticsearch not running
       [2015-02-20T14:58:38+00:00] DEBUG: service[elasticsearch] runlevel 0, action stop, priority 20
       [2015-02-20T14:58:38+00:00] DEBUG: service[elasticsearch] runlevel 1, action stop, priority 20
       [2015-02-20T14:58:38+00:00] DEBUG: service[elasticsearch] runlevel 2, action start, priority 20
       [2015-02-20T14:58:38+00:00] DEBUG: service[elasticsearch] runlevel 3, action start, priority 20
       [2015-02-20T14:58:38+00:00] DEBUG: service[elasticsearch] runlevel 4, action start, priority 20
       [2015-02-20T14:58:38+00:00] DEBUG: service[elasticsearch] runlevel 5, action start, priority 20
       [2015-02-20T14:58:38+00:00] DEBUG: service[elasticsearch] runlevel 6, action stop, priority 20
       Stopping elasticsearch...kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
       error: list of process IDs must follow -p

       Usage:
        ps [options]

        Try 'ps --help <simple|list|output|threads|misc|all>'
         or 'ps --help <s|l|o|t|m|a>'
        for additional help text.   

kitchen config:

---
driver:
  name: docker_cli

provisioner:
  name: chef_zero
  environments_path: 'environments'
  # data_bags_path: data_bags
  roles_path: roles

platforms:
  - name: ubuntu-14.04
    driver_config:
      image: ubuntu:14.04
      platform: ubuntu
      require_chef_omnibus: false
      privileged: true
suites:
  - name: elasticsearch-dev
    driver_config:
      container_name: elasticsearch-dev-<%= ENV['CIRCLE_BUILD_NUM'] %>

    provisioner:
      client_rb:
        environment: development
    run_list:
      - role[elasticsearch]
    attributes:
      excursiopedia:
        user: deploy

chef attributes:

default[:java][:install_flavor] = 'openjdk'
default[:java][:jdk_version] = 7

default[:elasticsearch][:version] = '1.4.3'
default[:elasticsearch][:cluster] = {
  name: 'elasticsearch_excursiopedia'
}

default[:elasticsearch][:custom_config]['script.disable_dynamic'] = 'false'

default.elasticsearch[:path][:logs] = '/var/logs/elasticsearch'

docker info:

❯ docker info
Containers: 219
Images: 137
Storage Driver: devicemapper
 Pool Name: docker-8:3-37885375-pool
 Pool Blocksize: 65.54 kB
 Data file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata
 Data Space Used: 71.56 GB
 Data Space Total: 107.4 GB
 Metadata Space Used: 62.71 MB
 Metadata Space Total: 2.147 GB
 Library Version: 1.02.82-git (2013-10-04)
Execution Driver: native-0.2
Kernel Version: 3.16.0-0.bpo.4-amd64
Operating System: Debian GNU/Linux 7 (wheezy)
CPUs: 24
Total Memory: 378.6 GiB
Name: xxx
ID: xxx
WARNING: No memory limit support
WARNING: No swap limit support

if I login to container and run service elasticsearch status/start/stop, its woking fine:

❯ sudo service elasticsearch status
/etc/init.d/elasticsearch: line 120: ruby: command not found
(23) Failed writing body
elasticsearch  running with PID 7422

/ root@6be5c3c8e14d
❯ sudo service elasticsearch stop
Stopping elasticsearch......................................
/ root@6be5c3c8e14d  34s
❯ sudo service elasticsearch status
elasticsearch not running

/ root@6be5c3c8e14d
❯ sudo service elasticsearch start
PID file found in /usr/local/var/run/elasticsearch_dev_ubuntu_1404.pid
Starting Elasticsearch... [OK]

/ root@6be5c3c8e14d
❯ sudo service elasticsearch status
/etc/init.d/elasticsearch: line 120: ruby: command not found
elasticsearch  running with PID 8184

but not service elasticsearch restart:

/ root@6be5c3c8e14d
❯ /etc/init.d/elasticsearch restart

Stopping elasticsearch..................................PID file found in /usr/local/var/run/elasticsearch_dev_ubuntu_1404.pid
PID 8681 still alive, Elasticsearch already running...

/ root@6be5c3c8e14d  2m 0s
❯

/ root@6be5c3c8e14d
❯ /etc/init.d/elasticsearch status
/etc/init.d/elasticsearch: line 120: ruby: command not found
elasticsearch  running with PID 8681
/etc/init.d/elasticsearch: line 143: [: 8681: unary operator expected
@martinb3

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2015

Hello! We've re-written the cookbook using libraries that expose resources and providers, so you shouldn't see this problem on the newer version; it should also be much easier to run with test-kitchen and kitchen-docker (or under CI). Hope this helps!

@martinb3 martinb3 closed this Jul 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.