Service Unavailable Error

Keywords: Ghost - Virtual Machines - Technical issue - Services (Apache, MariaDB, MySQL…)

bndiagnostic ID: 7bded821-22b9-8aea-acd8-842a57667d6d

bndiagnostic output:

? Connectivity: Found possible issues
? Mariadb: Found possible issues
? Apache: Found possible issues

bndiagnostic failure reason: The suggested guides are not related with my issue

When trying to load the bitnami page I get a “Service Unavailable” error in my browser. With the following message:

“The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.”

I don’t know what is causing it. Restoring the VM to an earlier version fixes the issue, but after a few days it is back, and IDK what to do about it. I don’t even know what is the actual issue that prevent the loading of the page.

Hi @mumia,

From the Ghost’s log files (/opt/bitnami/ghost/content/logs), I can see it can’t connect to the database

{"name":"Log","hostname":"debian","pid":1540,"level":50,"err":{"id":500,"domain":"","code":"ECONNREFUSED","name":"InternalServerError","statusCode":500,"level":"normal","message":"connect         ECONNREFUSED","help":"\"Unknown database error\"","stack":"InternalServerError: connect ECONNREFUSED\n    at DatabaseStateManager.getState (/opt/bitnami/ghost/versions/4.22.1/core/server/data/db/state-manager.js:63:32)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)\n    at async DatabaseStateManager.makeReady (/opt/bitnami/ghost/versions/4.22.1/core/server/data/db/state-manager.js:72: 25)\n    at async initDatabase (/opt/bitnami/ghost/versions/4.22.1/core/boot.js:62:5)\n    at async bootGhost (/opt/bitnami/ghost/versions/4.22.1/core/boot.js:349:9)\n\nDatabaseError: connect ECONNREFUSED       3306\n    at DatabaseError.KnexMigrateError (/opt/bitnami/ghost/versions/4.22.1/node_modules/knex-migrator/lib/errors.js:7:26)\n    at new DatabaseError (/opt/bitnami/ghost/versions/4.22.1/node_modules/knex-migrator/lib/  errors.js:55:26)\n    at /opt/bitnami/ghost/versions/4.22.1/node_modules/knex-migrator/lib/database.js:48:19\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)\n    at async DatabaseStateManager.     getState (/opt/bitnami/ghost/versions/4.22.1/core/server/data/db/state-manager.js:39:13)\n    at async DatabaseStateManager.makeReady (/opt/bitnami/ghost/versions/4.22.1/core/server/data/db/state-manager.js:72:25)\n    at async initDatabase (/opt/bitnami/ghost/versions/4.22.1/core/boot.js:62:5)\n    at async bootGhost (/opt/bitnami/ghost/versions/4.22.1/core/boot.js:349:9)\n\nError: connect ECONNREFUSED\n    at               TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)\n    --------------------\n    at Protocol._enqueue (/opt/bitnami/ghost/versions/4.22.1/node_modules/mysql/lib/protocol/Protocol.js:144:48)\n    at Protocol.    handshake (/opt/bitnami/ghost/versions/4.22.1/node_modules/mysql/lib/protocol/Protocol.js:51:23)\n    at Connection.connect (/opt/bitnami/ghost/versions/4.22.1/node_modules/mysql/lib/Connection.js:116:18)\n    at /opt/    bitnami/ghost/versions/4.22.1/node_modules/knex-migrator/node_modules/knex/lib/dialects/mysql/index.js:68:18\n    at new Promise (<anonymous>)\n    at Client_MySQL.acquireRawConnection (/opt/bitnami/ghost/versions/4.22.1/ node_modules/knex-migrator/node_modules/knex/lib/dialects/mysql/index.js:63:12)\n    at create (/opt/bitnami/ghost/versions/4.22.1/node_modules/knex-migrator/node_modules/knex/lib/client.js:290:39)"},"msg":"connect        ECONNREFUSED","time":"2022-01-19T16:55:35.369Z","v":0}

Can you try to start the database?

sudo gonit
sleep 10
sudo gonit status
sudo /opt/bitnami/ start
for file in `find /opt/bitnami/scripts/ -name`; do sudo $file; done

I get an error trying to start the service

Here is the status output:

What about this command? You didn’t run it

I did not run it, because as you see the previous command failed. I had thought it was dependent on successfully running the previous command.

I ran it but it completed instantaneously I don’t think it actually did anything. The status is unchanged.

That’s weird @mumia,

Could you please take a look at the Apache’s script and run the start command manually? The command should be this one

sudo /opt/bitnami/apache2/bin/httpd -f /opt/bitnami/apache2/conf/httpd.conf

Apart from that, could you please check the Gonit’s config files?

sudo ls -la /etc/monit/conf.d/
sudo cat /etc/monit/conf.d/*

Weird indeed.

So is there no log file somewhere that can tell why is it not starting?

Sorry @mumia,

It seems Apache was started, what about MariaDB?

sudo /opt/bitnami/scripts/mariadb/

If MariaDB is failing, you should check its log file inside the /opt/bitnami/mariadb folder

It says mariadb is already running.But ghost refuses to start.Capture3

Ok @mumia,

Both services are now running. What about Ghost? Can you check if there is any new error in the log files inside the /opt/bitnami/ghost/content/logs folder. I suggest you ask in the official forums of the application to get more information about those errors because it seems the database and the webserver are now up and running.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.