Upgrade ghost to v3.0

Page content
  • 부제 1. pod가 동작하지 않을때 원인 찾기
  • 부제 2. helm upgrade 명령을 이용하여 업데이트 하기
  • 부제 3. sqlite를 이용해서 ghost.db 직접 수정하기

values.yaml에 명시되어 있는 ghost docker image의 버전 정보를 2.31.0에서 3.0.2 최신 버전으로 업데이트 후 아래 명령어로 업데이트

$ helm upgrade --debug my-ghost ghost-with-helm
[debug] Created tunnel using local port: '45263'

[debug] SERVER: "127.0.0.1:45263"

REVISION: 6
RELEASED: Tue Nov  5 22:25:19 2019
CHART: ghost-0.1.0
USER-SUPPLIED VALUES:
{}

COMPUTED VALUES:
affinity: {}
env:
  node_env: production
  url: http://sosa0sa.com:2368
fullnameOverride: ""
image:
  pullPolicy: Always
  registry: docekr.io
  repository: ghost
  tag: 3.0.2

Helm upgrade는 완료되었지만 ghost 블로그가 접속이 되지 않는다. 상태를 확인해 보니

$ kubectl get pod
NAME                        READY   STATUS             RESTARTS   AGE
my-ghost-795c6d674f-jb6t2   0/1     CrashLoopBackOff   4          3m6s
sctp-7c94d9b5c9-wsjnd       1/1     Running            2          28d

$ kubectl describe pod my-ghost-795c6d674f-jb6t2
...
Events:
  Type     Reason     Age                    From               Message
  ----     ------     ----                   ----               -------
  Normal   Scheduled  <unknown>              default-scheduler  Successfully assigned default/my-ghost-795c6d674f-jb6t2 to mini1
  Normal   Started    5m32s (x2 over 6m1s)   kubelet, mini1     Started container ghost
  Warning  Unhealthy  5m29s (x2 over 5m59s)  kubelet, mini1     Readiness probe failed: Get http://10.244.51.112:2368/: dial tcp 10.244.51.112:2368: connect: connection refused
  Warning  Unhealthy  5m26s (x2 over 5m56s)  kubelet, mini1     Liveness probe failed: Get http://10.244.51.112:2368/: dial tcp 10.244.51.112:2368: connect: connection refused
  Warning  Unhealthy  5m9s (x4 over 5m48s)   kubelet, mini1     Readiness probe failed: HTTP probe failed with statuscode: 500
  Warning  Unhealthy  5m6s (x4 over 5m46s)   kubelet, mini1     Liveness probe failed: HTTP probe failed with statuscode: 500
  Normal   Killing    5m6s (x2 over 5m36s)   kubelet, mini1     Container ghost failed liveness probe, will be restarted
  Normal   Pulling    5m6s (x3 over 6m6s)    kubelet, mini1     Pulling image "ghost:3.0.2"
  Normal   Pulled     5m2s (x3 over 6m2s)    kubelet, mini1     Successfully pulled image "ghost:3.0.2"
  Normal   Created    5m2s (x3 over 6m2s)    kubelet, mini1     Created container ghost
  Warning  BackOff    63s (x10 over 3m35s)   kubelet, mini1     Back-off restarting failed container

my-ghost로 시작하는 pod가 제대로 실행되지 않아 반복해서 재시동 되었지만 제대로 동작하지 않아 결국 실패했다.

Ghost update! 쉽게 될 리가 없지

pod 에서 발생하는 로그를 분석해서 ghost가 제대로 실행되지 않는 이유를 알아보기로 했다. Container의 로그를 인하기 위해 kubectl logs 명령어를 사용한다.

만일 pod에 여러 개의 container가 있는 경우 pod 명 뒤에 contaienr 명을 지정한다. 자세한 내용은 kubectl logs -h 로 확인해 본다.

$ kubectl logs my-ghost-795c6d674f-jb6t2
[2019-11-05 13:41:48] ERROR The currently active theme "simply" is invalid.

