SlideShare a Scribd company logo
1 of 22
Download to read offline
10 common errors when pushing
applications to CloudFoundry
Junjie Cai (Jack)
IBM Bluemix runtime architect
Agenda
 What happens during an app push
 Client errors
 Fabric errors
 App staging errors
 App startup errors
What happens during an app push
What may go wrong
I. Client errors
II. Fabric errors
III. App
staging
errors
IV. App
startup
errors
I. Client errors
 ERR 1s (before you start)
 Cause 1: Not a developer in the space
 Cause 2: Too old cf CLI client
 Cause 3: Pushing from a wrong directory
 Forgetting to specify the app package
 Cause 4: Picking up an unexpected manifest.yml
 ERR 2: the route is already in use
 Solution:
 Specify a unique host name via “-n absolutelyunique”
 Use “--no-route” or “--random-route”
 ERR 3: exceeding your organization's memory limit
 ERR 4: too much disk requested (default limit is 1G)
I. Client errors
 ERR 5: app file upload failed
 Cause 1: network connectivity issue
 Solution: fix network connectivity
$ cf push jacklarge
Updating app jacklarge in org myorg / space myspace as myself...
OK
Uploading jacklarge...
Uploading app files from: e:BackdMailstest
Uploading 1.1G, 1 files
Error uploading application.
Error performing request: Put https://xyz/v2/apps/51cb5e33-8.../bits?async=true: dial tcp: i/o timeout
FAILED
Sample error
I. Client errors
 Cause 2: too large to upload in time (default limit is 15m) or
exceeding size limit (default is 1G)
 Solutions
 Exclude unnecessary files using “.cfignore”
 Ignore local node_modules
 Instead of packaging all dependencies, install them during app
staging by using a custom buildpack
 If the app has many files, try pushing repeatedly as each push
tries to upload a delta and thus more files.
$ cf push jacklarge
Updating app jacklarge in org myorg / space myspace as myself...
OK
Uploading jacklarge...
Uploading app files from: e:BackdMailstest
Uploading 1.1G, 1 files
Done uploading
FAILED
Error uploading application.
The app package is invalid: Package may not be larger than 1073741824 bytes
Sample error
II. Fabric errors
 ERR 6s:
 Unable to connect
 500
 4xx
 Cause: various fabric component
failures
 Diagnosis
 Turn on CF_TRACE to determine
which step actually failed
 Analyze fabric logs
Database failures
Blob store failures
No DEA available
Loggregator failures
No DEA available
Router or CloudController failures
Done uploading
FAILED
Error uploading application.
Server error, status code: 500, error code: 0, message:
Sample error
III. App staging errors – buildpack err
 ERR 7s: invalid buildpack name or url
 Cause 1: wrong buildpack name
 Solution: run “cf buildpacks” to view available buildpacks; ask admin to
install the missing ones using “cf create-buildpack”
 Cause 2: failed to clone buildpack code due to network
problem or wrong buildpack url
Server error, status code: 400, error code: 100001, message: The app is invalid:
buildpack notexist is not valid public url or a known buildpack name
Cloning into '/tmp/buildpacks/java-buildpack'...
fatal: could not read Username for 'https://github.com': No
such device or address
Cloning into '/tmp/buildpacks/java-buildpack'...
FAILED
Server error, status code: 400, error code: 170001, message:
Staging error: cannot get instances since staging failed
Cloning into '/tmp/buildpacks/nope-buildpack'...
FAILED
Server error, status code: 400, error code:
170001, message: Staging error: cannot get
instances since staging failed
III. App staging errors – buildpack err
 ERR 8: detection failure
 Cause 1: wrong app package
 Do not create a root folder inside the zip
 Cause 2: pushing from a wrong directory
 Cause 3: required buildpack not installed
 Diagnosis: run “cf buildpacks” to view available buildpacks
 Solution: ask admin to install the missing ones using “cf create-buildpack”
 Cause 4: buildpack defect: change app files in its detect code!!!
Server error, status code: 400, error code: 170003, message: An app was not
successfully detected by any available buildpack
III. App staging errors – compilation err
 ERR 9: compilation step failed
 Diagnosis
 Turn on buildpack traces if supported
 Java/Liberty buildpack: cf set-env <appname> JBP_LOG_LEVEL DEBUG
 Node.js buildpack: cf set-env <appname> npm_config_xyz or include a
