Database migration error

Technical details:

  • Ghost Version: 1.22.8
  • Ghost-cli: 1.7.3
  • npm: 5.6.0
  • python: 2.7.12
  • Node Version: 8.9.4
  • Browser/OS: Ubuntu 16.04 EC2 AWS

I’m trying to setup a blog on my ec2 instance using this tutorial.

Error logs -

✔ Setting up Systemd Running sudo command: /var/www/ghost/current/node_modules/.bin/knex-migrator-migrate --init --mgpath /var/www/ghost/current ✖ Running database migrations A ProcessError occurred.

Message: The database migration in Ghost encountered an error.
Help: https://docs.ghost.org/v1/docs/troubleshooting#section-general-update-error

Debug Information:
OS: Ubuntu, v16.04
Node Version: v8.9.4
Ghost-CLI Version: 1.7.3
Environment: production
Command: ‘ghost install’

Additional log info available in: /home/user/.ghost/logs/ghost-cli-debug-2018-05-15T20_26_18_686Z.log

I have tried removing, reinstalling everything (node, python, ghost, mysql etc) nothing seems to work :disappointed:
(everything works as expected if I use the docker method)

@meakaakka is there any other information in that log file?

@Kevin Here is the output -

▶ cat /home/user/.ghost/logs/ghost-cli-debug-2018-05-15T20_26_18_686Z.log
Debug Information:
    OS: Ubuntu, v16.04
    Node Version: v8.9.4
    Ghost-CLI Version: 1.7.3
    Environment: production
    Command: 'ghost install'
Message: The database migration in Ghost encountered an error.
Help: https://docs.ghost.org/v1/docs/troubleshooting#section-general-update-error
--------------- stderr ---------------
/usr/bin/env: ‘node’: No such file or directory

The location of the node binary isn’t in your path - Can you check and make sure node is installed system-wide and not just for you?

@vikaspotluri123 I have installed node using the nvm. Output of node -v is v8.9.4.

What is the output of sudo -u ghost node -v?

1 Like

It’s - sudo: node: command not found

This means nvm / node is installed only for your user and not system-wide. In some cases in order to install ghost, node must be installed system-wide.

Okay, it seems like nvm only install the node for per user so I have uninstalled it and install using the standard way. This is what I see now -
sudo -u ghost node -v
v6.14.2

You should be able to install Ghost now! :tada:

1 Like

Hurry, it worked. So I think the problem was in the nvm. It would be great if this is mentioned somewhere in the docs so that other users don’t face similar issue. Thanks a lot :heart:

There is a big box in the docs, explaining that nvm can be problematic and that you should install node systemwide:

https://docs.ghost.org/docs/install#section-finally-install-node-js

Hope, that helps?

2 Likes

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