tchughesiv / cf-mini

Docker image running Cloud Foundry Stack - listens on ports 80/443/4443
Apache License 2.0
19 stars 7 forks source link

Issue Starting Hello App #13

Open jsloyer opened 8 years ago

jsloyer commented 8 years ago

I am trying to use this docker image in travis and hitting an issue when deploying an app I get the following error.

API endpoint: https://api.cf-mini.example
Authenticating...
OK
Targeted org DevBox

API endpoint:   https://api.cf-mini.example (API version: 2.56.0)
User:           admin
Org:            DevBox
Space:          No space targeted, use 'cf target -s SPACE'
Creating space dev in org DevBox as admin...
OK
Assigning role RoleSpaceManager to user admin in org DevBox / space dev as admin...
OK
Assigning role RoleSpaceDeveloper to user admin in org DevBox / space dev as admin...
OK
TIP: Use 'cf target -o "DevBox" -s "dev"' to target new space

API endpoint:   https://api.cf-mini.example (API version: 2.56.0)
User:           admin
Org:            DevBox
Using manifest file /root/cf_nise_installer/test_apps/test_app/manifest.yml
Creating app hello in org DevBox / space dev as admin...
OK
Creating route hello.cf-mini.example...
OK
Binding hello.cf-mini.example to hello...
OK
Uploading hello...
Uploading app files from: /root/cf_nise_installer/test_apps/test_app
Uploading 595.7K, 10 files
Done uploading
OK
Starting app hello in org DevBox / space dev as admin...
FAILED
Error restarting application: Server error, status code: 500, error code: 170011, message: Stager error: failed to stage application:
command exited with failure

The full error can be seen the on the Travis job.

The Travis file is here, https://github.com/IBM-Bluemix/cf-nodejs-client/blob/docker-travis/.travis.yml

jsloyer commented 8 years ago

Additionally if you take a look at the job its weird cf is started then stopped and then started again as well.

tchughesiv commented 8 years ago

I will try to investigate as I find time outside of work hours, but I suspect the host OS is missing some critical packages and/or libraries... or something along those lines. Has the following install document been completed on the host OS?

https://github.com/tchughesiv/cf-mini/blob/master/ubuntu15_10.md

jsloyer commented 8 years ago

@tchughesiv thanks for the response. I updated the job to make sure it had all the dependenices you had. The job was on 14.04 though with docker 1.12.0.

Here is a link to the new run, https://travis-ci.org/IBM-Bluemix/cf-nodejs-client/jobs/154553396.

Full log also here, https://s3.amazonaws.com/archive.travis-ci.org/jobs/154553396/log.txt.

opiethehokie commented 8 years ago

For what it's worth I'm having the same problem on 16.04 with docker 1.12.1. No apps (including the built-in hello app) will start. 500 status code, 170011 error code.

I'll go back and try with 15.10 so I can follow your install doc exactly.

jsloyer commented 8 years ago

@tchughesiv on Ubuntu 15.10 I was able to push an app but the default hello app never pushed. All of CF came up except haproxy. The docker logs are constantly spitting out the following.

Docker Version: 1.12.1

Waiting for remaining processes to start...

Process 'haproxy'                   Execution failed

Waiting for remaining processes to start...

Process 'haproxy'                   Execution failed
jsloyer commented 8 years ago

I ran it again on Ubuntu 15.10 and it started and I was able to push an app but the hello app never pushed.

I did get a single start this time and not the double start but it kept spitting out the following error.

Waiting for remaining processes to start...

Process 'metron_agent'              Execution failed

Waiting for remaining processes to start...

Process 'metron_agent'              Execution failed

Waiting for remaining processes to start...

Process 'metron_agent'              Execution failed
jsloyer commented 8 years ago

So I ran it a 4th time on Ubuntu 15.10 and it worked.... This is really weird, something is going on... Assuming something isnt initialized....

tchughesiv commented 8 years ago

Can you execute the "docker info" command as part of your build? Give me the output?

On Aug 25, 2016, at 1:16 PM, Jeff Sloyer notifications@github.com wrote:

So I ran it a 5th time on Ubuntu 15.10 and got the following error.

Waiting for remaining processes to start...

monit: Error opening the log file '/var/vcap/monit/monit.log' for writing -- Read-only file system FAILED Error read/writing config: open /root/.cf/config.json: no such file or directory FAILED Error read/writing config: open /root/.cf/config.json: no such file or directory FAILED Error read/writing config: open /root/.cf/config.json: no such file or directory FAILED Error read/writing config: open /root/.cf/config.json: no such file or directory

cf login -a https://api.cf-mini.example -u admin -p c1oudc0w --skip-ssl-validation — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

jsloyer commented 8 years ago
root@ubuntu:~# docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.12.1
Storage Driver: devicemapper
 Pool Name: docker-252:0-1175081-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 32.21 GB
 Backing Filesystem: ext4
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 1.266 GB
 Data Space Total: 107.4 GB
 Data Space Available: 22.82 GB
 Metadata Space Used: 1.503 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.146 GB
 Thin Pool Minimum Free Space: 10.74 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.77 (2012-10-15)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: overlay null bridge host
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor
Kernel Version: 4.2.0-27-generic
Operating System: Ubuntu 14.04.5 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 3.86 GiB
Name: ubuntu
ID: N4SE:OSGF:6YWW:P6IS:BYXS:XZVK:L5DK:7VVG:WE75:MOCF:3V34:VCIR
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8
root@ubuntu:~#

The above is from 14.04, I am trying this on 14.04 now...

tchughesiv commented 8 years ago

working on 15.10? always worked for me that way. one thing i do notice from your setup is that you're using the default storage setup (loopback) for docker w/ devicemapper instead of the recommended dedicated volume. i wouldn't be surprised if there are performance related issues there. i still need to find some time after hours to do some testing with the newest docker versions.

tchughesiv commented 8 years ago

and was this set at the grub level? vi /etc/default/grub GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"

opiethehokie commented 8 years ago

For me I just finished switching to 15.10 and the hello app started. I also successfully pushed a couple of other apps.