1

Is there a way to review content/files on a flapping app instance?

I had today this problem with one go application and unfortunately since container didnt start, I couldnt check what files are there. So the only way to debug problem (which was btw related to wrong filename) was the log stream.

Thank you,

Leszek

PS.

I am using HPE Stackato, but I assume the approach will be similar to the approach in CF and PCF...

Lech Migdal
  • 3,828
  • 5
  • 36
  • 63

1 Answers1

1

With Pivotal Cloud Foundry, you can cf ssh to SSH into the container, or to set up port-forwarding so that you can use plain ssh or even scp and sftp to access the container or view its file system. You can read some more about it in:

I highly doubt this functionality exists with HPE Stackato because it uses an older Cloud Foundry architecture. Both PCF and HPE are based off of open source Cloud Foundry, but PCF is on the newer Diego architecture, HPE is still on the DEA architecture according to the nodes listed in the Stackato Cluster Setup docs.

With the DEA architecture, you should be able to use the cf files command, which has the following usage:

NAME:
   files - Print out a list of files in a directory or the contents of a specific file

USAGE:
   cf files APP_NAME [PATH] [-i INSTANCE]

ALIAS:
   f

OPTIONS:
   -i       Instance

To deal with a container that is failing to start, there is currently no out-of-the-box solution with Diego, but it has been discussed. This blog post discusses some options, including:

For the app in question explicitly specify a start command by adding a ";sleep 1d" The push command would like this - cf push <app_name> -c "<original_command> ;sleep 1d". This will keep the container around for a day after process within the container has exited.

Amit Kumar Gupta
  • 17,184
  • 7
  • 46
  • 64
  • Interesting, so on PCF you can ssh and use cf files on a container that didnt start? – Lech Migdal Mar 11 '16 at 11:11
  • Just checked and similar commands, so stackato ssh and stackato files work fine with running container on Stackato. Based on this article [link](http://www.activestate.com/blog/2012/02/ssh-stackato) I would even say that ssh'ing into running container was available already in 2012 :) – Lech Migdal Mar 11 '16 at 11:21
  • It does not work with containers that didn't start, no. Interesting, I did not consider stackato's separate CLI. Thanks for the info. – Amit Kumar Gupta Mar 12 '16 at 03:03
  • Amit, thanks for the info. As for my question - any ideas for how one can access a container that didn't start? In any CF distribution? :) And maybe it's really an edge case and there is no support for such operation... – Lech Migdal Mar 14 '16 at 12:33
  • Sorry @LechMigdal I didn't address your main question. Just added to my answer, does that suggestion help you? – Amit Kumar Gupta Mar 14 '16 at 22:30