Upgrade to Ghost v4, but a lot of 503 error

I upgrade Ghost from v3.42.2 to v4.0.1. There is no error in the process. When the upgrade is finished, the website shows " We’ll be right back. We’re busy updating our site to give you the best experience, and will be back soon."

    OS: CentOS Linux, v7
    Node Version: v12.18.2
    Ghost Version: 4.0.1
    Ghost-CLI Version: 1.16.0
    Environment: production

I check the status by ghost ls, the status says running (production). I use ghost log to check the log:

[2021-03-16 14:13:37] WARN Ghost has shut down
[2021-03-16 14:13:37] WARN Your site is now offline
[2021-03-16 14:13:37] WARN Ghost was running for a few seconds
[2021-03-16 14:13:39] INFO Ghost is running in production...
[2021-03-16 14:13:39] INFO Your site is now available on https://halfrost.com/
[2021-03-16 14:13:39] INFO Ctrl+C to shut down
[2021-03-16 14:13:39] INFO Ghost server started in 0.722s
[2021-03-16 14:13:39] INFO Database is in a ready state.
[2021-03-16 14:13:39] INFO Ghost database ready in 1.077s
[2021-03-16 14:13:41] INFO Ghost booted in 3.41s
[2021-03-16 14:13:42] WARN Ghost is shutting down
[2021-03-16 14:13:42] WARN Ghost has shut down
[2021-03-16 14:13:42] WARN Your site is now offline
[2021-03-16 14:13:42] WARN Ghost was running for a few seconds
[2021-03-16 14:13:44] INFO Ghost is running in production...
[2021-03-16 14:13:44] INFO Your site is now available on https://halfrost.com/
[2021-03-16 14:13:44] INFO Ctrl+C to shut down
[2021-03-16 14:13:44] INFO Ghost server started in 0.73s
[2021-03-16 14:13:44] INFO Database is in a ready state.
[2021-03-16 14:13:44] INFO Ghost database ready in 1.093s

Ghost server restart over and over. ghost log -help see the detail:

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 13:32:18] ERROR "GET /rss/" 503 198ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 13:33:18] ERROR "GET /rss/" 503 252ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 13:38:08] ERROR "GET /rss" 503 193ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 13:39:35] ERROR "GET /how_to_use_runtime/" 503 223ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 13:46:08] ERROR "GET /dimensionality_reduction/" 503 189ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 13:46:47] ERROR "GET /https_tls1-2_handshake/" 503 205ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 13:47:25] ERROR "GET /" 503 189ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 13:51:32] ERROR "GET /rss/" 503 203ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 13:52:04] ERROR "GET /rss/" 503 198ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 13:57:06] ERROR "GET /rss/" 503 205ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 14:01:13] ERROR "GET /rss/" 503 192ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 14:01:39] ERROR "GET /rss/" 503 307ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 14:02:18] ERROR "GET /rss/" 503 201ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 14:02:35] ERROR "GET /" 503 202ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

Could you help me what next step I should do?

