Michelle Welcks
Michelle Welcks

Reputation: 3914

Installing the IBM containers plug-in (cf ic) for Cloud Foundry hangs and then fails

The IBM containers plug-in for the Cloud Foundry CLI hangs after cf install-plugin https://static-ice.ng.bluemix.net/ibm-containers-linux_x64.

The download is successful:

Attention: Plugins are binaries written by potentially untrusted authors. Install and use plugins at your own risk.

Do you want to install the plugin https://static-ice.ng.bluemix.net/ibm-containers-linux_x64? (y or n)> y

Attempting to download binary file from internet address...
10270368 bytes downloaded...

But then hangs trying to install the plugin:

Installing plugin /tmp/ibm-containers-linux_x64...

And times out after several minutes:

FAILED
exit status 1

System information:

NAME="CentOS Linux"
VERSION="7 (Core)"
Linux 3.10.0-229.14.1.el7.x86_64 #1 SMP Tue Sep 15 15:05:51 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Cloud Foundry CLI version: cf version 6.17.0+5d0be0a-2016-04-15
Docker version:Docker version 1.11.1, build 5604cbe

Upvotes: 0

Views: 1003

Answers (2)

big kev
big kev

Reputation: 337

You could optionally download it manually using the browser then install it from the download path. eg.

$ cf install-plugin path/to/ibm-plugin-file

And here is a link to the IBM plugin repository links. Haven't tried it let me know if it works :)

Upvotes: 0

Michelle Welcks
Michelle Welcks

Reputation: 3914

Summary

Make sure that communication is allowed on the host loopback interface.

For example, if iptables is restricting this traffic, the following rule resolves the problem: iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT


More Information

The containers plug-in installation uses a random port on the loopback interface. If is unable to communicate, the installation fails. In my case, iptables was not allowing the communication. For example, here's tcpdump output showing two failed attempts:

Watching the local interface withtcpdump -i lo`

# Attempt 1
15:50:16.255178 IP test-host.55308 > test-host.48267: Flags [S], seq 1877515918, win 43690, options [mss 65495,sackOK,TS val 964453 ecr 0,nop,wscale 8], length 0
15:50:17.257624 IP test-host.55308 > test-host.48267: Flags [S], seq 1877515918, win 43690, options [mss 65495,sackOK,TS val 965456 ecr 0,nop,wscale 8], length 0
15:50:19.261636 IP test-host.55308 > test-host.48267: Flags [S], seq 1877515918, win 43690, options [mss 65495,sackOK,TS val 967460 ecr 0,nop,wscale 8], length 0

# Attempt 2
15:51:00.594373 IP test-host.34226 > test-host.40708: Flags [S], seq 2060304501, win 43690, options [mss 65495,sackOK,TS val 1008792 ecr 0,nop,wscale 8], length 0
15:51:01.595663 IP test-host.34226 > test-host.40708: Flags [S], seq 2060304501, win 43690, options [mss 65495,sackOK,TS val 1009794 ecr 0,nop,wscale 8], length 0
15:51:03.601633 IP test-host.34226 > test-host.40708: Flags [S], seq 2060304501, win 43690, options [mss 65495,sackOK,TS val 1011800 ecr 0,nop,wscale 8], length 0

Adding a quick rule to allow traffic on the loopback address works:

iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT

Here's the tcpdump after adding the rule in iptables and trying the plugin installation again:

listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes
16:19:05.431084 IP test-host.37935 > test-host.38894: Flags [S], seq 895212894, win 43690, options [mss 65495,sackOK,TS val 2693629 ecr 0,nop,wscale 8], length 0
16:19:05.431105 IP test-host.38894 > test-host.37935: Flags [S.], seq 2727344571, ack 895212895, win 43690, options [mss 65495,sackOK,TS val 2693629 ecr 2693629,nop,wscale 8], length 0
16:19:05.431122 IP test-host.37935 > test-host.38894: Flags [.], ack 1, win 171, options [nop,nop,TS val 2693629 ecr 2693629], length 0
16:19:05.431224 IP test-host.37935 > test-host.38894: Flags [F.], seq 1, ack 1, win 171, options [nop,nop,TS val 2693629 ecr 2693629], length 0
16:19:05.431263 IP test-host.37936 > test-host.38894: Flags [S], seq 349222338, win 43690, options [mss 65495,sackOK,TS val 2693629 ecr 0,nop,wscale 8], length 0
16:19:05.431270 IP test-host.38894 > test-host.37936: Flags [S.], seq 496327229, ack 349222339, win 43690, options [mss 65495,sackOK,TS val 2693629 ecr 2693629,nop,wscale 8], length 0
16:19:05.431279 IP test-host.37936 > test-host.38894: Flags [.], ack 1, win 171, options [nop,nop,TS val 2693629 ecr 2693629], length 0
16:19:05.431486 IP test-host.38894 > test-host.37935: Flags [F.], seq 1, ack 2, win 171, options [nop,nop,TS val 2693629 ecr 2693629], length 0
16:19:05.431503 IP test-host.37935 > test-host.38894: Flags [.], ack 2, win 171, options [nop,nop,TS val 2693629 ecr 2693629], length 0
16:19:05.431654 IP test-host.37936 > test-host.38894: Flags [P.], seq 1:3043, ack 1, win 171, options [nop,nop,TS val 2693630 ecr 2693629], length 3042
16:19:05.431666 IP test-host.38894 > test-host.37936: Flags [.], ack 3043, win 505, options [nop,nop,TS val 2693630 ecr 2693630], length 0
16:19:05.432294 IP test-host.38894 > test-host.37936: Flags [P.], seq 1:97, ack 3043, win 512, options [nop,nop,TS val 2693630 ecr 2693630], length 96
16:19:05.432304 IP test-host.37936 > test-host.38894: Flags [.], ack 97, win 171, options [nop,nop,TS val 2693630 ecr 2693630], length 0
16:19:05.432993 IP test-host.37936 > test-host.38894: Flags [F.], seq 3043, ack 97, win 171, options [nop,nop,TS val 2693631 ecr 2693630], length 0
16:19:05.433059 IP test-host.38894 > test-host.37936: Flags [F.], seq 97, ack 3044, win 512, options [nop,nop,TS val 2693631 ecr 2693631], length 0
16:19:05.433070 IP test-host.37936 > test-host.38894: Flags [.], ack 98, win 171, options [nop,nop,TS val 2693631 ecr 2693631], length 0

And the plugin output:

Attention: Plugins are binaries written by potentially untrusted authors. Install and use plugins at your own risk.

Do you want to install the plugin https://static-ice.ng.bluemix.net/ibm-containers-linux_x64? (y or n)> y

Attempting to download binary file from internet address...
10270368 bytes downloaded...
Installing plugin /tmp/ibm-containers-linux_x64...
OK
Plugin IBM-Containers v0.8.878 successfully installed.

Upvotes: 1

Related Questions