question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR: Database version is not recognized on ubuntu14

See original GitHub issue

I followed this tutorial: https://www.digitalocean.com/community/tutorials/how-to-create-a-blog-with-ghost-and-nginx-on-ubuntu-14-04

when i tried to run “npm start --production”, i got following error:

test@ubuntu-test-purpose:/home/project/jackieouyang$ sudo npm start --production

> ghost@0.10.1 start /home/project/jackieouyang
> node index

WARNING: Ghost is attempting to use a direct method to send email.
It is recommended that you explicitly configure an email service.
Help and documentation can be found at http://support.ghost.org/mail.


ERROR: Database version is not recognized

 Error
    at Error.DatabaseVersion (/home/project/jackieouyang/core/server/errors/database-version.js:3:18)
    at /home/project/jackieouyang/core/server/data/schema/versioning.js:35:47
    at tryCatcher (/home/project/jackieouyang/node_modules/knex/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/home/project/jackieouyang/node_modules/knex/node_modules/bluebird/js/main/promise.js:510:31)
    at Promise._settlePromiseAt (/home/project/jackieouyang/node_modules/knex/node_modules/bluebird/js/main/promise.js:584:18)
    at Promise._settlePromises (/home/project/jackieouyang/node_modules/knex/node_modules/bluebird/js/main/promise.js:700:14)
    at Async._drainQueue (/home/project/jackieouyang/node_modules/knex/node_modules/bluebird/js/main/async.js:123:16)
    at Async._drainQueues (/home/project/jackieouyang/node_modules/knex/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/project/jackieouyang/node_modules/knex/node_modules/bluebird/js/main/async.js:15:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

Technical details:

  • Ghost Version: download today
  • Node Version:4.2.6
  • Browser/OS: ubuntu 14
  • Database: Sqlite version 2.8.17

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Richie765commented, Dec 21, 2016

I’m running the docker 0.11.3 image and I had the same problem.

I was following: https://www.ghostforbeginners.com/migrating-ghost-installation-from-sqlite3-to-mysql/

First I got:

ERROR: Unable to populate database: alter table `posts_tags` add constraint `posts_tags_post_id_foreign` foreign key (`post_id`) references `posts` (`id`) - ER_TABLEACCESS_DENIED_ERROR: REFERENCES command denied to user 'ghost'@'172.19.0.15' for table 'posts'

After restart of the container I got the same error as above.

I fixed it by granting REFERENCES to the user. It wasn’t in the above guide. Perhaps it should be updated.

1reaction
fullsolucoescommented, Sep 19, 2016

If I delete de ghost.db and restart ghost, the system recreate the database corretly.

Logs:

[ { sql: 'select * from sqlite_master where type = \'table\' and name = ?', output: [Function: output], bindings: [ 'settings' ] } ] Migrations: Creating tables... Migrations: Creating table: posts [ { sql: 'create table if not exists "posts" ("id" integer not null primary key autoincrement, "uuid" varchar(36) not null, "title" varchar(150) not null, "slug" varchar(150) not null, "markdown" text null, "mobiledoc" text null, "html" text null, "image" text null, "featured" boolean not null default \'0\', "page" boolean not null default \'0\', "status" varchar(150) not null default \'draft\', "language" varchar(6) not null default \'en_US\', "visibility" varchar(150) not null default \'public\', "meta_title" varchar(150) null, "meta_description" varchar(200) null, "author_id" integer not null, "created_at" datetime not null, "created_by" integer not null, "updated_at" datetime null, "updated_by" integer null, "published_at" datetime null, "published_by" integer null)', bindings: [] }, { sql: 'create unique index posts_slug_unique on "posts" ("slug")', bindings: [] } ] Migrations: Creating table: users [ { sql: 'create table if not exists "users" ("id" integer not null primary key autoincrement, "uuid" varchar(36) not null, "name" varchar(150) not null, "slug" varchar(150) not null, "password" varchar(60) not null, "email" varchar(254) not null, "image" text null, "cover" text null, "bio" varchar(200) null, "website" text null, "location" text null, "facebook" text null, "twitter" text null, "accessibility" text null, "status" varchar(150) not null default \'active\', "language" varchar(6) not null default \'en_US\', "visibility" varchar(150) not null default \'public\', "meta_title" varchar(150) null, "meta_description" varchar(200) null, "tour" text null, "last_login" datetime null, "created_at" datetime not null, "created_by" integer not null, "updated_at" datetime null, "updated_by" integer null)', bindings: [] }, { sql: 'create unique index users_slug_unique on "users" ("slug")', bindings: [] }, { sql: 'create unique index users_email_unique on "users" ("email")', bindings: [] } ] Migrations: Creating table: roles [ { sql: 'create table if not exists "roles" ("id" integer not null primary key autoincrement, "uuid" varchar(36) not null, "name" varchar(150) not null, "description" varchar(200) null, "created_at" datetime not null, "created_by" integer not null, "updated_at" datetime null, "updated_by" integer null)', bindings: [] } ] Migrations: Creating table: roles_users [ { sql: 'create table if not exists "roles_users" ("id" integer not null primary key autoincrement, "role_id" integer not null, "user_id" integer not null)', bindings: [] } ] Migrations: Creating table: permissions [ { sql: 'create table if not exists "permissions" ("id" integer not null primary key autoincrement, "uuid" varchar(36) not null, "name" varchar(150) not null, "object_type" varchar(150) not null, "action_type" varchar(150) not null, "object_id" integer null, "created_at" datetime not null, "created_by" integer not null, "updated_at" datetime null, "updated_by" integer null)', bindings: [] } ]

And if I stop and drop the image and recreate preserving the old ghost.db even upgrading the version all works fine.

The problem is in the firts run of ghost install

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Install MySQL on Ubuntu 14.04 - DigitalOcean
This is due to some changes made in MySQL 5.6 and a minor error in the APT package. The mysql_install_db command is deprecated...
Read more >
PHPPgAdmin not working in Ubuntu 14.04
Yes, this works. However this appears to be a problem with the package. conf.d is meant to contain any global configurations which the...
Read more >
Error starting database after fresh install (Vertica 7.2.3-0 on ...
Error starting database after fresh install (Vertica 7.2.3-0 on Ubuntu 14.04) · --database my_vertica -s 127.0.0.1 · Info · : · no password ......
Read more >
Install mysqldump on Ubuntu 14.04 - Stack Overflow
You must install mysql-client, which is a dependency of mysql-server (pastebin.com/h5cg6iDG), so it's strange that you haven't it installed. It must be the...
Read more >
lsnrctl is not working on Ubuntu 14.04
Your lsnrctl has 0 bytes so either you didn't install Oracle software correctly or your installation is damaged.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found