The currently active theme "simply" is invalid.

Error ID:
    03c2e4b0-ffd2-11e9-9543-b7dca11c112e

Details:
    checkedVersion: 3.x
    name:           simply-godofredoninja
    path:           /var/lib/ghost/content/themes/simply
    version:        0.1.1
    errors:
      -
        fatal:    true
        level:    error
        rule:     The v0.1 API and <code>ghost.url.api()</code> JavaScript helper have been removed.
        details:  The v0.1 API & Public API Beta have been removed, along with the <code>public/ghost-sdk.min.js</code> file & the <code>ghost.url.api()</code> helper.<br>All code relying on the v0.1 API must be upgraded to use the <a href="https://ghost.org/faq/upgrades/" target=_blank>new API</a>.
        regex:
        failures:
          -
            ref: assets/scripts/main.js
        code:     GS060-JS-GUA

----------------------------------------

ThemeValidationError: The currently active theme "simply" is invalid.
    at ThemeValidationError.GhostError (/var/lib/ghost/versions/3.0.2/core/server/lib/common/errors.js:10:26)
    at new ThemeValidationError (/var/lib/ghost/versions/3.0.2/core/server/lib/common/errors.js:40:20)
    at validationSuccess (/var/lib/ghost/versions/3.0.2/core/frontend/services/themes/index.js:34:48)
    at tryCatcher (/var/lib/ghost/versions/3.0.2/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/var/lib/ghost/versions/3.0.2/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/var/lib/ghost/versions/3.0.2/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/var/lib/ghost/versions/3.0.2/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/var/lib/ghost/versions/3.0.2/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/var/lib/ghost/versions/3.0.2/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/var/lib/ghost/versions/3.0.2/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/var/lib/ghost/versions/3.0.2/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/var/lib/ghost/versions/3.0.2/node_modules/bluebird/js/release/async.js:15:14)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)

[2019-11-05 13:41:52] INFO Ghost is running in production...
[2019-11-05 13:41:52] INFO Your site is now available on http://sosa0sa.com:2368/
[2019-11-05 13:41:52] INFO Ctrl+C to shut down
[2019-11-05 13:41:52] INFO Ghost boot 9.265s
[2019-11-05 13:41:53] ERROR "GET /" 500 70ms

[error.hbs] Missing helper: "foreach"

----------------------------------------

Error: [error.hbs] Missing helper: "foreach"
    at Object.<anonymous> (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js:19:13)
    at eval (eval at createFunctionContext (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), <anonymous>:6:95)
    at Object.prog [as fn] (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/runtime.js:229:12)
    at Object.<anonymous> (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/helpers/if.js:19:22)
    at Object.eval [as main] (eval at createFunctionContext (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), <anonymous>:20:32)
    at main (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/runtime.js:176:32)
    at ret (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/runtime.js:179:12)
    at ret (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:526:21)
    at renderTemplate (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:490:13)
    at render (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:526:5)
    at renderIt (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:588:18)
    at /var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:611:11
    at parseLayout (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:471:7)
    at /var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:577:7
    at /var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:565:14
    at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)

[2019-11-05 13:42:00] ERROR "GET /" 500 14ms

[error.hbs] Missing helper: "foreach"

----------------------------------------

