$ ghost upgrade - An error occurred.Message: 'Invalid Version: null'
When you check the instance with Ghost doctor, the output seems fine:
✔ Checking system Node.js version - found v16.15.1
✔ Checking logged in user
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking system compatibility
✔ Checking for a MySQL installation
Instance is currently running
ℹ Validating config [skipped]
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
✔ Checking systemd unit file
✔ Checking systemd node version - found v16.15.1
Other weird things worth noting is that when I run ghost ls it tells me No installed ghost instances found which is so bizarre. The site is running. Ghost doctor literally says Instance is currently running
I have tried all sorts of things including running ghost setup, installing latest ghost-cli.
$ ghost start
Ghost is already running! For more information, run: ghost ls
$ ghost ls
No installed ghost instances found
This messy error is from ghost log
AME: InternalServerError
CODE: ERR_TLS_CERT_ALTNAME_INVALID
MESSAGE: The server has encountered an error.
level: critical
RequestError: Hostname/IP does not match certificate's altnames: IP: 198.199.71.117 is not in the cert's list:
at /var/www/ghost/versions/5.2.3/core/server/adapters/scheduling/SchedulingDefault.js:319:23
at ClientRequest.<anonymous> (/var/www/ghost/versions/5.2.3/node_modules/got/source/request-as-event-emitter.js:178:14)
at Object.onceWrapper (node:events:642:26)
at ClientRequest.emit (node:events:539:35)
at ClientRequest.origin.emit (/var/www/ghost/versions/5.2.3/node_modules/@szmarczak/http-timer/source/index.js:37:11)
at TLSSocket.socketErrorListener (node:_http_client:454:9)
at TLSSocket.emit (node:events:527:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)