You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Downscaling from 2–5 gears to 1–1 worked.
Upscaling back to 2–5 failed, twice:
Unable to complete the requested operation. Show less
deployment_id must be supplied
Unable to complete the requested operation due to: An invalid exit code (1) was returned from the server ex-std-node638.prod.rhcloud.com. This indicates an unexpected problem during the execution of your request.
Reference ID: 9aba0349e6e0858d78523d977b666ea6
git fsck on the gear (under app-root/git/mathdown.git) had no complaints.
Didn't find any problems (or generally traces of the attempted deploys & scaling) anywhere in app-root/logs/...
Same from command line:
$ rhc cartridge scale -a mathdown
Missing required argument 'cartridge'.
Usage: rhc cartridge-scale <cartridge> [multiplier] [--namespace NAME] [--app NAME] [--min min] [--max max]
Pass '--help' to see the full list of options
~ $ rhc cartridge scale node -a mathdown --min 2 --max 5
Using nodejs-0.10 (Node.js 0.10) for 'node'
This operation will run until the application is at the minimum scale and may take several minutes.
Setting scale range for nodejs-0.10 ...
Unable to complete the requested operation due to: An invalid exit code (1) was returned from the server ex-std-node638.prod.rhcloud.com. This indicates an unexpected problem during the execution of your
request.
Reference ID: 05e26de2bd916e2fd87907a53a5c8108
Turns out I have no support on bronze plan, only IRC. Though that might be actually faster. Except it might be unproductive if I can't stay in the conversation.
A hypothesis I want to check: now that I have 1 gear, git push deploys will probably work.
It seems it's the main gear -> extra gears deploy that's borked.
Simpler idea: since RHcloud currenly only serves mathdown.com (mathdown.net points to Heroku),
I'll just destroy and re-create the app. I'm 90% sure it'll work.
$ rhc app tidy -a mathdown
RESULT:
mathdown cleaned up
followed by deploy.sh.
I don't really expect app tidy to help but the deploy might succeed since I now have only 1 gear.
(Side effect of having 1 gear: "Monitor is DOWN: mathdown.com" — deploys cause downtime)
But as already established, main gear -> extra gears copy is the broken part:
$ rhc cartridge scale node -a mathdown --min 2 --max 5
Using nodejs-0.10 (Node.js 0.10) for 'node'
This operation will run until the application is at the minimum scale and may take several minutes.
Setting scale range for nodejs-0.10 ... Server returned an unexpected error code: 504
Created via Launch on OpenShift button in readme. Enabled scaling (but still at 1 gear).
Wow, it's slow. (aka I'm spoiled by Heroku).
App exists, haproxy still shows 0 gears, gear status in dashboard is "Building".
Scaling is default 1-16.
Wait, what just happened?!
Application '55e22d8f7628e18a6f0000d9' does not exist
Reference #92544a002fc757c7b015476bc10d0cb7
random theory (for what just happened, not the original issue): I hit the inodes limit.
This doesn't hold water. mathdown8staging was created fine (though it's now giving 95% inodes warning).
Anyway trying again, this time will increase to 2GB as soon as dashboard is live.
=> "Unable to perform action on app object. Another operation is already running."
Bah.
Application '55e230252d5271f1970000d6' does not exist
OK, again, without scaling (which is how the Launch on OpenShift has worked so far).
This application is not currently scalable. For the time being applications must be set to scale when they are created. To make a new application scalable you will need to pass the command line option --scaling:
rhc create-app --scaling -a ...
or select "scaling" from the advanced options on the Create Application page.
OK, let's set up TLS certs to be back up, tomorrow study the problem on another app.
$ ./deployment/tls-certs-startcom/rhc-set-certs.sh mathdown ~/StartSSL/my-private-decrypted.key
++ dirname ./deployment/tls-certs-startcom/rhc-set-certs.sh
+ cd ./deployment/tls-certs-startcom
+ appopts=($1)
+ '[' -z '' ']'
+ keyopts=(--private-key="$2")
+ cat mathdown.com-until-2016-02-12.pem StartCom-chain-sub.class1.server.ca.pem
+ cat mathdown.net-until-2016-02-15.pem StartCom-chain-sub.class1.server.ca.pem
+ echo '== before: =='
== before: ==
+ rhc alias list mathdown
No aliases associated with the application mathdown.
+ rhc alias add mathdown mathdown.net
Alias 'mathdown.net' has been added.
+ rhc alias add mathdown www.mathdown.net
Alias 'www.mathdown.net' has been added.
+ rhc alias add mathdown mathdown.com
Alias 'mathdown.com' has been added.
+ rhc alias add mathdown www.mathdown.com
Alias 'www.mathdown.com' has been added.
+ rhc alias update-cert mathdown mathdown.net --certificate GENERATED-CHAINED-mathdown.net.pem --private-key=/home/beni/StartSSL/my-private-decrypted.key
SSL certificate successfully added.
+ rhc alias update-cert mathdown www.mathdown.net --certificate GENERATED-CHAINED-mathdown.net.pem --private-key=/home/beni/StartSSL/my-private-decrypted.key
SSL certificate successfully added.
+ rhc alias update-cert mathdown mathdown.com --certificate GENERATED-CHAINED-mathdown.com.pem --private-key=/home/beni/StartSSL/my-private-decrypted.key
SSL certificate successfully added.
+ rhc alias update-cert mathdown www.mathdown.com --certificate GENERATED-CHAINED-mathdown.com.pem --private-key=/home/beni/StartSSL/my-private-decrypted.key
SSL certificate successfully added.
+ echo '== after: =='
== after: ==
+ rhc alias list mathdown
Alias Has Certificate? Certificate Added
---------------- ---------------- -----------------
mathdown.net yes 2015-08-29
www.mathdown.net yes 2015-08-29
mathdown.com yes 2015-08-29
www.mathdown.com yes 2015-08-29
New theory: the gear state wasn't broken, there is something inherent in my current code that's undeployable to a new gear.
Best random guess: npm shrinkwrap (see warnings #82 (comment)).
But I can do better that guess: I can create from empty repo and and then try pushing current code, and I can even git bisect creation (by moving a branch wherever git bisect points me)!
Tried medium gear. Subjectively faster, failed quota too:
DEBUG: Request POST https://openshift.redhat.com/broker/rest/domain/mathdown/applications
DEBUG: code 422 169655 ms
Warning: Gear 55edcc3c7628e1a63200018d is using 100.0% of inodes allowed
The initial build for the application failed: Shell command '/sbin/runuser -s /bin/sh 55edcc3c7628e1a63200018d -c "exec /usr/bin/runcon 'unconfined_u:system_r:openshift_t:s0:c2,c144' /bin/sh -c \"gear
postreceive --init >> /tmp/initial-build.log 2>&1\""' returned an error. rc=255
.Last 10 kB of build output:
recv_generator: mkdir "/var/lib/openshift/55edcc3c7628e1a63200018d/app-deployments/2015-09-07_13-41-54.314/repo/node_modules/mathjax/localization/oc" failed: Disk quota exceeded (122)
*** Skipping any contents from this failed directory ***
...
For more details about the problem, try running the command again with the '--trace' option.
On second attempt with -g medium --trace, created successfully and rather fast:
DEBUG: Request POST https://openshift.redhat.com/broker/rest/domain/mathdown/applications
DEBUG: code 201 138436 ms
EDIT: ah, that's for deploying gh-pages, not the npm-mathjax branch.
This is embarassingly simple. If I want stuff to move faster I should pay for a beefier machine slice!
small.highcpu worked too (151041ms for the critical POST).
That's good as small.highcpu is already $18/mo per gear, and I want at least 2 (for zero-downtime deploys), vs $36/mo per medium gear.
More interesting: a deploy with --enable-jenkins succeeded, on small gear!
I now have a https://jenkins-mathdown.rhcloud.com, and a Jenkins Client cartridge in the gear.
On create, it seems the target app was created first (which was fast), then the build was sent to Jenkins, which created a new app for building (TARGETbldr), copied source there, built, copied result to the target app, and only then it started serving.
[https://developers.openshift.com/en/managing-continuous-integration.html]
On git push, a similarly complicated dance happens and the build claimed success; however the git push timed out, and I don't see the effect).
=> I think I'll do both. Jenkins, small for the staging and small.highcpu (no jenkins) for the prod.
Nah, this morning I found the Jenkins instance unresponsive.
After destroying the jenkins app, creating with --enable-jenkins timed out.
I then tried first creating the jenkins app, then creating mathdown with --enable-jenkins — also timed out but the app was created.
Documenting it, but giving up.
However I now tried something I should have done from the beginning:
creating empty app (without --from-code) [49sec], then git push -f [1m19sec] — worked!
(an empty app gets some initial scaffolding; most tutorials involving an empty app recommend git pull/merge from it, but I didn't want to pollute my history just to deploy an existing version. For some reason I never tried push -f to replace OpenShift's initial commit...)
=> The new both strategies I'm gonna do is use the empty create + push for staging, and small.highcpu gears for prod.
eh, removing aliases means http stopped working too (no longer routed to the right gear).
but removing only SSL alias would not be enough, prevents adding alias on new app :-(
Activity
cben commentedon Aug 14, 2015
Will wait to see if it comes back automatically (just out of curiousity).
Then probably will pull the "Restart Application" trigger in the dashboard.
cben commentedon Aug 14, 2015
git push is still stuck; the gear is back up.
interestingly, both gears have been restarted — 9m37s UP (local) & 10m20s UP (the other).
If both have been pushed, git push should have printed a lot about that.
https://mathdown-cben.rhcloud.com/deployment/deploy.sh (new file in this commit) is 404.
Yes, only one has been deployed.
(conceptually, that's worse than one node staying down: mixed versions served randomly to users!)
It's strange they're both listed as having haproxy!
But
rhc ssh --gears mathdown -- ps auxshows only 546a6d7e5973cac907000028 actually runs haproxy.cben commentedon Aug 14, 2015
Pulled the restart trigger => Application mathdown has restarted.
ssh ls shows they're still mixed versions :-(
Let's try deploy again.
cben commentedon Aug 14, 2015
Since the main gear is up-to-date and the secondary isn't, let's try reducing to 1 gear and back.
cben commentedon Aug 14, 2015
Downscaling from 2–5 gears to 1–1 worked.
Upscaling back to 2–5 failed, twice:
should contact support.
cben commentedon Aug 16, 2015
git fsckon the gear (under app-root/git/mathdown.git) had no complaints.Didn't find any problems (or generally traces of the attempted deploys & scaling) anywhere in app-root/logs/...
Same from command line:
Turns out I have no support on bronze plan, only IRC. Though that might be actually faster. Except it might be unproductive if I can't stay in the conversation.
A hypothesis I want to check: now that I have 1 gear, git push deploys will probably work.
It seems it's the main gear -> extra gears deploy that's borked.
cben commentedon Aug 29, 2015
Simpler idea: since RHcloud currenly only serves mathdown.com (mathdown.net points to Heroku),
I'll just destroy and re-create the app. I'm 90% sure it'll work.
cben commentedon Aug 29, 2015
First did a last experiment:
followed by deploy.sh.
I don't really expect
app tidyto help but the deploy might succeed since I now have only 1 gear.(Side effect of having 1 gear: "Monitor is DOWN: mathdown.com" — deploys cause downtime)
=> Yes, deploy worked.
cben commentedon Aug 29, 2015
But as already established, main gear -> extra gears copy is the broken part:
cben commentedon Aug 29, 2015
Pulled the trigger:
Created via Launch on OpenShift button in readme. Enabled scaling (but still at 1 gear).
Wow, it's slow. (aka I'm spoiled by Heroku).
App exists, haproxy still shows 0 gears, gear status in dashboard is "Building".
Scaling is default 1-16.
Wait, what just happened?!
cben commentedon Aug 29, 2015
random theory (for what just happened, not the original issue): I hit the inodes limit.
This doesn't hold water. mathdown8staging was created fine (though it's now giving 95% inodes warning).
Anyway trying again, this time will increase to 2GB as soon as dashboard is live.
=> "Unable to perform action on app object. Another operation is already running."
Bah.
OK, again, without scaling (which is how the Launch on OpenShift has worked so far).
cben commentedon Aug 29, 2015
Yay! It's up.
Set storage to 2GB.
Bah! I can't turn it to scalable now :-(
cben commentedon Aug 29, 2015
OK, let's set up TLS certs to be back up, tomorrow study the problem on another app.
New theory: the gear state wasn't broken, there is something inherent in my current code that's undeployable to a new gear.
Best random guess: npm shrinkwrap (see warnings #82 (comment)).
But I can do better that guess: I can create from empty repo and and then try pushing current code, and I can even git bisect creation (by moving a branch wherever git bisect points me)!
23 remaining items
Experiment: get MathJax from npm instead of submodule.
cben commentedon Sep 7, 2015
Experimented with mathjax via npm instead of submodule [6eff9f6, f7e0618].
Timed out.
Learnt a trick for timing build: as soon as possible to ssh, run:
Let's try that again...
cben commentedon Sep 7, 2015
Hmm.
cben commentedon Sep 7, 2015
Tried medium gear. Subjectively faster, failed quota too:
cben commentedon Sep 7, 2015
Another undocumented option?
On second attempt with
-g medium --trace, created successfully and rather fast:EDIT: ah, that's for deploying gh-pages, not the npm-mathjax branch.
This is embarassingly simple. If I want stuff to move faster I should pay for a beefier machine slice!
Let's try small.highcpu gear.
cben commentedon Sep 7, 2015
small.highcpu worked too (151041ms for the critical POST).
That's good as small.highcpu is already $18/mo per gear, and I want at least 2 (for zero-downtime deploys), vs $36/mo per medium gear.
cben commentedon Sep 7, 2015
Quota is same for any gear size: 381 MB used / 1 GB limit.
cben commentedon Sep 7, 2015
More interesting: a deploy with
--enable-jenkinssucceeded, on small gear!I now have a https://jenkins-mathdown.rhcloud.com, and a Jenkins Client cartridge in the gear.
On create, it seems the target app was created first (which was fast), then the build was sent to Jenkins, which created a new app for building (
TARGETbldr), copied source there, built, copied result to the target app, and only then it started serving.[https://developers.openshift.com/en/managing-continuous-integration.html]
On git push, a similarly complicated dance happens and the build claimed success; however the git push timed out, and I don't see the effect).
=> I think I'll do both. Jenkins, small for the staging and small.highcpu (no jenkins) for the prod.
cben commentedon Sep 8, 2015
Nah, this morning I found the Jenkins instance unresponsive.
After destroying the jenkins app, creating with
--enable-jenkinstimed out.I then tried first creating the jenkins app, then creating mathdown with
--enable-jenkins— also timed out but the app was created.Documenting it, but giving up.
However I now tried something I should have done from the beginning:
creating empty app (without
--from-code) [49sec], thengit push -f[1m19sec] — worked!(an empty app gets some initial scaffolding; most tutorials involving an empty app recommend git pull/merge from it, but I didn't want to pollute my history just to deploy an existing version. For some reason I never tried
push -fto replace OpenShift's initial commit...)=> The new both strategies I'm gonna do is use the empty create + push for staging, and small.highcpu gears for prod.
Update docs for new prod & staging on RHcloud. (DNS to be flipped soon)
cben commentedon Sep 8, 2015
flipping DNS to https://prod-mathdown.rhcloud.com:
./deployment/tls-certs-startcom/rhc-set-certs.sh 'prod -n mathdown' ~/StartSSL/my-private-decrypted.keycben"domain").cben commentedon Sep 8, 2015
eh, removing aliases means http stopped working too (no longer routed to the right gear).
but removing only SSL alias would not be enough, prevents adding alias on new app :-(
cben commentedon Sep 8, 2015
PHEW. CLOSING.
Might re-open if it happens again (staging is using
smallgears in hope I'll catch problems there before they hit prod)cben commentedon Sep 10, 2015
Hmm.
Load tested staging (2 small gears) twice using https://loader.io.
Started misbehaving (latency AND errors) at ~1600 "clients/sec" but I'm not sure they actually mean 1600 https reqs/sec ("clients" is climbing, bandwidth stays ~constant?):
https://loader.io/reports/946e577dd04b776c8ae541c7c66e37dc/results/c59a6f817f6af8f1ac59b6e6074ac076#connections
Good news is that it tried to scale (not fast enough but this load climbs unrealisticially fast), bad news is first time it failed with 504:
Second time it scaled successfully, and scaled down 10min later:
The only thing here I don't understand is the brief "express/local-gear is DOWN for maintenance"...