Error: [error.hbs] Missing helper: "foreach"
    at Object.<anonymous> (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js:19:13)
    at eval (eval at createFunctionContext (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), <anonymous>:6:95)
    at Object.prog [as fn] (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/runtime.js:229:12)
    at Object.<anonymous> (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/helpers/if.js:19:22)
    at Object.eval [as main] (eval at createFunctionContext (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), <anonymous>:20:32)
    at main (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/runtime.js:176:32)
    at ret (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/runtime.js:179:12)
    at ret (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:526:21)
    at renderTemplate (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:490:13)
    at render (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:526:5)
    at renderIt (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:588:18)
    at /var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:611:11
    at parseLayout (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:471:7)
    at /var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:577:7
    at getSourceTemplate (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:551:16)
    at compileFile (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:573:5)
    at /var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:660:12
    at ExpressHbs.loadDefaultLayout (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:296:44)
    at ExpressHbs.___express (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:648:8)
    at View.render (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/view.js:135:8)
    at tryRender (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/application.js:640:10)
    at Function.render (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/response.js:1012:7)
    at _private.ThemeErrorRenderer (/var/lib/ghost/versions/3.0.2/core/server/web/shared/middlewares/error-handler.js:188:9)
    at Layer.handle_error (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:335:12)
    at next (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:275:10)
    at _private.prepareError (/var/lib/ghost/versions/3.0.2/core/server/web/shared/middlewares/error-handler.js:70:5)
    at Layer.handle_error (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:335:12)
    at next (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle_error (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/layer.js:67:12)
    at trim_prefix (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:335:12)
    at next (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle_error (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/layer.js:67:12)
    at trim_prefix (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:335:12)
    at next (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle_error (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/layer.js:67:12)
    at trim_prefix (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:335:12)
    at next (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle_error (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/layer.js:67:12)
    at trim_prefix (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:315:13)

[2019-11-05 13:42:03] ERROR "GET /" 500 26ms

[error.hbs] Missing helper: "foreach"

----------------------------------------

Error: [error.hbs] Missing helper: "foreach"
    at Object.<anonymous> (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js:19:13)
    at eval (eval at createFunctionContext (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), <anonymous>:6:95)
    at Object.prog [as fn] (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/runtime.js:229:12)
    at Object.<anonymous> (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/helpers/if.js:19:22)
    at Object.eval [as main] (eval at createFunctionContext (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), <anonymous>:20:32)
    at main (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/runtime.js:176:32)
    at ret (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/runtime.js:179:12)
    at ret (/var/lib/ghost/versions/3.0.2/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:526:21)
    at renderTemplate (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:490:13)
    at render (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:526:5)
    at renderIt (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:588:18)
    at /var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:611:11
    at parseLayout (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:471:7)
    at /var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:577:7
    at getSourceTemplate (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:551:16)
    at compileFile (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:573:5)
    at /var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:660:12
    at ExpressHbs.loadDefaultLayout (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:296:44)
    at ExpressHbs.___express (/var/lib/ghost/versions/3.0.2/node_modules/express-hbs/lib/hbs.js:648:8)
    at View.render (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/view.js:135:8)
    at tryRender (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/application.js:640:10)
    at Function.render (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/response.js:1012:7)
    at _private.ThemeErrorRenderer (/var/lib/ghost/versions/3.0.2/core/server/web/shared/middlewares/error-handler.js:188:9)
    at Layer.handle_error (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:335:12)
    at next (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:275:10)
    at _private.prepareError (/var/lib/ghost/versions/3.0.2/core/server/web/shared/middlewares/error-handler.js:70:5)
    at Layer.handle_error (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:335:12)
    at next (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle_error (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/layer.js:67:12)
    at trim_prefix (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:335:12)
    at next (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle_error (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/layer.js:67:12)
    at trim_prefix (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:335:12)
    at next (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle_error (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/layer.js:67:12)
    at trim_prefix (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:315:13)
    at /var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:335:12)
    at next (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle_error (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/layer.js:67:12)
    at trim_prefix (/var/lib/ghost/versions/3.0.2/node_modules/express/lib/router/index.js:315:13)

[2019-11-05 13:42:03] WARN Ghost has shut down
[2019-11-05 13:42:03] WARN Your site is now offline

에러 로그를 보니 기존에 ghost 2.x에서 사용하던 theme simply 가 ghost 3.0과 호환이 되지 않아서 그런 듯 한다.

ghost theme 파일들은 PV(Persistent Volume)로 마운트 되는 디렉토리에 있는데 문제를 해결할 해결책을 생각해 보면

  • theme simply를 수정해서 ghost 3.0과 호환되게 만든다.
  • theme simpy 대신 ghost 3.0과 호횐되는 기본 casper 3.0 theme을 사용한다.

첫번째 옵션은 ghost theme에 대한 연구(?)가 필요해서 보다 쉬운 두 번째 방법으로 시도해 보기로 한다. ghost 3.0과 함께 발표된 기본 theme 인 casper 3.0을 사용하도록 변경하면 되는데 문제는 theme을 변경할 수 있는 화면도 ghost가 정상적으로 실행된 경우에 접근할 수 있는 설정 화면에 있다는 거.

그렇지만 아마도 ghost가 사용하는 theme 정보가 어딘가 파일에 저장되어 있을 듯 하니 그걸 변경하면 해결할 수 있을 듯 하다.

ghost.db 파일을 직접 수정해서 theme 변경

https://blog.tylerbuchea.com/customizing-ghost/ 그리고 https://www.ghostforbeginners.com/change-ghost-theme-from-command-line/ 를 본 ghost가 동작하는데 사용하는 설정 정보들이 ghost.db에 저장되어 있는 듯 하다. 그리고 sqlite로 저장된 이 파일을 직접 수정할 수 도 있는 듯.

PV로 마운트하는 ghost의 content/data 디렉토리에 있는 ghost.db 파일을 sqlite 툴로 열어본다. 설정에 관련된 내용은 settings 테이블에 저장된 듯 하다.

$ sqlite3 ghost.db
SQLite version 3.22.0 2018-01-22 18:45:57
Enter ".help" for usage hints.

sqlite> .tables
actions                                 permissions_apps
api_keys                                permissions_roles
app_fields                              permissions_users
app_settings                            posts
apps                                    posts_authors
brute                                   posts_meta
integrations                            posts_tags
invites                                 roles
members                                 roles_users
members_stripe_customers                sessions
members_stripe_customers_subscriptions  settings
migrations                              tags
migrations_lock                         users
mobiledoc_revisions                     webhooks
permissions

sqlite> select * FROM settings;
...
59929168a13f9a00014e67da|title|Another|blog|2016-09-20 14:03:55|1|2017-11-21 14:58:13|1
59929168a13f9a00014e67db|description|Thoughts, stories and ideas.|blog|2016-09-20 14:03:55|1|2017-11-21 14:58:13|1
...

https://www.ghostforbeginners.com/change-ghost-theme-from-command-line/ 글을 참조하여 현재 사용하고 있는 theme을 가리키는 key인 activeTheme을 찾아보지만 2016 년 글이라 그런지 activeTheme이라는 key는 존재하지 않는다. DB scheme가 변경된 듯 하다. 하지만activeTheme이 아닌 유사한 이름인 active_theme 을 찾을 수 있다.

sqlite> SELECT * FROM settings where key = 'active_theme';
59929168a13f9a00014e67eb|active_theme|simply|theme|2017-08-15 06:15:04|1|2019-03-20 14:49:09|1

active_theme 키 값을 확인해 보니 문제가 되는 바로 그 simply임을 확인할 수 있다.

값 변경은 update 명령을 이용해서 변경할 수 있다. 역시 위 글 참조

sqlite> update settings set value='casper' where key = 'active_theme';
sqlite> SELECT * FROM settings where key = 'active_theme';
59929168a13f9a00014e67eb|active_theme|casper|theme|2017-08-15 06:15:04|1|2019-03-20 14:49:09|1

sqlite3 종료는 ctrl + d로.

이제 다시 pod의 상태를 확인해 보면 정상적으로 pod가 실행되고 있음을 확인할 수 있다.

$ kubectl get pods
NAME                        READY   STATUS    RESTARTS   AGE
my-ghost-795c6d674f-jb6t2   1/1     Running   22         60m
sctp-7c94d9b5c9-wsjnd       1/1     Running   2          28d

웹 브라우저로 URL 접속하니 정상적으로 동작한다. 문제 해결…