Cannot upgrade Ghost on AWS after base install

Keywords: Ghost - AWS - Technical issue - Upgrade

bnsupport ID: eec2b540-5d04-2096-72ed-f6dd977e064a

bndiagnostic output:

? Mariadb: Found possible issues
https://docs.bitnami.com/aws/apps/wordpress/troubleshooting/debug-errors-mariadb/

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

Description:
I’m attempting to run “ghost upgrade” on AWS to upgrade ghost to the latest version. When I run this command using the username bitnami (which by the way was very hard to find / figure out on initial setup, because it’s not mentioned in the initial configuration steps for running Bitnami Ghost), the error is returned as follows:

One or more errors occurred.

  1. Checking current folder permissions

Message: The directory /opt/bitnami/ghost is not writable by your user. You must grant write access and try again.
Help: https://ghost.org/docs/install/ubuntu/#create-a-directory

Debug Information:
OS: Debian GNU/Linux, v10
Node Version: v14.18.2
Ghost Version: 4.24.0
Ghost-CLI Version: 1.18.1
Environment: production
Command: ‘ghost update’

Try running ghost doctor to check your system for known issues.

How do I modify the folder permissions so that the update tool can run?

If I try to run the command “sudo su ghost update” it also returns the following error:

bitnami@ip-10-0-1-202:/opt/bitnami/ghost$ sudo su ghost update
sh: 0: Can’t open update

Here’s what happens when I run code:
Preformatted textbitnami@ip-10-0-1-202:/opt/bitnami/ghost$ sudo stat /opt/bitnami/ghost
File: /opt/bitnami/ghost
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 10301h/66305d Inode: 526755 Links: 5
Access: (0755/drwxr-xr-x) Uid: ( 998/ ghost) Gid: ( 1000/ bitnami)
Access: 2021-12-15 16:14:14.109818340 +0000
Modify: 2021-12-15 16:05:58.698927228 +0000
Change: 2021-12-15 16:11:05.954795012 +0000
Birth: -

I just did the chown modification to attempt to fix this but I’m still running into issues… here’s the rest of what the terminal is saying now:

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost**$ sudo chown bitnami /opt/bitnami/ghost

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost**$ ghost update

✔ Checking system Node.js version - found v14.18.2

ℹ Ensuring user is not logged in as ghost user [skipped]

ℹ Checking if logged in user is directory owner [skipped]

✔ Checking current folder permissions

✔ Checking content folder ownership

✔ Checking memory availability

✔ Checking free space

✔ Checking for available migrations

An error occurred.

Message: 'EACCES: permission denied, open '/opt/bitnami/ghost/.ghost-cli''

Debug Information:

OS: Debian GNU/Linux, v10

Node Version: v14.18.2

Ghost Version: 4.24.0

Ghost-CLI Version: 1.18.1

Environment: production

Command: 'ghost update'

Additional log info available in: /home/bitnami/.ghost/logs/ghost-cli-debug-2021-12-15T16_42_29_692Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost**$ sudo chown bitnami /opt/bitnami/ghost/.ghost-cli

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost**$ ghost update

✔ Checking system Node.js version - found v14.18.2

ℹ Ensuring user is not logged in as ghost user [skipped]

ℹ Checking if logged in user is directory owner [skipped]

✔ Checking current folder permissions

✔ Checking content folder ownership

✔ Checking memory availability

✔ Checking free space

✔ Checking for available migrations

✔ Checking for latest Ghost version

# 4.30.1

* 🎨 Updated Casper to v4.6.0 - Sam Lord

---

View the changelogs for full details:

* Ghost - https://github.com/tryghost/ghost/compare/v4.30.0...v4.30.1

* Admin - https://github.com/tryghost/admin/compare/v4.30.0...v4.30.1

✔ Fetched release notes

✖ Downloading and updating Ghost to v4.30.1

An error occurred.

Message: 'EACCES: permission denied, mkdir '/opt/bitnami/ghost/versions/4.30.1''

Debug Information:

OS: Debian GNU/Linux, v10

Node Version: v14.18.2

Ghost Version: 4.24.0

Ghost-CLI Version: 1.18.1

Environment: production

Command: 'ghost update'

Additional log info available in: /home/bitnami/.ghost/logs/ghost-cli-debug-2021-12-15T16_43_06_678Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost**$ sudo su ghost update

sh: 0: Can't open update

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost**$ cd versions

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost/versions**$ ls

**4.24.0**

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost/versions**$ sudo su mkdir 4.30.1

su: user mkdir does not exist

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost/versions**$ mkdir 4.30.1

mkdir: cannot create directory ‘4.30.1’: Permission denied

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost/versions**$ sudo mkdir 4.30.1

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost/versions**$ ls

**4.24.0** **4.30.1**

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost/versions**$ ghost update

✔ Checking system Node.js version - found v14.18.2

ℹ Ensuring user is not logged in as ghost user [skipped]

ℹ Checking if logged in user is directory owner [skipped]

✔ Checking current folder permissions

✔ Checking content folder ownership

✔ Checking memory availability

✔ Checking free space

✔ Checking for available migrations

✔ Checking for latest Ghost version

# 4.30.1

* 🎨 Updated Casper to v4.6.0 - Sam Lord

---

View the changelogs for full details:

* Ghost - https://github.com/tryghost/ghost/compare/v4.30.0...v4.30.1

* Admin - https://github.com/tryghost/admin/compare/v4.30.0...v4.30.1

✔ Fetched release notes

Version already installed.

ℹ Downloading and updating Ghost [skipped]

✖ Stopping Ghost

A CliError occurred.

Message: An unexpected error occurred while stopping Ghost.

Debug Information:

OS: Debian GNU/Linux, v10

Node Version: v14.18.2

Ghost Version: 4.24.0

Ghost-CLI Version: 1.18.1

Environment: production

Command: 'ghost update'

Additional log info available in: /home/bitnami/.ghost/logs/ghost-cli-debug-2021-12-15T16_44_17_407Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost/versions**$

so basically I chown (changed owner) of both /opt/bitnami/ghost/ and /opt/bitnami/ghost/.ghost-cli in order to push for an upgrade, but now it’s saying that the “Version is already installed.” which doesn’t make sense because it’s just downloaded the latest update package to a new folder that I helped to create, and then there is an error stopping ghost.

sudo chown bitnami /opt/bitnami/ghost/
sudo chown bitnami /opt/bitnami/ghost/.ghost-cli

Then I stopped the instance on AWS and restarted it, but that didn’t fix it either.

So what do I need to do in order for this update to go through?
And then I assume I need to change ownership back to user ‘ghost’ instead of ‘bitnami’ after I’m done updating to reinforce the security measures already in place, correct?

Furthermore, if I attempt to upgrade ghost using the measures outlined on the following website,
https://docs.bitnami.com/general/apps/ghost/administration/upgrade/

I receive the following errors:

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost**$ sudo su ghost ghost update

sh: 0: Can't open ghost

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost**$ sudo su bitnami ghost update

/opt/bitnami/ghost/bin/ghost: line 2: use strict: command not found

/opt/bitnami/ghost/bin/ghost: line 4: //: Is a directory

/opt/bitnami/ghost/bin/ghost: line 5: process.title: command not found

/opt/bitnami/ghost/bin/ghost: ghost: line 7: syntax error near unexpected token `('

/opt/bitnami/ghost/bin/ghost: ghost: line 7: `const argv = process.argv.slice(2);'

Someone recommended updating the ghost URL in the config file via this Ghost support thread https://forum.ghost.org/t/site-design-option-wont-show-up-as-preview/27250/4, so I just used the command:
sudo ghost config url https://{[mydomain.com](http://mydomain.com/)}

Now I have an even bigger problem… Ghost wouldn’t restart, so I stopped the AWS instance and restarted it. It now shows in SSH that HTTPS is enabled for my domain but it’s now redirecting to https://127.0.0.1:2368/ when I visit my root HTTPS URL, so it’s some sort of weird redirect going on. How do I fix this? It’s still using Bitnami via AWS for the Ghost install. Now I can’t publicly access Ghost through my web browser to check and see if the preview error I had before in the admin backend is fixed because my whole website is now down.

Hi @PrescottPaulin,

The “ghost” user is the owner of the Ghost’s files by default, for example the .ghost-cli file and ghost folder are owned by that user

bitnami@bitnami-ghost-34bf:/opt/bitnami/ghost$ ls -la
total 24
drwxr-xr-x  4 ghost bitnami 4096 Dec 16 10:13 .
drwxr-xr-x 16 root  root    4096 Dec 16 10:13 ..
lrwxrwxrwx  1 root  root      52 Nov 29 11:53 bin -> /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin
lrwxrwxrwx  1 root  root      37 Dec 16 10:13 config.production.json -> /bitnami/ghost/config.production.json
lrwxrwxrwx  1 root  root      22 Dec 16 10:13 content -> /bitnami/ghost/content
lrwxrwxrwx  1 root  root      34 Nov 29 11:53 current -> /opt/bitnami/ghost/versions/4.24.0
-rw-r--r--  1 ghost bitnami  106 Dec 16 10:13 .ghost-cli
-rw-r--r--  1 root  root       5 Dec 16 10:13 .ghostpid
drwxr-xr-x  2 ghost bitnami 4096 Nov 29 12:15 licenses
drwxr-xr-x  3 ghost bitnami 4096 Nov 29 12:15 versions

However, I could reproduce the issues when running the ghost binary

bitnami@bitnami-ghost-34bf:/opt/bitnami/ghost$ sudo su ghost bin/ghost update
bin/ghost: 2: bin/ghost: use strict: not found
bin/ghost: 4: bin/ghost: //: Permission denied
bin/ghost: 5: bin/ghost: process.title: not found
bin/ghost: 7: bin/ghost: Syntax error: "(" unexpected

https://docs.bitnami.com/aws/apps/ghost/administration/upgrade/

The team is going to investigate this and will update this thread as soon as we have more information.

Please ensure the configuration file has the correct domain

https://docs.bitnami.com/aws/apps/ghost/administration/configure-domain/

1 Like

Hi @PrescottPaulin,

Can you try to updated Ghost with the following commands:

cd /opt/bitnami/ghost
sudo su ghost -c 'bin/ghost update'

Best regards,
Michiel

@michiel, Merry Christmas and thanks for the help!

Here’s what I received when I ran the update command:

bitnami@ip-10-0-1-202:~$ cd /opt/bitnami/ghost
bitnami@ip-10-0-1-202:/opt/bitnami/ghost$ sudo su ghost -c 'bin/ghost update'
An error occurred.
Message: 'EACCES: permission denied, unlink '/opt/bitnami/ghost/.ghostpid''


Debug Information:
    OS: Debian GNU/Linux, v10
    Node Version: v14.18.2
    Ghost Version: 4.24.0
    Ghost-CLI Version: 1.18.1
    Environment: production
    Command: 'ghost update'

Additional log info available in: /home/ghost/.ghost/logs/ghost-cli-debug-2021-12-26T00_57_49_389Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.

@jbaczuk @jorgemarin any ideas? I noticed you had some sort of similar issue in another thread a few years back.

Hi @PrescottPaulin,

Can you check the permissions for that file?

ls -la /opt/bitnami/ghost/.ghostpid

Regards,
Michiel

Here’s what it returns, @michiel :
-rw-r--r-- 1 ghost bitnami 5 Dec 30 23:25 /opt/bitnami/ghost/.ghostpid

Hello @PrescottPaulin,

Please try stoping the Ghost service before trying the update again:

sudo /opt/bitnami/ctlscript.sh stop ghost

If you are still having problems, could you please try again the whole upgrade process following our guides. Keep in mind you need to update the Ghost CLI before upgrading Ghost itself:

https://docs.bitnami.com/aws/apps/ghost/administration/update-cli/
https://docs.bitnami.com/aws/apps/ghost/administration/upgrade/

Regards,
Francisco de Paz

I just got all of these errors when upgrading the CLI:

bitnami@ip-10-0-1-202:/opt/bitnami/ghost$ cd /opt/bitnami/ghost/current
bitnami@ip-10-0-1-202:/opt/bitnami/ghost/current$ sudo npm install ghost-cli
npm WARN deprecated url-regex-safe@2.1.0: Please upgrade to url-regex-safe@v3.0.0+ AND install re2 as an additional dependency in your project via `npm install re2` or `yarn add re2`.
npm WARN deprecated mailgun-js@0.22.0: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated bree@6.4.0: bree@7.0.0 drops support for the browser, Node <12.11.0, and removes bthreads entirely. Either upgrade to v7.0.0 or lock your bree version to v6.5.0.
npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated intl-messageformat-parser@2.1.3: We've written a new parser that's 6x faster and is backwards compatible. Please use @formatjs/icu-messageformat-parser
npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/rimraf as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/rimraf

npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/escodegen as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/escodegen

npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/esgenerate as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/escodegen

npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/nopt as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/nopt

npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/mkdirp as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/mkdirp

npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/esvalidate as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/esprima

npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/esparse as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/esprima

npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/acorn as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/acorn

> yarn@1.22.15 preinstall /opt/bitnami/ghost/versions/4.24.0/node_modules/yarn

> :; (node ./preinstall.js > /dev/null 2>&1 || true)

> dtrace-provider@0.8.8 install /opt/bitnami/ghost/versions/4.24.0/node_modules/dtrace-provider

> node-gyp rebuild || node suppress-error.js

gyp WARN EACCES current user ("bitnami") does not have permission to access the dev dir "/root/.cache/node-gyp/14.18.2"

gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/bitnami/ghost/versions/4.24.0/node_modules/dtrace-provider/.node-gyp"

gyp WARN install got an error, rolling back install

gyp WARN install got an error, rolling back install

gyp ERR! configure error

gyp ERR! stack Error: EACCES: permission denied, mkdir '/opt/bitnami/ghost/versions/4.24.0/node_modules/dtrace-provider/.node-gyp'

gyp ERR! System Linux 4.19.0-18-cloud-amd64

gyp ERR! command "/opt/bitnami/node/bin/node" "/opt/bitnami/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

gyp ERR! cwd /opt/bitnami/ghost/versions/4.24.0/node_modules/dtrace-provider

gyp ERR! node -v v14.18.2

gyp ERR! node-gyp -v v5.1.0

gyp ERR! not ok

> sqlite3@5.0.2 install /opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3

> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download

node-pre-gyp WARN Pre-built binaries not installable for sqlite3@5.0.2 and node@14.18.2 (node-v83 ABI, glibc) (falling back to source compile with node-gyp)

node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/lib/binding'

gyp WARN EACCES current user ("bitnami") does not have permission to access the dev dir "/root/.cache/node-gyp/14.18.2"

gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/.node-gyp"

gyp WARN install got an error, rolling back install

gyp WARN install got an error, rolling back install

gyp ERR! configure error

gyp ERR! stack Error: EACCES: permission denied, mkdir '/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/.node-gyp'

gyp ERR! System Linux 4.19.0-18-cloud-amd64

gyp ERR! command "/opt/bitnami/node/bin/node" "/opt/bitnami/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/lib/binding/napi-v3-linux-x64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"

gyp ERR! cwd /opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3

gyp ERR! node -v v14.18.2

gyp ERR! node-gyp -v v5.1.0

gyp ERR! not ok

node-pre-gyp ERR! build error

node-pre-gyp ERR! stack Error: Failed to execute '/opt/bitnami/node/bin/node /opt/bitnami/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/lib/binding/napi-v3-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)

node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/opt/bitnami/ghost/versions/4.24.0/node_modules/node-pre-gyp/lib/util/compile.js:83:29)

node-pre-gyp ERR! stack at ChildProcess.emit (events.js:400:28)

node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1058:16)

node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)

node-pre-gyp ERR! System Linux 4.19.0-18-cloud-amd64

node-pre-gyp ERR! command "/opt/bitnami/node/bin/node" "/opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"

node-pre-gyp ERR! cwd /opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3

node-pre-gyp ERR! node -v v14.18.2

node-pre-gyp ERR! node-pre-gyp -v v0.11.0

node-pre-gyp ERR! not ok

Failed to execute '/opt/bitnami/node/bin/node /opt/bitnami/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/lib/binding/napi-v3-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)

> sharp@0.29.2 install /opt/bitnami/ghost/versions/4.24.0/node_modules/sharp

> (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Installation error: EACCES: permission denied, mkdir '/root/.npm'

sharp: Are you trying to install as a root or sudo user? Try again with the --unsafe-perm flag

sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies

> re2@1.17.2 install /opt/bitnami/ghost/versions/4.24.0/node_modules/re2

> install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR --skip-path-var RE2_DOWNLOAD_SKIP_PATH --skip-ver-var RE2_DOWNLOAD_SKIP_VER || npm run rebuild

Trying https://github.com/uhop/node-re2/releases/download/1.17.2/linux-x64-83.br ...

Writing to build/Release/re2.node ...

Trying https://github.com/uhop/node-re2/releases/download/1.17.2/linux-x64-83.gz ...

Writing to build/Release/re2.node ...

Building locally ...

npm ERR! code EACCES

npm ERR! syscall scandir

npm ERR! path /root/.npm/_logs

npm ERR! errno -13

npm ERR!

npm ERR! Your cache folder contains root-owned files, due to a bug in

npm ERR! previous versions of npm which has since been addressed.

npm ERR!

npm ERR! To permanently fix this problem, please run:

npm ERR! sudo chown -R 1000:1000 "/root/.npm"

glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {

errno: -13,

code: 'EACCES',

syscall: 'scandir',

path: '/root/.npm/_logs'

}

> re2@1.17.2 rebuild /opt/bitnami/ghost/versions/4.24.0/node_modules/re2

> node-gyp rebuild

gyp WARN EACCES current user ("bitnami") does not have permission to access the dev dir "/root/.cache/node-gyp/14.18.2"

gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/bitnami/ghost/versions/4.24.0/node_modules/re2/.node-gyp"

gyp WARN install got an error, rolling back install

gyp WARN install got an error, rolling back install

gyp ERR! configure error

gyp ERR! stack Error: EACCES: permission denied, mkdir '/opt/bitnami/ghost/versions/4.24.0/node_modules/re2/.node-gyp'

gyp ERR! System Linux 4.19.0-18-cloud-amd64

gyp ERR! command "/opt/bitnami/node/bin/node" "/opt/bitnami/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

gyp ERR! cwd /opt/bitnami/ghost/versions/4.24.0/node_modules/re2

gyp ERR! node -v v14.18.2

gyp ERR! node-gyp -v v5.1.0

gyp ERR! not ok

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! re2@1.17.2 rebuild: `node-gyp rebuild`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the re2@1.17.2 rebuild script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

(node:3105) UnhandledPromiseRejectionWarning: 243

(Use `node --trace-warnings ...` to show where the warning was created)

(node:3105) 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:3105) [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.

npm notice created a lockfile as package-lock.json. You should commit this file.

npm WARN @tryghost/express-dynamic-redirects@0.2.1 requires a peer of express@^4.17.1 but none is installed. You must install peer dependencies yourself.

npm WARN express-brute@1.0.1 requires a peer of express@4.x but none is installed. You must install peer dependencies yourself.

npm WARN express-lazy-router@1.0.4 requires a peer of express@^4.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sqlite3@5.0.2 (node_modules/knex-migrator/node_modules/sqlite3):

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sqlite3@5.0.2 install: `node-pre-gyp install --fallback-to-build`

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sharp@0.29.2 (node_modules/sharp):

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sharp@0.29.2 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)`

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ ghost-cli@1.18.1

added 461 packages from 208 contributors, removed 212 packages, updated 1302 packages and audited 1902 packages in 212.296s

140 packages are looking for funding

run `npm fund` for details

found 32 vulnerabilities (18 moderate, 12 high, 2 critical)

run `npm audit fix` to fix them, or `npm audit` for details

When I try to upgrade / update Ghost after installing the CLI, I see the same error message as before:

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost/current**$ cd /opt/bitnami/ghost

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost**$ sudo su ghost ghost update

sh: 0: Can't open ghost

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost**$ sudo su ghost -c 'bin/ghost update'

An error occurred.

Message: 'EACCES: permission denied, unlink '/opt/bitnami/ghost/.ghostpid''

Debug Information:

OS: Debian GNU/Linux, v10

Node Version: v14.18.2

Ghost Version: 4.24.0

Ghost-CLI Version: 1.18.1

Environment: production

Command: 'ghost update'

Additional log info available in: /home/ghost/.ghost/logs/ghost-cli-debug-2022-01-07T16_06_37_709Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost**$

If I just try running “ghost update” or “sudo ghost update” here is what happens…

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost**$ ghost update

✔ Checking system Node.js version - found v14.18.2

ℹ Ensuring user is not logged in as ghost user [skipped]

ℹ Checking if logged in user is directory owner [skipped]

✔ Checking current folder permissions

✔ Checking content folder ownership

✔ Checking memory availability

✔ Checking free space

✔ Checking for available migrations

✔ Checking for latest Ghost version

# 4.32.1

* 🎨 Improved copy on member email unsubscribe page - Kevin Ansfield

* 🐛 Fixed broken Zapier links in Admin integration page - Rishabh

* 🐛 Fixed incorrect automatic CSV download when bulk-deleting members - Kevin Ansfield

* 🐛 Added pagination to sitemap.xml to avoid max 50,000 entries limit - Thibaut Patel

* 🐛 Fixed confusing wording change whilst saving in publish confirmation modal - Kevin Ansfield

* 🐛 Fixed Flickr embeds appearing distorted in emails - Kevin Ansfield

* 🐛 Fixed Spotify and Soundcloud embeds having overly long containers in editor - Kevin Ansfield

* 🐛 Added fallback for meta_description to custom_excerpt (#13927) - Matt Hanley

---

View the changelogs for full details:

* Ghost - https://github.com/tryghost/ghost/compare/v4.32.0...v4.32.1

* Admin - https://github.com/tryghost/admin/compare/v4.32.0...v4.32.1

✔ Fetched release notes

✖ Downloading and updating Ghost to v4.32.1

An error occurred.

Message: 'EACCES: permission denied, mkdir '/opt/bitnami/ghost/versions/4.32.1''

Debug Information:

OS: Debian GNU/Linux, v10

Node Version: v14.18.2

Ghost Version: 4.24.0

Ghost-CLI Version: 1.18.1

Environment: production

Command: 'ghost update'

Additional log info available in: /home/bitnami/.ghost/logs/ghost-cli-debug-2022-01-07T16_08_26_809Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.

**bitnami@ip-10-0-1-202**:**/opt/bitnami/ghost**$ sudo ghost update

You can't run commands as the 'root' user.

Switch to your regular user, or create a new user with regular account privileges and use this user to run 'ghost update'.

For more information, see https://ghost.org/docs/install/ubuntu/#create-a-new-user.

Hi @PrescottPaulin,

The ghostpid file needs to be owned by root. Can you change it:

sudo chown root:root /opt/bitnami/ghost/.ghostpid

And then run the update command:

cd /opt/bitnami/ghost
sudo su ghost -c 'bin/ghost update'

Regards,
Michiel

Given the consistent headaches and the inability to get this install working out of the box on AWS, I have moved to DigitalOcean, which booted up with no errors in less than 5 minutes and is about $18/mo with 3TB of transfer and 60GB SSD; 2 vCPUs (Intel) and 2 GB dedicated RAM. (A lot cheaper than AWS for equivalent or better computing resources.)

I can now see why Ghost.org is recommending their solution over using Bitnami on AWS.
https://marketplace.digitalocean.com/apps/ghost

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