Skip to content

Instantly share code, notes, and snippets.

@jackfrancis
Last active October 1, 2015 20:14
Show Gist options
  • Save jackfrancis/b412c3268267aa205a25 to your computer and use it in GitHub Desktop.
Save jackfrancis/b412c3268267aa205a25 to your computer and use it in GitHub Desktop.
deisctl builder restart corrupted git cache repro attempt on stateless cluster

on the builder:

/ # ls -lah /home/git/francis-node-test.git/
total 52K
drwxr-sr-x  9 root git 4.0K Sep 30 00:44 .
drwxr-sr-x  1 git  git 4.0K Oct  1 19:46 ..
-rw-r--r--  1 root git   23 Sep 30 00:40 HEAD
drwxr-sr-x  2 root git 4.0K Sep 30 00:40 branches
drwxr-sr-x  3 root git 4.0K Sep 30 00:40 build
drwxr-sr-x  2 root git 4.0K Sep 30 00:40 cache
-rwxr--r--  1 root git   66 Sep 30 00:40 config
-rw-r--r--  1 root git   73 Sep 30 00:40 description
drwxr-sr-x  2 root git 4.0K Sep 30 00:40 hooks
drwxr-sr-x  2 root git 4.0K Sep 30 00:44 info
drwxr-sr-x 10 root git 4.0K Sep 30 00:40 objects
-rw-r--r--  1 root git   39 Sep 30 00:44 packed-refs
drwxr-sr-x  4 root git 4.0K Sep 30 00:40 refs
/ # rm -Rf /home/git/francis-node-test.git/

then re-pushed the deleted app:

Francismac:deployment jackfrancis$ cd ~/repo/hello-node-docker/
Francismac:hello-node-docker jackfrancis$ git push deis master
Warning: Permanently added the RSA host key for IP address '[52.8.174.127]:2222' to the list of known hosts.
Everything up-to-date
Francismac:hello-node-docker jackfrancis$ git push deis master
Warning: Permanently added the RSA host key for IP address '[54.183.241.124]:2222' to the list of known hosts.
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 846 bytes | 0 bytes/s, done.
Total 6 (delta 0), reused 0 (delta 0)

-----> Building Docker image
remote: build context to Docker daemon 4.608 kB
remote: build context to Docker daemon 
Step 0 : FROM node:0.10
 ---> 53a86cbfc348
Step 1 : MAINTAINER jackfrancis@gmail.com
 ---> Using cache
 ---> c4a39733b2f8
Step 2 : COPY src/ /src
 ---> d802e8b01356
Removing intermediate container 68c57fa71bc5
Step 3 : RUN cd /src && npm install
 ---> Running in 3559b0c7379a
npm WARN package.json hello-node-docker@0.0.0 No repository field.
npm WARN package.json hello-node-docker@0.0.0 No README data
express@4.13.3 node_modules/express
├── escape-html@1.0.2
├── merge-descriptors@1.0.0
├── array-flatten@1.1.1
├── cookie@0.1.3
├── utils-merge@1.0.0
├── cookie-signature@1.0.6
├── methods@1.1.1
├── fresh@0.3.0
├── range-parser@1.0.2
├── vary@1.0.1
├── path-to-regexp@0.1.7
├── content-type@1.0.1
├── etag@1.7.0
├── parseurl@1.3.0
├── content-disposition@0.5.0
├── serve-static@1.10.0
├── depd@1.0.1
├── qs@4.0.0
├── finalhandler@0.4.0 (unpipe@1.0.0)
├── on-finished@2.3.0 (ee-first@1.1.1)
├── debug@2.2.0 (ms@0.7.1)
├── proxy-addr@1.0.8 (forwarded@0.1.0, ipaddr.js@1.0.1)
├── send@0.13.0 (destroy@1.0.3, statuses@1.2.1, ms@0.7.1, mime@1.3.4, http-errors@1.3.1)
├── type-is@1.6.9 (media-typer@0.3.0, mime-types@2.1.7)
└── accepts@1.2.13 (negotiator@0.5.3, mime-types@2.1.7)
 ---> 043367067f6f