.npmrc file in the app package root
 loglevel = silly
 PHP buildpack: cf set-env <appname> BP_DEBUG true
 Run “cf logs <appname> --recent” to get recent logs after the failure
 Run “cf logs <appname>” in another shell console during staging
Staging failed: Buildpack compilation step failed
FAILED
Server error, status code: 400, error code: 170004, message: App staging failed in the buildpack compile phase
III. App staging errors – compilation err
 Cause 1: wrong app package or files
 Example: malformed package.json in a node.js app
 Cause 2: unable to reach external dependencies
 Example: unable to reach NPM repo
 Solution: check connectivity to external dependencies.
 Make sure Security Group is set correctly to allow connections to
those dependencies.
2015-04-27T12:06:35.20-0400 [STG/0] ERR parse error: Expected separator between values at line 12,
column 13
2015-04-27T12:06:35.20-0400 [STG/0] OUT Staging failed: Buildpack compilation step failed
2015-04-27T12:18:47.65-0400 [STG/0] OUT -----> Installing dependencies
2015-04-27T12:19:58.33-0400 [STG/0] OUT npm ERR! network getaddrinfo ENOTFOUND
2015-04-27T12:19:58.33-0400 [STG/0] OUT npm ERR! network This is most likely not a problem with
npm itself
2015-04-27T12:19:58.33-0400 [STG/0] OUT npm ERR! network and is related to network connectivity.
2015-04-27T12:19:58.33-0400 [STG/0] OUT npm ERR! network In most cases you are behind a proxy
or have bad network settings.
III. App staging errors – compilation err
 Cause 3: staging timeout (default limit is 15 minutes), dies
suddenly & quietly
 Solution: do less time-consuming tasks during staging. E.g., cache large
runtime binary files instead of downloading them
 Note that CF_STAGING_TIMEOUT only controls the CLI wait time.
 Cause 4: staging uses too much memory (default limit is 1G),
dies suddenly & quietly
 Solution: make sure the buildpack releases memories diligently during
staging
 Cause 5: staging uses too much disk (default limit is 2G)
 Solution: make sure the buildpack deletes temporary files diligently during