@halfrost would need a little bit more information to be able to help.

  1. Can you please provide the contents of your migrations table (SELECT * FROM migrations`).
  2. Can you do the following. Stop the site (ghost stop). Start the site (ghost start). And do not make any requests to the site! Have a look at the log output after the start and paste it here.

Thanks!

in migrations table:

+-----+------------------------------------------------------------------+---------+----------------+
| id  | name                                                             | version | currentVersion |
+-----+------------------------------------------------------------------+---------+----------------+
|   1 | 1-create-tables.js                                               | init    | 1.24           |
|   2 | 2-create-fixtures.js                                             | init    | 1.24           |
|   3 | 1-post-excerpt.js                                                | 1.3     | 1.24           |
|   4 | 1-codeinjection-post.js                                          | 1.4     | 1.24           |
|   5 | 1-og-twitter-post.js                                             | 1.5     | 1.24           |
|   6 | 1-add-backup-client.js                                           | 1.7     | 1.24           |
|   7 | 1-add-permissions-redirect.js                                    | 1.9     | 1.24           |
|   8 | 1-custom-template-post.js                                        | 1.13    | 1.24           |
|   9 | 2-theme-permissions.js                                           | 1.13    | 1.24           |
|  10 | 1-add-webhooks-table.js                                          | 1.18    | 1.24           |
|  11 | 1-webhook-permissions.js                                         | 1.19    | 1.24           |
|  12 | 1-remove-settings-keys.js                                        | 1.20    | 1.24           |
|  13 | 1-add-contributor-role.js                                        | 1.21    | 1.24           |
|  14 | 1-multiple-authors-DDL.js                                        | 1.22    | 1.24           |
|  15 | 1-multiple-authors-DML.js                                        | 1.22    | 1.24           |
|  16 | 1-update-koenig-beta-html.js                                     | 1.25    | 1.25           |
|  17 | 2-demo-post.js                                                   | 1.25    | 1.25           |
|  36 | 1-rename-amp-column.js                                           | 2.0     | 2.0            |
|  37 | 2-update-posts.js                                                | 2.0     | 2.0            |
|  38 | 3-remove-koenig-labs.js                                          | 2.0     | 2.0            |
|  39 | 4-permalink-setting.js                                           | 2.0     | 2.0            |
|  40 | 5-remove-demo-post.js                                            | 2.0     | 2.0            |
|  41 | 6-replace-fixture-posts.js                                       | 2.0     | 2.0            |
|  42 | 1-add-sessions-table.js                                          | 2.2     | 2.7            |
|  43 | 2-add-integrations-and-api-key-tables.js                         | 2.2     | 2.7            |
|  44 | 3-insert-admin-integration-role.js                               | 2.2     | 2.7            |
|  45 | 4-insert-integration-and-api-key-permissions.js                  | 2.2     | 2.7            |
|  46 | 5-add-mobiledoc-revisions-table.js                               | 2.2     | 2.7            |
|  47 | 1-add-webhook-columns.js                                         | 2.3     | 2.7            |
|  48 | 2-add-webhook-edit-permission.js                                 | 2.3     | 2.7            |
|  49 | 1-add-webhook-permission-roles.js                                | 2.6     | 2.7            |
|  50 | 1-add-members-table.js                                           | 2.8     | 2.13           |
|  51 | 1-remove-empty-strings.js                                        | 2.13    | 2.13           |
|  52 | 1-add-actions-table.js                                           | 2.14    | 2.14           |
|  53 | 2-add-actions-permissions.js                                     | 2.14    | 2.14           |
|  54 | 1-add-type-column-to-integrations.js                             | 2.15    | 2.20           |
|  55 | 2-insert-zapier-integration.js                                   | 2.15    | 2.20           |
|  56 | 1-add-members-perrmissions.js                                    | 2.16    | 2.20           |
|  57 | 1-normalize-settings.js                                          | 2.17    | 2.20           |
|  58 | 2-posts-add-canonical-url.js                                     | 2.17    | 2.20           |
|  59 | 1-restore-settings-from-backup.js                                | 2.18    | 2.20           |
|  60 | 1-update-editor-permissions.js                                   | 2.21    | 2.23           |
|  61 | 1-add-member-permissions-to-roles.js                             | 2.22    | 2.23           |
|  62 | 1-insert-ghost-db-backup-role.js                                 | 2.27    | 2.31           |
|  63 | 2-insert-db-backup-integration.js                                | 2.27    | 2.31           |
|  64 | 3-add-subdirectory-to-relative-canonical-urls.js                 | 2.27    | 2.31           |
|  65 | 1-add-db-backup-content-permission.js                            | 2.28    | 2.31           |
|  66 | 2-add-db-backup-content-permission-to-roles.js                   | 2.28    | 2.31           |
|  67 | 3-insert-ghost-scheduler-role.js                                 | 2.28    | 2.31           |
|  68 | 4-insert-scheduler-integration.js                                | 2.28    | 2.31           |
|  69 | 5-add-scheduler-permission-to-roles.js                           | 2.28    | 2.31           |
|  70 | 6-add-type-column.js                                             | 2.28    | 2.31           |
|  71 | 7-populate-type-column.js                                        | 2.28    | 2.31           |
|  72 | 8-remove-page-column.js                                          | 2.28    | 2.31           |
|  73 | 1-add-post-page-column.js                                        | 2.29    | 2.31           |
|  74 | 2-populate-post-page-column.js                                   | 2.29    | 2.31           |
|  75 | 3-remove-page-type-column.js                                     | 2.29    | 2.31           |
|  76 | 1-remove-name-and-password-from-members-table.js                 | 2.31    | 2.31           |
|  77 | 01-add-members-stripe-customers-table.js                         | 2.32    | 2.37           |
|  78 | 02-add-name-to-members-table.js                                  | 2.32    | 2.37           |
|  79 | 01-correct-members-stripe-customers-table.js                     | 2.33    | 2.37           |
|  80 | 01-add-stripe-customers-subscriptions-table.js                   | 2.34    | 2.37           |
|  81 | 02-add-email-to-members-stripe-customers-table.js                | 2.34    | 2.37           |
|  82 | 03-add-name-to-members-stripe-customers-table.js                 | 2.34    | 2.37           |
|  83 | 01-add-note-to-members-table.js                                  | 2.35    | 2.37           |
|  84 | 01-add-self-signup-and-from address-to-members-settings.js       | 2.37    | 2.37           |
|  85 | 01-remove-user-ghost-auth-columns.js                             | 3.0     | 3.3            |
|  86 | 02-drop-token-auth-tables.js                                     | 3.0     | 3.3            |
|  87 | 03-drop-client-auth-tables.js                                    | 3.0     | 3.3            |
|  88 | 04-add-posts-meta-table.js                                       | 3.0     | 3.3            |
|  89 | 05-populate-posts-meta-table.js                                  | 3.0     | 3.3            |
|  90 | 06-remove-posts-meta-columns.js                                  | 3.0     | 3.3            |
|  91 | 07-add-posts-type-column.js                                      | 3.0     | 3.3            |
|  92 | 08-populate-posts-type-column.js                                 | 3.0     | 3.3            |
|  93 | 09-remove-posts-page-column.js                                   | 3.0     | 3.3            |
|  94 | 10-remove-empty-strings.js                                       | 3.0     | 3.3            |
|  95 | 11-update-posts-html.js                                          | 3.0     | 3.3            |
|  96 | 12-populate-members-table-from-subscribers.js                    | 3.0     | 3.3            |
|  97 | 13-drop-subscribers-table.js                                     | 3.0     | 3.3            |
|  98 | 14-remove-subscribers-flag.js                                    | 3.0     | 3.3            |
|  99 | 01-add-send-email-when-published-to-posts.js                     | 3.1     | 3.3            |
| 100 | 02-add-email-subject-to-posts-meta.js                            | 3.1     | 3.3            |
| 101 | 03-add-email-preview-permissions.js                              | 3.1     | 3.3            |
| 102 | 04-add-subscribed-flag-to-members.js                             | 3.1     | 3.3            |
| 103 | 05-add-emails-table.js                                           | 3.1     | 3.3            |
| 104 | 06-add-email-permissions.js                                      | 3.1     | 3.3            |
| 105 | 07-add-uuid-field-to-members.js                                  | 3.1     | 3.3            |
| 106 | 08-add-uuid-values-to-members.js                                 | 3.1     | 3.3            |
| 107 | 09-add-further-email-permissions.js                              | 3.1     | 3.3            |
| 108 | 10-add-email-error-data-column.js                                | 3.1     | 3.3            |
| 109 | 01-add-cancel-at-period-end-to-subscriptions.js                  | 3.2     | 3.3            |
| 110 | 1-add-labels-table.js                                            | 3.6     | 3.9            |
| 111 | 2-add-members-labels-table.js                                    | 3.6     | 3.9            |
| 112 | 3-add-labels-permissions.js                                      | 3.6     | 3.9            |
| 113 | 01-fix-incorrect-member-labels-foreign-keys.js                   | 3.7     | 3.9            |
| 114 | 01-add-geolocation-to-members.js                                 | 3.8     | 3.9            |
| 115 | 01-add-member-sigin-url-permissions.js                           | 3.9     | 3.9            |
| 116 | 01-remove-broken-complimentary-plan-from-members-settings.js     | 3.11    | 3.12           |
| 117 | 01-add-identity-permission.js                                    | 3.12    | 3.12           |
| 118 | 02-remove-legacy-is-paid-flag-from-settings.js                   | 3.12    | 3.12           |
| 119 | 01-add-email-preview-permissions-to-roles.js                     | 3.18    | 3.25           |
| 120 | 02-add-members_stripe_connect-auth-permissions.js                | 3.18    | 3.25           |
| 121 | 01-update-member-from-email-address.js                           | 3.19    | 3.25           |
| 122 | 01-removed-legacy-values-from-settings-table.js                  | 3.22    | 3.25           |
| 123 | 02-settings-key-renames.js                                       | 3.22    | 3.25           |
| 124 | 03-add-group-and-flags-to-settings.js                            | 3.22    | 3.25           |
| 125 | 04-populate-settings-groups-and-flags.js                         | 3.22    | 3.25           |
| 126 | 05-migrate-members-subscription-settings.js                      | 3.22    | 3.25           |
| 127 | 06-migrate-stripe-connect-settings.js                            | 3.22    | 3.25           |
| 128 | 07-update-type-for-settings.js                                   | 3.22    | 3.25           |
| 129 | 01-migrate-bulk-email-settings.js                                | 3.23    | 3.25           |
| 130 | 02-remove-bulk-email-settings.js                                 | 3.23    | 3.25           |
| 131 | 03-update-portal-button-setting.js                               | 3.23    | 3.25           |
| 132 | 04-add-meta-columns-to-tags-table.js                             | 3.23    | 3.25           |
| 133 | 01-populate-group-for-new-portal-settings.js                     | 3.24    | 3.25           |
| 134 | 01-add-members-stripe-webhook-settings.js                        | 3.25    | 3.25           |
| 135 | 01-add-amp-gtag-id-setting.js                                    | 3.26    | 3.26           |
| 136 | 01-remove-duplicate-subscriptions.js                             | 3.29    | 3.30           |
| 137 | 02-remove-duplicate-customers.js                                 | 3.29    | 3.30           |
| 138 | 03-remove-orphaned-customers.js                                  | 3.29    | 3.30           |
| 139 | 04-remove-orphaned-subscriptions.js                              | 3.29    | 3.30           |
| 140 | 05-add-member-constraints.js                                     | 3.29    | 3.30           |
| 141 | 01-add-member-signin-url-permission-roles.js                     | 3.30    | 3.30           |
| 142 | 01-add-member-support-address-setting.js                         | 3.32    | 3.32           |
| 143 | 02-add-member-reply-address-setting.js                           | 3.32    | 3.32           |
| 144 | 03-add-routes-hash-setting.js                                    | 3.32    | 3.32           |
| 145 | 01-add-email-recipients-tables.js                                | 3.33    | 3.34           |
| 146 | 01-add-tokens-table.js                                           | 3.34    | 3.34           |
| 147 | 01-add-address-columns-to-emails-table.js                        | 3.35    | 3.40           |
| 148 | 01-add-snippets-table.js                                         | 3.36    | 3.40           |
| 149 | 02-add-snippets-permissions.js                                   | 3.36    | 3.40           |
| 150 | 01-update-portal-button-setting.js                               | 3.37    | 3.40           |
| 151 | 01-add-email-recipient-filter-column.js                          | 3.38    | 3.40           |
| 152 | 02-populate-email-recipient-filter-column.js                     | 3.38    | 3.40           |
| 153 | 03-add-recipient-filter-column.js                                | 3.38    | 3.40           |
| 154 | 04-populate-recipient-filter-column.js                           | 3.38    | 3.40           |
| 155 | 05-add-emails-track-opens-column.js                              | 3.38    | 3.40           |
| 156 | 06-add-newsletter-settings.js                                    | 3.38    | 3.40           |
| 157 | 07-migrate-newsletter-settings-from-config.js                    | 3.38    | 3.40           |
| 158 | 08-repopulate-send-email-when-published-down-migration.js        | 3.38    | 3.40           |
| 159 | 09-remove-send-email-when-published-column.js                    | 3.38    | 3.40           |
| 160 | 01-add-members-signup-redirect-settings.js                       | 3.39    | 3.40           |
| 161 | 02-add-user-id-to-api-keys-table.js                              | 3.39    | 3.40           |
| 162 | 03-add-email-track-opens-setting.js                              | 3.39    | 3.40           |
| 163 | 04-add-cancellation-reason-column.js                             | 3.39    | 3.40           |
| 164 | 05-remove-unused-columns-on-emails.js                            | 3.39    | 3.40           |
| 165 | 06-add-email-recipient-index.js                                  | 3.39    | 3.40           |
| 166 | 07-add-email-recipients-event-timestamps.js                      | 3.39    | 3.40           |
| 167 | 08-add-email-stats-columns.js                                    | 3.39    | 3.40           |
| 168 | 01-add-members-email-open-rate-column.js                         | 3.40    | 3.40           |
| 169 | 02-add members-email-aggregation-columns.js                      | 3.40    | 3.40           |
| 170 | 03-populate-members-email-counts.js                              | 3.40    | 3.40           |
| 171 | 01-add-firstpromoter-settings.js                                 | 3.41    | 3.41           |
| 172 | 01-update-mobiledoc.js                                           | 4.0     | 4.0            |
| 173 | 02-add-status-column-to-members.js                               | 4.0     | 4.0            |
| 174 | 03-populate-status-column-for-members.js                         | 4.0     | 4.0            |
| 175 | 04-drop-apps-related-tables.js                                   | 4.0     | 4.0            |
| 176 | 05-add-members-subscribe-events-table.js                         | 4.0     | 4.0            |
| 177 | 06-populate-members-subscribe-events-table.js                    | 4.0     | 4.0            |
| 178 | 07-alter-unique-constraint-for-posts-slug.js                     | 4.0     | 4.0            |
| 179 | 08-add-members-login-events-table.js                             | 4.0     | 4.0            |
| 180 | 09-add-members-email-change-events-table.js                      | 4.0     | 4.0            |
| 181 | 10-add-members-status-events-table.js                            | 4.0     | 4.0            |
| 182 | 11-add-members-paid-subscription-events-table.js                 | 4.0     | 4.0            |
| 183 | 12-delete-apps-related-settings-keys.js                          | 4.0     | 4.0            |
| 184 | 13-add-members-payment-events-table.js                           | 4.0     | 4.0            |
| 185 | 14-remove-orphaned-stripe-records.js                             | 4.0     | 4.0            |
| 186 | 15-add-frontmatter-column-to-meta.js                             | 4.0     | 4.0            |
| 187 | 16-refactor-slack-setting.js                                     | 4.0     | 4.0            |
| 188 | 17-populate-members-status-events-table.js                       | 4.0     | 4.0            |
| 189 | 18-transform-urls-absolute-to-transform-ready.js                 | 4.0     | 4.0            |
| 190 | 19-remove-labs-members-setting.js                                | 4.0     | 4.0            |
| 191 | 20-refactor-unsplash-setting.js                                  | 4.0     | 4.0            |
| 192 | 21-sanitize-email-batches-provider-id.js                         | 4.0     | 4.0            |
| 193 | 22-solve-orphaned-webhooks.js                                    | 4.0     | 4.0            |
| 194 | 23-regenerate-posts-html.js                                      | 4.0     | 4.0            |
| 195 | 24-add-missing-email-permissions.js                              | 4.0     | 4.0            |
| 196 | 25-populate-members-paid-subscription-events-table.js            | 4.0     | 4.0            |
| 197 | 26-add-cascade-on-delete.js                                      | 4.0     | 4.0            |
| 198 | 27-add-primary-key-brute-migrations-lock.js                      | 4.0     | 4.0            |
| 199 | 28-add-webhook-intergrations-foreign-key.js                      | 4.0     | 4.0            |
| 200 | 29-fix-foreign-key-for-members-stripe-customers-subscriptions.js | 4.0     | 4.0            |
| 201 | 30-set-default-accent-color.js                                   | 4.0     | 4.0            |
+-----+------------------------------------------------------------------+---------+----------------+

launch up raw log:

{"name":"Log","hostname":"uuufg","pid":23223,"level":50,"req":{"meta":{"requestId":"ee5967eb-5700-4efb-a7d1-aac2f01055a4","userId":null},"url":"/rss/","method":"GET","originalUrl":"/rss/","params":{},"headers":{"x-real-ip":"187.71.89.188","host":"halfrost.com","x-forwarded-for":"187.71.89.188","x-forwarded-proto":"https","connection":"close","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6; +feeder.co) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36","accept":"application/xml,text/html,application/xhtml+xml;q=0.9,*/*;q=0.8","accept-charset":"utf-8;q=0.7,*;q=0.3","cookie":"**REDACTED**"},"query":{}},"res":{"_headers":{"x-powered-by":"Express","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0","content-type":"text/html; charset=utf-8","content-length":"216897","etag":"W/\"34f41-QyCJUBJ7iuQ2y++fGJbgz67Zso0\"","vary":"Accept-Encoding"},"statusCode":503,"responseTime":"207ms"},"err":{"id":"9ac39960-8639-11eb-9c40-070149a5e22a","domain":"https://halfrost.com","code":null,"name":"MaintenanceError","statusCode":503,"level":"normal","message":"Site is starting up, please wait a moment then retry.","stack":"MaintenanceError: Site is starting up, please wait a moment then retry.\n    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)\n    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)\n    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)\n    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)\n    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7\n    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)\n    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)\n    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)\n    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)\n    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)\n    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7\n    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)\n    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)\n    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)\n    at SendStream.emit (events.js:210:5)\n    at SendStream.EventEmitter.emit (domain.js:475:20)"},"msg":"Site is starting up, please wait a moment then retry.","time":"2021-03-16T09:25:53.472Z","v":0}

ghost cli log -help show this:

[2021-03-16 17:25:53] ERROR "GET /rss/" 503 207ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 17:27:26] ERROR "GET /rss/" 503 211ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)

[2021-03-16 17:27:48] ERROR "GET /rss/" 503 204ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/4.0.1/node_modules/@tryghost/errors/node_modules/ghost-ignition/lib/errors/index.js:162:23)
    at maintenance (/var/www/ghost/versions/4.0.1/core/server/web/shared/middlewares/maintenance.js:14:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at servePublicFileMiddleware (/var/www/ghost/versions/4.0.1/core/server/web/site/middleware/serve-public-file.js:75:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/4.0.1/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/var/www/ghost/versions/4.0.1/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:210:5)
    at SendStream.EventEmitter.emit (domain.js:475:20)
1 Like

Hm. this still doesn’t clear up the situation. The migrations look fine. The 503 error visible in the logs is more of a “symptom” than the cause of the problem. Lets switch up the dial a little higher.

Can you change the log level for you instance from “info” to “debug” (logging docs here). And start the instance with ghost run have as little external influence as possible (e.g. process manager). Please post the logs after the star here. Thanks!

Just to be clear, Ghost intentionally returns 503s whilst it is booting up and has always done so. 503 is the correct code for “try again soon”.

Is it possible you have some sort of healthcheck that is misunderstanding the 503 and restarting the service? E.g. in systemd?

I meet some puzzle problem:

[myghostuser ghost]$ ls -la /root/.nvm/versions/node/v12.18.2/bin/node
-rwxrwxrwx 1 myghostuser myghostuser 48634352 6月  30 2020 /root/.nvm/versions/node/v12.18.2/bin/node
[myghostuser ghost]$ ghost run -D
The `ghost run` command is used by the configured Ghost process manager and for debugging. If you're not running this to debug something, you should run `ghost start` instead.
+ sudo node current/index.js
sudo: unable to execute /root/.nvm/versions/node/v12.18.2/bin/node: Permission denied

I make /bin/node rwx authority, but log still says permission denied.

I did not configure special systemd, it’s default setting by Ghost:

[Unit]
Description=Ghost systemd service for blog: halfrost-com
Documentation=https://docs.ghost.org

[Service]
Type=simple
WorkingDirectory=/var/www/ghost
User=993
Environment="NODE_ENV=production"
ExecStart=/usr/local/bin/node /usr/local/bin/ghost run
Restart=always

[Install]
WantedBy=multi-user.target

Hi all,

I have a similar issue, my ghost stays in We’ll be right back mode and the ghost log command shows a similar behaviour.

Edit: if I run the ghost run command, I am able to access the backend and frontend.

Have you see some error in the log when you run the ghost run command?

Hey,

I just tried, and no errors on my side while running with ghost run.

Thanks, let’s wait for official solution.

I’m also getting 503. Upgrading to v 4.0.1 went smoothly (after first updating to the latest v 3). The site worked fine until I stopped the site and then tried GHOST START…

WHEN I TRIED GHOST START…

Debug Information:
    OS: CloudLinux, v7.9
    Node Version: v12.16.1
    Ghost Version: 4.0.1
    Ghost-CLI Version: 1.16.2
    Environment: development
    Command: 'ghost start STUDIO --no-setup-linux-user'
Message: Ghost process exited with code: 0
Stack: Error: Ghost process exited with code: 0
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/ghost-cli/lib/utils/local-process.js:68:24)
    at ChildProcess.emit (events.js:311:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

THEN I ALSO TRIED GHOST RUN…

[microchic@node1234 ~]$ cd STUDIO
[microchic@node1234 STUDIO]$ ghost run
The `ghost run` command is used by the configured Ghost process manager and for debugging. If you're not running this to debug something, you should run `ghost start` instead.
(node:422805) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'error' of undefined
    at bootGhost (/home/microchic/STUDIO/versions/4.0.1/core/boot.js:304:17)
    at Object.<anonymous> (/home/microchic/STUDIO/versions/4.0.1/ghost.js:19:27)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/home/microchic/STUDIO/versions/4.0.1/index.js:1:1)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
(node:422805) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:422805) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[microchic@node1234 STUDIO]$

BUT NOW STILL…

Seems I’m not the only one with this problem, and I can see there’s several threads reporting this issue:

Please let me know if it’s best I started a new thread, or contributed here, which I’ll do for now.

I self-host and upgraded using ghost update from version 3.42.2 to 4.0.1. I switched to the Caspar theme before doing so as a result of the warning I saw on attempting to upgrade. Other useful versions:

  • Node: v14.16.0 (also tried with v12.16.2)
  • Npm: 7.6.3
  • OS: Debian 9.13
  • MySQL: Ver 15.1 Distrib 10.2.30-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

I don’t believe the issue relates to the versions above because running ghost run allows the blog to start correctly (that’s the state I’ve left it in for now). At the moment I’m completely stumped and don’t know what to try next. ghost log tells me:

[2021-03-17 08:07:24] INFO Ghost is running in production...
[2021-03-17 08:07:24] INFO Your site is now available on https://blog.jonsdocs.org.uk/
[2021-03-17 08:07:24] INFO Ctrl+C to shut down
[2021-03-17 08:07:24] INFO Ghost server started in 0.833s
[2021-03-17 08:07:25] INFO Database is in a ready state.
[2021-03-17 08:07:25] INFO Ghost database ready in 1.264s
[2021-03-17 08:07:27] INFO Ghost booted in 3.536s
[2021-03-17 08:07:28] WARN Ghost is shutting down
[2021-03-17 08:07:28] WARN Ghost has shut down
[2021-03-17 08:07:28] WARN Your site is now offline
[2021-03-17 08:07:28] WARN Ghost was running for a few seconds

ghost ls advises that the blog is running, on the correct port as confirmed against my Nginx config.

An excerpt from my migrations table shows:

+-----+------------------------------------------------------------------+---------+----------------+
| id  | name                                                             | version | currentVersion |
+-----+------------------------------------------------------------------+---------+----------------+
| 153 | 01-add-firstpromoter-settings.js                                 | 3.41    | 3.41           |
| 154 | 01-update-mobiledoc.js                                           | 4.0     | 4.0            |
| 155 | 02-add-status-column-to-members.js                               | 4.0     | 4.0            |
| 156 | 03-populate-status-column-for-members.js                         | 4.0     | 4.0            |
| 157 | 04-drop-apps-related-tables.js                                   | 4.0     | 4.0            |
| 158 | 05-add-members-subscribe-events-table.js                         | 4.0     | 4.0            |
| 159 | 06-populate-members-subscribe-events-table.js                    | 4.0     | 4.0            |
| 160 | 07-alter-unique-constraint-for-posts-slug.js                     | 4.0     | 4.0            |
| 161 | 08-add-members-login-events-table.js                             | 4.0     | 4.0            |
| 162 | 09-add-members-email-change-events-table.js                      | 4.0     | 4.0            |
| 163 | 10-add-members-status-events-table.js                            | 4.0     | 4.0            |
| 164 | 11-add-members-paid-subscription-events-table.js                 | 4.0     | 4.0            |
| 165 | 12-delete-apps-related-settings-keys.js                          | 4.0     | 4.0            |
| 166 | 13-add-members-payment-events-table.js                           | 4.0     | 4.0            |
| 167 | 14-remove-orphaned-stripe-records.js                             | 4.0     | 4.0            |
| 168 | 15-add-frontmatter-column-to-meta.js                             | 4.0     | 4.0            |
| 169 | 16-refactor-slack-setting.js                                     | 4.0     | 4.0            |
| 170 | 17-populate-members-status-events-table.js                       | 4.0     | 4.0            |
| 171 | 18-transform-urls-absolute-to-transform-ready.js                 | 4.0     | 4.0            |
| 172 | 19-remove-labs-members-setting.js                                | 4.0     | 4.0            |
| 173 | 20-refactor-unsplash-setting.js                                  | 4.0     | 4.0            |
| 174 | 21-sanitize-email-batches-provider-id.js                         | 4.0     | 4.0            |
| 175 | 22-solve-orphaned-webhooks.js                                    | 4.0     | 4.0            |
| 176 | 23-regenerate-posts-html.js                                      | 4.0     | 4.0            |
| 177 | 24-add-missing-email-permissions.js                              | 4.0     | 4.0            |
| 178 | 25-populate-members-paid-subscription-events-table.js            | 4.0     | 4.0            |
| 179 | 26-add-cascade-on-delete.js                                      | 4.0     | 4.0            |
| 180 | 27-add-primary-key-brute-migrations-lock.js                      | 4.0     | 4.0            |
| 181 | 28-add-webhook-intergrations-foreign-key.js                      | 4.0     | 4.0            |
| 182 | 29-fix-foreign-key-for-members-stripe-customers-subscriptions.js | 4.0     | 4.0            |
| 183 | 30-set-default-accent-color.js                                   | 4.0     | 4.0            |
+-----+------------------------------------------------------------------+---------+----------------+

Which at a quick glance appears consistent with the one pasted earlier.

Any advice would be greatly appreciated.

1 Like

I am getting the exact same behaviour.

I am running on a Digital Ocean droplet, Ubuntu 18.04. I’ve tried upgrading to the latest node.js version, hasn’t made any difference.

Running ghost run instead of ghost start works, implying the problem might be around permissions when running through the systemd service. I will happily help with debugging more.

I am experiencing the same problem. Ghost Run works, but ghost start doesn’t work…

I started other mentioned topic Ghost won't start after upgrading to v4.0.1 and I just resolved my issue!
If it helps anyone, I resolved my issue by completely uninstalling my failed installation and installing a fresh version 4.0.1 Fresh install failed to run automatically, but after manually running sudo systemctl start ghost_your-blog-com everything started up just fine.

If I had another chance, I’d try to just execute above command before uninstalling.

Hey,

I just tried your command, and it did not help :confused:

@cronco

I use ghost run, but system tells me Permission denied:

[myghostuser ghost]$ ls -la /root/.nvm/versions/node/v12.18.2/bin/node
-rwxrwxrwx 1 myghostuser myghostuser 48634352 6月  30 2020 /root/.nvm/versions/node/v12.18.2/bin/node
[myghostuser ghost]$ ghost run -D
The `ghost run` command is used by the configured Ghost process manager and for debugging. If you're not running this to debug something, you should run `ghost start` instead.
+ sudo node current/index.js
sudo: unable to execute /root/.nvm/versions/node/v12.18.2/bin/node: Permission denied

I install nvm to manage my node version in root user. Should I reinstall node in this user group?

@mitkomitrovski I use ghost run , but system tells me Permission denied:

[myghostuser ghost]$ ls -la /root/.nvm/versions/node/v12.18.2/bin/node
-rwxrwxrwx 1 myghostuser myghostuser 48634352 6月  30 2020 /root/.nvm/versions/node/v12.18.2/bin/node
[myghostuser ghost]$ ghost run -D
The `ghost run` command is used by the configured Ghost process manager and for debugging. If you're not running this to debug something, you should run `ghost start` instead.
+ sudo node current/index.js
sudo: unable to execute /root/.nvm/versions/node/v12.18.2/bin/node: Permission denied

I install nvm to manage my node version in root user. Should I reinstall node in this user group?

@halfrost can you confirm ghost start works for you? In case it does, it would clearly point to a problem with permissions in systemd.