strongloop / apiconnect-docker

IBM API Connect on Docker
Other
26 stars 26 forks source link

logstash exiting with (13)Permission denied: make_sock: could not bind to address [::]:443 #12

Open ghost opened 7 years ago

ghost commented 7 years ago

On Ubuntu 14.04 and following the instructions from https://www.ibm.com/support/knowledgecenter/SSMNED_5.0.0/com.ibm.apic.install.doc/tapic_docker_install.html

Using:

 $ docker --version
Docker version 1.12.2, build bb80604
 $ docker-compose --version
docker-compose version 1.8.1, build 878cff1

logstash is exiting with a response code of 1 on start up:

 $ docker-compose ps
    Name                   Command               State               Ports             
--------------------------------------------------------------------------------------
apim            /tini -- /startup.sh             Up                                    
datapower       /start.sh                        Up       443/tcp                      
esmaster        /docker-entrypoint.sh /bin ...   Up       9200/tcp, 9300/tcp           
ibmlogstash     /bin/sh -c /startup.sh           Exit 1                                
ibmportal       /root/tini -- /root/start_ ...   Up                                    
make-ssh-keys   /bin/sh -c /genkey.sh            Exit 0                                
microservice    /bin/sh -c /usr/bin/app.sh ...   Up       8080/tcp                     
nginx           /bin/sh -c /run.sh               Up       0.0.0.0:443->443/tcp, 80/tcp 

the logs show:

$ docker-compose logs logstash
Attaching to ibmlogstash
ibmlogstash      | Logstash starting
ibmlogstash      | Logstash started
ibmlogstash      | (13)Permission denied: make_sock: could not bind to address [::]:443
ibmlogstash      | (13)Permission denied: make_sock: could not bind to address 0.0.0.0:443
ibmlogstash      | no listening sockets available, shutting down
ibmlogstash      | Unable to open logs
ghost commented 7 years ago

This issue looks like it is specific to a single machine. I have created a new Ubuntu 14.04 vm and run through the set up without any problems. I'm still trying to get to the bottom of the problem on the one machine I need it running on.

kraman commented 7 years ago

@dineeno-ibm im unable to repro this issue. Could you try removing and re-downloading the logstash image on the machine where its not working

ghost commented 7 years ago

@kraman I have cleaned all of the images and attempted to recreate from scratch a couple of times already and that doesn't seem to work. I see the same failures repeatedly. I can recreate the issue by logging into the logstash container and running the startup.sh script so I need to investigate further in there. However I think at the moment getting a recreation elsewhere is unlikely, on the plus side I have had no problem setting this up on other ubuntu images so hopefully others aren't affected by this issue.

Currently I'm trying to set things up on a vm running on virtualbox to give me something that i can work with, I will update this issue with more information when I investigate further.

aldenchan commented 7 years ago

Able to reproduce this on ubuntu 16.10 vm on vmware

ghost commented 7 years ago

I just encountered this on a clean install of Ubuntu. Put the OS down in the VM, added docker-ce and docker-compose and then did a git checkout and docker-compose up and saw the same error.

here are some details:

cat /etc/os-release

NAME="Ubuntu" VERSION="16.04.2 LTS (Xenial Xerus)"

docker --version

Docker version 17.03.1-ce, build c6d412e

docker-compose --version

docker-compose version 1.12.0, build b31ff33

docker-compose ps

Name                   Command               State               Ports

apim /tini -- /startup.sh Up datapower /start.sh Up 443/tcp esmaster /docker-entrypoint.sh /bin ... Up 9200/tcp, 9300/tcp ibmlogstash /bin/sh -c /startup.sh Exit 1 ibmportal /root/tini -- /root/start_ ... Up make-ssh-keys /bin/sh -c /genkey.sh Exit 0 nginx /bin/sh -c /run.sh Up 0.0.0.0:443->443/tcp, 80/tcp

docker logs ibmlogstash

Logstash starting Logstash started (13)Permission denied: make_sock: could not bind to address [::]:443 (13)Permission denied: make_sock: could not bind to address 0.0.0.0:443 no listening sockets available, shutting down Unable to open logs

docker inspect ibmlogstash