staging
2015-04-27T16:49:36.22-0400 [STG/0] ERR /tmp/buildpacks/java-buildpack/bin/compile:41:in `write': Disk
quota exceeded - /tmp/staged/app/some_file (Errno: DQUOT)
III. App staging errors – compilation err
 Cause 6: using unmatching buildpack level
 Solution: avoid pushing with an external buildpack’s master branch, better to
use a released version, like
cf push <appname> -b https://github.com/cloudfoundry/java-buildpack.git#v3.0
 Cause 7: picked up by wrong buildpack (verify the
detected_buildpack field)
 Solution
 Use “-b” option to specify the buildpack explicitly, could be the name of
an installed admin buildpack (those listed by “cf buildpacks”)
 Does the app contain some suspicious sign files?
 Cause 8: script permission in the buildpack, e.g., “x” bit not set
 Solution: add “x” to all executable scripts in the buildpack
IV. App startup errors
 ERR 10: start app timeout or unsuccessful
-----> Uploading droplet (14M)
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
FAILED
Start app timeout
(Or, “Start unsuccessful”)
$ cf app jackruby
Showing health and status for app jackruby in org myorg / space myspace as myself...
OK
requested state: started
instances: 0/1
usage: 128M x 1 instances
urls: jackruby.mybluemix.net
last uploaded: Wed Apr 29 18:40:40 UTC 2015
state since cpu memory disk
#0 crashing 2015-04-29 02:42:28 PM 0.0% 0 of 0 0 of 0
IV. App startup errors
 Diagnosis
 Run “cf logs <appname> --recent” to get recent logs after the failure
 Run “cf logs <appname>” in another shell console during staging
2015-04-29T12:35:49.43-0400 [STG/27] OUT -----> Uploading droplet (14M)
2015-04-29T12:35:54.37-0400 [DEA/27] OUT Starting app instance (index 0) with guid ceb4f93b-6306-4842-
8637-1d1731412bdc
2015-04-29T12:37:06.75-0400 [DEA/27] ERR Instance (index 0) failed to start accepting connections
2015-04-29T12:37:06.76-0400 [API/8] OUT App instance exited with guid ceb4f93b-6306-4842-8637-
1d1731412bdc payload: {"cc_partition"=>"default", "droplet"=>
"ceb4f93b-6306-4842-8637-1d1731412bdc", "version"=>"d237ca74-f30a-41fc-afd8-fe8f66152698",
"instance"=>"b7e9b891ddd7474f828412bd1d7bb329", "index"=>0, "reason"=
>"CRASHED", "exit_status"=>-1, "exit_description"=>"failed to accept connections within health check timeout",
"crash_timestamp"=>1430325426}
2015-04-29T12:37:07.00-0400 [App/0] ERR
…
2015-04-29T14:27:51.12-0400 [STG/8] OUT -----> Uploading droplet (14M)
2015-04-29T14:27:54.83-0400 [DEA/8] OUT Starting app instance (index 0) with guid ceb4f93b-6306-4842-
8637-1d1731412bdc
2015-04-29T14:28:06.98-0400 [API/3] OUT App instance exited with guid ceb4f93b-6306-4842-8637-
1d1731412bdc payload: {"cc_partition"=>"default", "droplet"=>
"ceb4f93b-6306-4842-8637-1d1731412bdc", "version"=>"73474c66-caaa-470b-ad88-28e854c7db83",
"instance"=>"0baf945674c94a9db294caa6ce0b991d", "index"=>0, "reason"=
>"CRASHED", "exit_status"=>0, "exit_description"=>"app instance exited", "crash_timestamp"=>1430332086}
2015-04-29T14:29:07.02-0400 [DEA/8] ERR Instance (index 0) failed to start accepting connections
IV. App startup errors
 Cause 1: taking too long to start
 General solution:
 Increase startup timeout by specifying “-t” option when pushing,
default is 60 seconds, and max is 180 seconds.
 180 seconds not enough?
 Root cause 1: too much initialization during startup, such as loading
lots of data
 Solution 1: start with “--no-route”, then do “map-route” when
initialization is done
 Solution 2: lazy initialization and/or async initialization
 Root cause 2: listening on the wrong port
 Solution: make sure the app is listening on $PORT
 Root cause 3: reaching out to external network but timeout
 Solution: check connectivity to external dependencies. Make
sure Security Group is set correctly.
IV. App startup errors
 Cause 2: app logic error and exiting
 Missing service binding?
 Cause 3: consuming too much memory
 Solution:
 Check for memory leakage
 Repush with increased memory allocation
cf push <appname> -m 2G
 Cause 4: consuming too much disk (After reaching the quota, your app
will fail to write any additional data to disk.)
 Solution: repush with increased disk allocation
cf push <appname> -k 2G
Note: you cannot go beyond the max set by the provider, default is 2G.
IV. App startup errors
 Advanced diagnosis techniques
 Keep the container alive after app crashing (so that you can do “cf files” etc.)
 With IBM JDK, -Xdump:tool JVM option can be used to run some scripts
before the JVM exits, e.g.:
cf se <appname> JVM_ARGS -Xdump:tool:events=vmstop,exec="sleep 1d"
Better together with: -Xdump:heap+java:events=vmstop
 For general apps, modify the start command to add “;sleep 1d”
cf push <appname> -c “<original_command> ;sleep 1d” --no-route
 Run an agent process as the main process to get the container up, then
diagnose the app
 cf-ssh
 “Development mode” in Bluemix
 Final tip: “cf delete” to clean up the history and repush
Summary
I. Client errors
II. Fabric errors
III. App
staging
errors
IV. App
startup
errors
Thanks!

More Related Content

Similar to Cloud Foundry Summit 2015: 10 common errors when pushing apps to cloud foundry

Getting root with benign app store apps vsecurityfest
Getting root with benign app store apps vsecurityfestGetting root with benign app store apps vsecurityfest
Getting root with benign app store apps vsecurityfestCsaba Fitzl
 
[Hackersuli][HUN]MacOS - Going Down the Rabbit Hole
[Hackersuli][HUN]MacOS - Going Down the Rabbit Hole[Hackersuli][HUN]MacOS - Going Down the Rabbit Hole
[Hackersuli][HUN]MacOS - Going Down the Rabbit Holehackersuli
 
Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11Yury Pliashkou
 
A Java Microservices Spring Boot and Docker case study.
A Java Microservices Spring Boot and Docker case study.A Java Microservices Spring Boot and Docker case study.
A Java Microservices Spring Boot and Docker case study.Subramanyam Vemala
 
How to generate,collect and upload ocum logs
How to generate,collect and upload ocum logsHow to generate,collect and upload ocum logs
How to generate,collect and upload ocum logsAshwin Pawar
 
Infrastructure = code - 1 year later
Infrastructure = code - 1 year laterInfrastructure = code - 1 year later
Infrastructure = code - 1 year laterChristian Ortner
 
Creating Sentiment Line Chart with Watson
Creating Sentiment Line Chart with Watson Creating Sentiment Line Chart with Watson
Creating Sentiment Line Chart with Watson Dev_Events
 
Bluemix hadoop beginners Guide part I
Bluemix hadoop beginners Guide part IBluemix hadoop beginners Guide part I
Bluemix hadoop beginners Guide part IJoseph Chang
 
Attack Chaining: Advanced Maneuvers for Hack Fu
Attack Chaining: Advanced Maneuvers for Hack FuAttack Chaining: Advanced Maneuvers for Hack Fu
Attack Chaining: Advanced Maneuvers for Hack FuRob Ragan
 
Using docker to develop NAS applications
Using docker to develop NAS applicationsUsing docker to develop NAS applications
Using docker to develop NAS applicationsTerry Chen
 
JDD 2017: 7 things which you should care about before release your code to pr...
JDD 2017: 7 things which you should care about before release your code to pr...JDD 2017: 7 things which you should care about before release your code to pr...
JDD 2017: 7 things which you should care about before release your code to pr...PROIDEA
 
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTreeThe Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTreeRedBlackTree
 
Getting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionGetting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionCFEngine
 
CodeIgniter Lab
CodeIgniter LabCodeIgniter Lab
CodeIgniter LabLeo Nguyen
 
Scaffolding for Serverless: lightning talk for AWS Arlington Meetup
Scaffolding for Serverless: lightning talk for AWS Arlington MeetupScaffolding for Serverless: lightning talk for AWS Arlington Meetup
Scaffolding for Serverless: lightning talk for AWS Arlington MeetupChris Shenton
 
OpenStack How To - PyLadies ATX
OpenStack How To - PyLadies ATXOpenStack How To - PyLadies ATX
OpenStack How To - PyLadies ATXAnne Gentle
 

Similar to Cloud Foundry Summit 2015: 10 common errors when pushing apps to cloud foundry (20)

Getting root with benign app store apps vsecurityfest
Getting root with benign app store apps vsecurityfestGetting root with benign app store apps vsecurityfest
Getting root with benign app store apps vsecurityfest
 
[Hackersuli][HUN]MacOS - Going Down the Rabbit Hole
[Hackersuli][HUN]MacOS - Going Down the Rabbit Hole[Hackersuli][HUN]MacOS - Going Down the Rabbit Hole
[Hackersuli][HUN]MacOS - Going Down the Rabbit Hole
 
Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11
 
A Java Microservices Spring Boot and Docker case study.
A Java Microservices Spring Boot and Docker case study.A Java Microservices Spring Boot and Docker case study.
A Java Microservices Spring Boot and Docker case study.
 
How to generate,collect and upload ocum logs
How to generate,collect and upload ocum logsHow to generate,collect and upload ocum logs
How to generate,collect and upload ocum logs
 
Infrastructure = code - 1 year later
Infrastructure = code - 1 year laterInfrastructure = code - 1 year later
Infrastructure = code - 1 year later
 
Creating Sentiment Line Chart with Watson
Creating Sentiment Line Chart with Watson Creating Sentiment Line Chart with Watson
Creating Sentiment Line Chart with Watson
 
Bluemix hadoop beginners Guide part I
Bluemix hadoop beginners Guide part IBluemix hadoop beginners Guide part I
Bluemix hadoop beginners Guide part I
 
React in production
React in productionReact in production
React in production
 
Attack Chaining: Advanced Maneuvers for Hack Fu
Attack Chaining: Advanced Maneuvers for Hack FuAttack Chaining: Advanced Maneuvers for Hack Fu
Attack Chaining: Advanced Maneuvers for Hack Fu
 
5 pcf
5 pcf5 pcf
5 pcf
 
What's new in p2 (2009)?
What's new in p2 (2009)?What's new in p2 (2009)?
What's new in p2 (2009)?
 
Using docker to develop NAS applications
Using docker to develop NAS applicationsUsing docker to develop NAS applications
Using docker to develop NAS applications
 
JDD 2017: 7 things which you should care about before release your code to pr...
JDD 2017: 7 things which you should care about before release your code to pr...JDD 2017: 7 things which you should care about before release your code to pr...
JDD 2017: 7 things which you should care about before release your code to pr...
 
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTreeThe Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree
The Mobile ToolChain with Fastlane - Code Red Talk at RedBlackTree
 
Spring Lab
Spring LabSpring Lab
Spring Lab
 
Getting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated VersionGetting Started With CFEngine - Updated Version
Getting Started With CFEngine - Updated Version
 
CodeIgniter Lab
CodeIgniter LabCodeIgniter Lab
CodeIgniter Lab
 
Scaffolding for Serverless: lightning talk for AWS Arlington Meetup
Scaffolding for Serverless: lightning talk for AWS Arlington MeetupScaffolding for Serverless: lightning talk for AWS Arlington Meetup
Scaffolding for Serverless: lightning talk for AWS Arlington Meetup
 
OpenStack How To - PyLadies ATX
OpenStack How To - PyLadies ATXOpenStack How To - PyLadies ATX
OpenStack How To - PyLadies ATX
 

Recently uploaded

ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 

Cloud Foundry Summit 2015: 10 common errors when pushing apps to cloud foundry

  • 1.
  • 2. 10 common errors when pushing applications to CloudFoundry Junjie Cai (Jack) IBM Bluemix runtime architect
  • 3. Agenda  What happens during an app push  Client errors  Fabric errors  App staging errors  App startup errors
  • 4. What happens during an app push
  • 5. What may go wrong I. Client errors II. Fabric errors III. App staging errors IV. App startup errors
  • 6. I. Client errors  ERR 1s (before you start)  Cause 1: Not a developer in the space  Cause 2: Too old cf CLI client  Cause 3: Pushing from a wrong directory  Forgetting to specify the app package  Cause 4: Picking up an unexpected manifest.yml  ERR 2: the route is already in use  Solution:  Specify a unique host name via “-n absolutelyunique”  Use “--no-route” or “--random-route”  ERR 3: exceeding your organization's memory limit  ERR 4: too much disk requested (default limit is 1G)
  • 7. I. Client errors  ERR 5: app file upload failed  Cause 1: network connectivity issue  Solution: fix network connectivity $ cf push jacklarge Updating app jacklarge in org myorg / space myspace as myself... OK Uploading jacklarge... Uploading app files from: e:BackdMailstest Uploading 1.1G, 1 files Error uploading application. Error performing request: Put https://xyz/v2/apps/51cb5e33-8.../bits?async=true: dial tcp: i/o timeout FAILED Sample error
  • 8. I. Client errors  Cause 2: too large to upload in time (default limit is 15m) or exceeding size limit (default is 1G)  Solutions  Exclude unnecessary files using “.cfignore”  Ignore local node_modules  Instead of packaging all dependencies, install them during app staging by using a custom buildpack  If the app has many files, try pushing repeatedly as each push tries to upload a delta and thus more files. $ cf push jacklarge Updating app jacklarge in org myorg / space myspace as myself... OK Uploading jacklarge... Uploading app files from: e:BackdMailstest Uploading 1.1G, 1 files Done uploading FAILED Error uploading application. The app package is invalid: Package may not be larger than 1073741824 bytes Sample error
  • 9. II. Fabric errors  ERR 6s:  Unable to connect  500  4xx  Cause: various fabric component failures  Diagnosis  Turn on CF_TRACE to determine which step actually failed  Analyze fabric logs Database failures Blob store failures No DEA available Loggregator failures No DEA available Router or CloudController failures Done uploading FAILED Error uploading application. Server error, status code: 500, error code: 0, message: Sample error
  • 10. III. App staging errors – buildpack err  ERR 7s: invalid buildpack name or url  Cause 1: wrong buildpack name  Solution: run “cf buildpacks” to view available buildpacks; ask admin to install the missing ones using “cf create-buildpack”  Cause 2: failed to clone buildpack code due to network problem or wrong buildpack url Server error, status code: 400, error code: 100001, message: The app is invalid: buildpack notexist is not valid public url or a known buildpack name Cloning into '/tmp/buildpacks/java-buildpack'... fatal: could not read Username for 'https://github.com': No such device or address Cloning into '/tmp/buildpacks/java-buildpack'... FAILED Server error, status code: 400, error code: 170001, message: Staging error: cannot get instances since staging failed Cloning into '/tmp/buildpacks/nope-buildpack'... FAILED Server error, status code: 400, error code: 170001, message: Staging error: cannot get instances since staging failed
  • 11. III. App staging errors – buildpack err  ERR 8: detection failure  Cause 1: wrong app package  Do not create a root folder inside the zip  Cause 2: pushing from a wrong directory  Cause 3: required buildpack not installed  Diagnosis: run “cf buildpacks” to view available buildpacks  Solution: ask admin to install the missing ones using “cf create-buildpack”  Cause 4: buildpack defect: change app files in its detect code!!! Server error, status code: 400, error code: 170003, message: An app was not successfully detected by any available buildpack
  • 12. III. App staging errors – compilation err  ERR 9: compilation step failed  Diagnosis  Turn on buildpack traces if supported  Java/Liberty buildpack: cf set-env <appname> JBP_LOG_LEVEL DEBUG  Node.js buildpack: cf set-env <appname> npm_config_xyz or include a .npmrc file in the app package root  loglevel = silly  PHP buildpack: cf set-env <appname> BP_DEBUG true  Run “cf logs <appname> --recent” to get recent logs after the failure  Run “cf logs <appname>” in another shell console during staging Staging failed: Buildpack compilation step failed FAILED Server error, status code: 400, error code: 170004, message: App staging failed in the buildpack compile phase
  • 13. III. App staging errors – compilation err  Cause 1: wrong app package or files  Example: malformed package.json in a node.js app  Cause 2: unable to reach external dependencies  Example: unable to reach NPM repo  Solution: check connectivity to external dependencies.  Make sure Security Group is set correctly to allow connections to those dependencies. 2015-04-27T12:06:35.20-0400 [STG/0] ERR parse error: Expected separator between values at line 12, column 13 2015-04-27T12:06:35.20-0400 [STG/0] OUT Staging failed: Buildpack compilation step failed 2015-04-27T12:18:47.65-0400 [STG/0] OUT -----> Installing dependencies 2015-04-27T12:19:58.33-0400 [STG/0] OUT npm ERR! network getaddrinfo ENOTFOUND 2015-04-27T12:19:58.33-0400 [STG/0] OUT npm ERR! network This is most likely not a problem with npm itself 2015-04-27T12:19:58.33-0400 [STG/0] OUT npm ERR! network and is related to network connectivity. 2015-04-27T12:19:58.33-0400 [STG/0] OUT npm ERR! network In most cases you are behind a proxy or have bad network settings.
  • 14. III. App staging errors – compilation err  Cause 3: staging timeout (default limit is 15 minutes), dies suddenly & quietly  Solution: do less time-consuming tasks during staging. E.g., cache large runtime binary files instead of downloading them  Note that CF_STAGING_TIMEOUT only controls the CLI wait time.  Cause 4: staging uses too much memory (default limit is 1G), dies suddenly & quietly  Solution: make sure the buildpack releases memories diligently during staging  Cause 5: staging uses too much disk (default limit is 2G)  Solution: make sure the buildpack deletes temporary files diligently during staging 2015-04-27T16:49:36.22-0400 [STG/0] ERR /tmp/buildpacks/java-buildpack/bin/compile:41:in `write': Disk quota exceeded - /tmp/staged/app/some_file (Errno: DQUOT)
  • 15. III. App staging errors – compilation err  Cause 6: using unmatching buildpack level  Solution: avoid pushing with an external buildpack’s master branch, better to use a released version, like cf push <appname> -b https://github.com/cloudfoundry/java-buildpack.git#v3.0  Cause 7: picked up by wrong buildpack (verify the detected_buildpack field)  Solution  Use “-b” option to specify the buildpack explicitly, could be the name of an installed admin buildpack (those listed by “cf buildpacks”)  Does the app contain some suspicious sign files?  Cause 8: script permission in the buildpack, e.g., “x” bit not set  Solution: add “x” to all executable scripts in the buildpack
  • 16. IV. App startup errors  ERR 10: start app timeout or unsuccessful -----> Uploading droplet (14M) 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 down FAILED Start app timeout (Or, “Start unsuccessful”) $ cf app jackruby Showing health and status for app jackruby in org myorg / space myspace as myself... OK requested state: started instances: 0/1 usage: 128M x 1 instances urls: jackruby.mybluemix.net last uploaded: Wed Apr 29 18:40:40 UTC 2015 state since cpu memory disk #0 crashing 2015-04-29 02:42:28 PM 0.0% 0 of 0 0 of 0
  • 17. IV. App startup errors  Diagnosis  Run “cf logs <appname> --recent” to get recent logs after the failure  Run “cf logs <appname>” in another shell console during staging 2015-04-29T12:35:49.43-0400 [STG/27] OUT -----> Uploading droplet (14M) 2015-04-29T12:35:54.37-0400 [DEA/27] OUT Starting app instance (index 0) with guid ceb4f93b-6306-4842- 8637-1d1731412bdc 2015-04-29T12:37:06.75-0400 [DEA/27] ERR Instance (index 0) failed to start accepting connections 2015-04-29T12:37:06.76-0400 [API/8] OUT App instance exited with guid ceb4f93b-6306-4842-8637- 1d1731412bdc payload: {"cc_partition"=>"default", "droplet"=> "ceb4f93b-6306-4842-8637-1d1731412bdc", "version"=>"d237ca74-f30a-41fc-afd8-fe8f66152698", "instance"=>"b7e9b891ddd7474f828412bd1d7bb329", "index"=>0, "reason"= >"CRASHED", "exit_status"=>-1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1430325426} 2015-04-29T12:37:07.00-0400 [App/0] ERR … 2015-04-29T14:27:51.12-0400 [STG/8] OUT -----> Uploading droplet (14M) 2015-04-29T14:27:54.83-0400 [DEA/8] OUT Starting app instance (index 0) with guid ceb4f93b-6306-4842- 8637-1d1731412bdc 2015-04-29T14:28:06.98-0400 [API/3] OUT App instance exited with guid ceb4f93b-6306-4842-8637- 1d1731412bdc payload: {"cc_partition"=>"default", "droplet"=> "ceb4f93b-6306-4842-8637-1d1731412bdc", "version"=>"73474c66-caaa-470b-ad88-28e854c7db83", "instance"=>"0baf945674c94a9db294caa6ce0b991d", "index"=>0, "reason"= >"CRASHED", "exit_status"=>0, "exit_description"=>"app instance exited", "crash_timestamp"=>1430332086} 2015-04-29T14:29:07.02-0400 [DEA/8] ERR Instance (index 0) failed to start accepting connections
  • 18. IV. App startup errors  Cause 1: taking too long to start  General solution:  Increase startup timeout by specifying “-t” option when pushing, default is 60 seconds, and max is 180 seconds.  180 seconds not enough?  Root cause 1: too much initialization during startup, such as loading lots of data  Solution 1: start with “--no-route”, then do “map-route” when initialization is done  Solution 2: lazy initialization and/or async initialization  Root cause 2: listening on the wrong port  Solution: make sure the app is listening on $PORT  Root cause 3: reaching out to external network but timeout  Solution: check connectivity to external dependencies. Make sure Security Group is set correctly.
  • 19. IV. App startup errors  Cause 2: app logic error and exiting  Missing service binding?  Cause 3: consuming too much memory  Solution:  Check for memory leakage  Repush with increased memory allocation cf push <appname> -m 2G  Cause 4: consuming too much disk (After reaching the quota, your app will fail to write any additional data to disk.)  Solution: repush with increased disk allocation cf push <appname> -k 2G Note: you cannot go beyond the max set by the provider, default is 2G.
  • 20. IV. App startup errors  Advanced diagnosis techniques  Keep the container alive after app crashing (so that you can do “cf files” etc.)  With IBM JDK, -Xdump:tool JVM option can be used to run some scripts before the JVM exits, e.g.: cf se <appname> JVM_ARGS -Xdump:tool:events=vmstop,exec="sleep 1d" Better together with: -Xdump:heap+java:events=vmstop  For general apps, modify the start command to add “;sleep 1d” cf push <appname> -c “<original_command> ;sleep 1d” --no-route  Run an agent process as the main process to get the container up, then diagnose the app  cf-ssh  “Development mode” in Bluemix  Final tip: “cf delete” to clean up the history and repush
  • 21. Summary I. Client errors II. Fabric errors III. App staging errors IV. App startup errors