Removing intermediate container 3559b0c7379a
Step 4 : EXPOSE 8000
 ---> Running in cf834a9099b0
 ---> 4c387ba5de04
Removing intermediate container cf834a9099b0
Step 5 : CMD node /src/index.js
 ---> Running in 9c191b5e2f45
 ---> 4263e6db84e5
Removing intermediate container 9c191b5e2f45
Step 6 : ENV GIT_SHA 801be6de4ca46a086f5fc86d7fa254fdec27ec08
 ---> Running in e5ba0b9e36d9
 ---> 9ac72e87ee77
Removing intermediate container e5ba0b9e36d9
Successfully built 9ac72e87ee77
-----> Pushing image to private registry

-----> Launching... 
       done, francis-node-test:v3 deployed to Deis

       http://francis-node-test.canary-stateless.deis.works

       To learn more, use `deis help` or visit http://deis.io

To ssh://git@deis.canary-stateless.deis.works:2222/francis-node-test.git
 * [new branch]      master -> master
Francismac:hello-node-docker jackfrancis$ echo $?
0

then, confirmed that the app’s git directory was recreated on the builder following the re-push:

/ # ls -lah /home/git/francis-node-test.git/
total 52K
drwxr-sr-x  9 root git 4.0K Oct  1 19:48 .
drwxr-sr-x  1 git  git 4.0K Oct  1 19:49 ..
-rw-r--r--  1 root git   23 Oct  1 19:47 HEAD
drwxr-sr-x  2 root git 4.0K Oct  1 19:47 branches
drwxr-sr-x  3 root git 4.0K Oct  1 19:47 build
drwxr-sr-x  2 root git 4.0K Oct  1 19:47 cache
-rwxr--r--  1 root git   66 Oct  1 19:47 config
-rw-r--r--  1 root git   73 Oct  1 19:47 description
drwxr-sr-x  2 root git 4.0K Oct  1 19:47 hooks
drwxr-sr-x  2 root git 4.0K Oct  1 19:48 info
drwxr-sr-x 10 root git 4.0K Oct  1 19:47 objects
-rw-r--r--  1 root git   39 Oct  1 19:48 packed-refs
drwxr-sr-x  4 root git 4.0K Oct  1 19:47 refs

then, restarted the builder:

Francismac:hello-node-docker jackfrancis$ deisctl restart builder
deis-builder.service: inactive/dead                                  
deis-builder.service: active/running                                 
Francismac:hello-node-docker jackfrancis$ echo $?
0

and now, I don’t have a francis-node-test.git file in /home/git on my builder (as expected post-builder restart):

Francismac:hello-node-docker jackfrancis$ deisctl dock builder
Executing 'docker exec -it deis-builder sh' on 10.21.1.209
/ # ls -lah /home/git/francis-node-test.git/
ls: cannot access /home/git/francis-node-test.git/: No such file or directory
/ # ls -lah /home/git/
total 28K
drwxr-sr-x 1 git  git  4.0K Oct  1 19:51 .
drwxr-xr-x 1 root root 4.0K Sep 29 16:57 ..
drwxr-sr-x 1 git  git  4.0K Oct  1 19:51 .ssh
-rwxr-xr-x 1 root root 4.7K Oct  1 19:50 builder
-rwxr-xr-x 1 root root  585 Oct  1 19:50 check-repos
-rwxr-xr-x 1 root root  567 Oct  1 19:50 receiver

the app is running in the cluster:

Francismac:hello-node-docker jackfrancis$ deis apps

  !    WARNING: Client and server API versions do not match. Please consider upgrading.
  !    Client version: 1.4
  !    Server version: 1.6

=== Apps
francis-node-test

and the app is running fine:

Francismac:hello-node-docker jackfrancis$ curl -I http://francis-node-test.canary-stateless.deis.works/
HTTP/1.1 200 OK
Server: nginx/1.9.4
Date: Thu, 01 Oct 2015 19:56:23 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 27
Connection: keep-alive
X-Powered-By: Express
ETag: W/"1b-XPJLOvjiXRVYxQV7nz+1wA”
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment