Hi,
I am attempting to install ghost, but it keeps failing because nginx can not be restarted, due to an error (with the letsencrypt certs I think).
How can I get this working?
System Information:
OS: Ubuntu, v22.04.2 LTS
Node Version: v16.19.1
Ghost Version: 5.38.0
Ghost-CLI Version: 1.24.0
Debug Information:
Environment: production
Command: 'ghost install'
Message: Failed to restart Nginx.
Stack: Error: Failed to restart Nginx.
at NginxExtension.restartNginx (/usr/lib/node_modules/ghost-cli/extensions/nginx/index.js:262:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Original Error Message:
Message: Command failed: /bin/sh -c sudo -S -p '#node-sudo-passwd#' nginx -s reload
nginx: [emerg] cannot load certificate "/etc/letsencrypt/jaytelford.me/fullchain.cer": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/e
tc/letsencrypt/jaytelford.me/fullchain.cer, r) error:10000080:BIO routines::no such file)
Stack: Error: Command failed: /bin/sh -c sudo -S -p '#node-sudo-passwd#' nginx -s reload
nginx: [emerg] cannot load certificate "/etc/letsencrypt/jaytelford.me/fullchain.cer": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/e
tc/letsencrypt/jaytelford.me/fullchain.cer, r) error:10000080:BIO routines::no such file)
at makeError (/usr/lib/node_modules/ghost-cli/node_modules/execa/index.js:174:9)
at /usr/lib/node_modules/ghost-cli/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async NginxExtension.restartNginx (/usr/lib/node_modules/ghost-cli/extensions/nginx/index.js:260:13)
...
The journal for nginx says this:
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStartPre= process belonging to unit nginx.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Mar 11 14:38:57 zod.jaytelford.me systemd[1]: nginx.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
I attempted to uninstall ghost, but that command would not work either - so I manually trashed the directory, deleted all the letsencrypt certificates manually, removed the server configurations from nginx manually, and started nginx.
I then went through the installation process again, which failed with the same errors.
How can I fix this and get it to work?
Thanks
Jay