SlideShare uma empresa Scribd logo
1 de 22
Baixar para ler 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!

Mais conteúdo relacionado

Mais procurados

An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to MavenVadym Lotar
 
Django Web Application Security
Django Web Application SecurityDjango Web Application Security
Django Web Application Securitylevigross
 
Security Testing
Security TestingSecurity Testing
Security TestingKiran Kumar
 
가상화된 코드를 분석해보자
가상화된 코드를 분석해보자가상화된 코드를 분석해보자
가상화된 코드를 분석해보자dkswognsdi
 
Pentesting GraphQL Applications
Pentesting GraphQL ApplicationsPentesting GraphQL Applications
Pentesting GraphQL ApplicationsNeelu Tripathy
 
Mobile platform security models
Mobile platform security modelsMobile platform security models
Mobile platform security modelsG Prachi
 
Fast detection of Android malware: machine learning approach
Fast detection of Android malware: machine learning approachFast detection of Android malware: machine learning approach
Fast detection of Android malware: machine learning approachYury Leonychev
 
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense MechanismsCh 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense MechanismsSam Bowne
 
Protecting the Network From Yourself Using Defense in Depth
Protecting the Network From Yourself Using Defense in DepthProtecting the Network From Yourself Using Defense in Depth
Protecting the Network From Yourself Using Defense in DepthPECB
 
REST APIs in Laravel 101
REST APIs in Laravel 101REST APIs in Laravel 101
REST APIs in Laravel 101Samantha Geitz
 
Penetration Testing Report
Penetration Testing ReportPenetration Testing Report
Penetration Testing ReportAman Srivastava
 
Threat Hunting with Elastic at SpectorOps: Welcome to HELK
Threat Hunting with Elastic at SpectorOps: Welcome to HELKThreat Hunting with Elastic at SpectorOps: Welcome to HELK
Threat Hunting with Elastic at SpectorOps: Welcome to HELKElasticsearch
 
Test Automation Framework Development Introduction
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development IntroductionGanuka Yashantha
 
Practical Malware Analysis Ch12
Practical Malware Analysis Ch12Practical Malware Analysis Ch12
Practical Malware Analysis Ch12Sam Bowne
 

Mais procurados (20)

An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
 
Django Web Application Security
Django Web Application SecurityDjango Web Application Security
Django Web Application Security
 
Apache web service
Apache web serviceApache web service
Apache web service
 
Security Testing
Security TestingSecurity Testing
Security Testing
 
가상화된 코드를 분석해보자
가상화된 코드를 분석해보자가상화된 코드를 분석해보자
가상화된 코드를 분석해보자
 
Pentesting GraphQL Applications
Pentesting GraphQL ApplicationsPentesting GraphQL Applications
Pentesting GraphQL Applications
 
Mobile platform security models
Mobile platform security modelsMobile platform security models
Mobile platform security models
 
OWASP Risk Rating Methodology.pptx
OWASP Risk Rating Methodology.pptxOWASP Risk Rating Methodology.pptx
OWASP Risk Rating Methodology.pptx
 
Fast detection of Android malware: machine learning approach
Fast detection of Android malware: machine learning approachFast detection of Android malware: machine learning approach
Fast detection of Android malware: machine learning approach
 
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense MechanismsCh 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
 
Protecting the Network From Yourself Using Defense in Depth
Protecting the Network From Yourself Using Defense in DepthProtecting the Network From Yourself Using Defense in Depth
Protecting the Network From Yourself Using Defense in Depth
 
REST APIs in Laravel 101
REST APIs in Laravel 101REST APIs in Laravel 101
REST APIs in Laravel 101
 
Penetration Testing Report
Penetration Testing ReportPenetration Testing Report
Penetration Testing Report
 
Threat Hunting with Elastic at SpectorOps: Welcome to HELK
Threat Hunting with Elastic at SpectorOps: Welcome to HELKThreat Hunting with Elastic at SpectorOps: Welcome to HELK
Threat Hunting with Elastic at SpectorOps: Welcome to HELK
 
Test Automation Framework Development Introduction
Test Automation Framework Development IntroductionTest Automation Framework Development Introduction
Test Automation Framework Development Introduction
 
Http security response headers
Http security response headers Http security response headers
Http security response headers
 
Flask
FlaskFlask
Flask
 
Practical Malware Analysis Ch12
Practical Malware Analysis Ch12Practical Malware Analysis Ch12
Practical Malware Analysis Ch12
 
Mobile App Security Testing -2
Mobile App Security Testing -2Mobile App Security Testing -2
Mobile App Security Testing -2
 
Understanding NMAP
Understanding NMAPUnderstanding NMAP
Understanding NMAP
 

Semelhante a 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
 

Semelhante a 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
 

Último

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 

Último (20)

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

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