Search code examples
cloud-foundrystackato

Cloud Foundry - is it possible to check files on flapping app?


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...


Solution

  • 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.