[ { "Id": "418e280285a87639a664774e10da036510d33e3f048edc39d2c4a8e6ceac0068", "Created": "2017-05-15T20:04:36.476179992Z", "Path": "/bin/sh", "Args": [ "-c", "/startup.sh" ], "State": { "Status": "exited", "Running": false, "Paused": false, "Restarting": false, "OOMKilled": false, "Dead": false, "Pid": 0, "ExitCode": 1, "Error": "", "StartedAt": "2017-05-15T20:04:37.171099871Z", "FinishedAt": "2017-05-15T20:04:37.329901406Z" }, "Image": "sha256:6d033bd9feecec7b296f7e50021ba1df1d0018a12d0da1e9468077736b4ebd17", "ResolvConfPath": "/var/lib/docker/containers/418e280285a87639a664774e10da036510d33e3f048edc39d2c4a8e6ceac0068/resolv.conf", "HostnamePath": "/var/lib/docker/containers/418e280285a87639a664774e10da036510d33e3f048edc39d2c4a8e6ceac0068/hostname", "HostsPath": "/var/lib/docker/containers/418e280285a87639a664774e10da036510d33e3f048edc39d2c4a8e6ceac0068/hosts", "LogPath": "/var/lib/docker/containers/418e280285a87639a664774e10da036510d33e3f048edc39d2c4a8e6ceac0068/418e280285a87639a664774e10da036510d33e3f048edc39d2c4a8e6ceac0068-json.log", "Name": "/ibmlogstash", "RestartCount": 0, "Driver": "aufs", "MountLabel": "", "ProcessLabel": "", "AppArmorProfile": "", "ExecIDs": null, "HostConfig": { "Binds": [], "ContainerIDFile": "", "LogConfig": { "Type": "json-file", "Config": {} }, "NetworkMode": "apiconnectdocker_ibmnet", "PortBindings": {}, "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 }, "AutoRemove": false, "VolumeDriver": "", "VolumesFrom": [], "CapAdd": null, "CapDrop": null, "Dns": null, "DnsOptions": null, "DnsSearch": null, "ExtraHosts": null, "GroupAdd": null, "IpcMode": "", "Cgroup": "", "Links": null, "OomScoreAdj": 0, "PidMode": "", "Privileged": false, "PublishAllPorts": false, "ReadonlyRootfs": false, "SecurityOpt": null, "UTSMode": "", "UsernsMode": "", "ShmSize": 67108864, "Runtime": "runc", "ConsoleSize": [ 0, 0 ], "Isolation": "", "CpuShares": 0, "Memory": 0, "NanoCpus": 0, "CgroupParent": "", "BlkioWeight": 0, "BlkioWeightDevice": null, "BlkioDeviceReadBps": null, "BlkioDeviceWriteBps": null, "BlkioDeviceReadIOps": null, "BlkioDeviceWriteIOps": null, "CpuPeriod": 0, "CpuQuota": 0, "CpuRealtimePeriod": 0, "CpuRealtimeRuntime": 0, "CpusetCpus": "", "CpusetMems": "", "Devices": null, "DiskQuota": 0, "KernelMemory": 0, "MemoryReservation": 0, "MemorySwap": 0, "MemorySwappiness": -1, "OomKillDisable": false, "PidsLimit": 0, "Ulimits": null, "CpuCount": 0, "CpuPercent": 0, "IOMaximumIOps": 0, "IOMaximumBandwidth": 0 }, "GraphDriver": { "Name": "aufs", "Data": null }, "Mounts": [], "Config": { "Hostname": "418e280285a8", "Domainname": "", "User": "logstash", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "ACCEPT_LICENSE=true", "DB_HOST=apim", "MGMT_HOST=apim", "ES_HOST=esmaster", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "DISTTAG=f24docker", "FGC=f24", "YUM_UPDATE=20161214", "JAVA_HOME=/opt/ibm/java-x86_64-71" ], "Cmd": [ "/bin/sh", "-c", "/startup.sh" ], "ArgsEscaped": true, "Image": "ibmcom/apiconnect:logstash-v5.0.6.0", "Volumes": null, "WorkingDir": "", "Entrypoint": null, "OnBuild": null, "Labels": { "com.docker.compose.config-hash": "34d488db1ae37004ee2d11be146824ba73b795363050a48361c05575862ef98a", "com.docker.compose.container-number": "1", "com.docker.compose.oneoff": "False", "com.docker.compose.project": "apiconnectdocker", "com.docker.compose.service": "logstash", "com.docker.compose.version": "1.12.0" } }, "NetworkSettings": { "Bridge": "", "SandboxID": "3d4da6880c0a0a8c3e876231df79e57d2ee2a8e363828f1522e6a421cbc28b67", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": null, "SandboxKey": "/var/run/docker/netns/3d4da6880c0a", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "", "Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "MacAddress": "", "Networks": { "apiconnectdocker_ibmnet": { "IPAMConfig": null, "Links": null, "Aliases": [ "418e280285a8", "logstash" ], "NetworkID": "9698ad494224acf4fe77f160ecdaad6a93f93aaff4c42604eb8c7da76d69f3d7", "EndpointID": "", "Gateway": "", "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "MacAddress": "" } } } } ]

ghost commented 7 years ago

What is interesting is that I just created a new CentOS VM and installed the same versions of Docker, DockerCompose and it starts with no issues. What in Ubuntu 16.04.2 is causing the logstash to not bind??

ghost commented 7 years ago

I was able to resolve this by cloning the repo to a new directory on the host itself, then my docker-compose up worked on both CentOS and Ubuntu