Error when trying to install ghost through source

I was following the instructions in ghost as install from source and When I try to run Yarn setup getting the following error:

ERROR insert into posts ( author_id , canonical_url , codeinjection_foot , codeinjection_head

  • ER_BAD_FIELD_ERROR: Unknown column ‘canonical_url’ in ‘field list’

{“config”:{“transaction”:true},“name”:“2-create-fixtures.js”}
“Error occurred while executing the following migration: 2-create-fixtures.js”

Error ID:
300

Error Code:
ER_BAD_FIELD_ERROR

Can someone help me with this?

Hi @athira! This looks like an error in migrations. Which version of Ghost are you trying to install? Are you using the latest master branch?

Yes I am trying to install the latest master branch

Even for my previous version which was running fine on Friday also has the same issue… So tried to install it on a different directory and was testing for the same… Can someone help me in fixing this?

Didn’t have time to get a closer look, but this seems like an issue with migrations not being run properly before initializing fixtures. Can you try running something like:

knex-migrator migrate --v 2.31 --force

And then use yarn setup. Let me know what comes out of this and will try to have a closer look once have time :slight_smile:

when I ran the above command “knex-migrator migrate --v 2.31 --force” got into the following error as same before

Error: ER_BAD_FIELD_ERROR: Unknown column ‘canonical_url’ in ‘field list’

Did you do any changes to the “default fixtures” on the database schema/data you are connecting to?

No…

The complete error:

ERROR insert into posts (author_id, canonical_url, codeinjection_foot, codeinjection_head, comment_id, created_at, created_by, custom_excerpt, custom_template, feature_image, featured, html, id, locale, meta_description, meta_title, mobiledoc, og_description, og_image, og_title, page, plaintext, published_at, published_by, slug, status, title, twitter_description, twitter_image, twitter_title, updated_at, updated_by, uuid, visibility) values (‘5951f5fca366002ebd5dbef7’, NULL, NULL, NULL, ‘5d9239728b55c019c6e7870a’, ‘2019-09-30 17:20:50’, ‘1’, ‘Ghost comes with a beautiful default theme called Casper, which is designed to be a clean, readable publication layout and can be easily adapted for most purposes.’, NULL, ‘https://static.ghost.org/v2.0.0/images/creating-a-custom-theme.jpg’, false, ‘

Ghost comes with a beautiful default theme called Casper, which is designed to be a clean, readable publication layout and can be adapted for most purposes. However, Ghost can also be completely themed to suit your needs. Rather than just giving you a few basic settings which act as a poor proxy for code, we just let you write code.

There are a huge range of both free and premium pre-built themes which you can get from the <a href=“https://ghost.org/marketplace/”>Ghost Theme Marketplace, or you can create your own from scratch.

<figure class=“kg-card kg-image-card kg-card-hascaption”><img src=“https://static.ghost.org/v1.0.0/images/marketplace.jpg” class=“kg-image”>Anyone can write a completely custom Ghost theme with some solid knowledge of HTML and CSS

Ghost themes are written with a templating language called handlebars, which has a set of dynamic helpers to insert your data into template files. For example: {{author.name}} outputs the name of the current author.

The best way to learn how to write your own Ghost theme is to have a look at <a href=“https://github.com/TryGhost/Casper”>the source code for Casper, which is heavily commented and should give you a sense of how everything fits together.

  • default.hbs is the main template file, all contexts will load inside this file unless specifically told to use a different template.
  • post.hbs is the file used in the context of viewing a post.
  • index.hbs is the file used in the context of viewing the home page.
  • and so on

We’ve got <a href=“https://ghost.org/docs/api/handlebars-themes/”>full and extensive theme documentation which outlines every template file, context and helper that you can use.

If you want to chat with other people making Ghost themes to get any advice or help, there’s also a themes section on our <a href=“https://forum.ghost.org/c/themes”>public Ghost forum.

’, ‘5d9239728b55c019c6e7870a’, NULL, NULL, NULL, ‘{“version”:“0.3.1”,“atoms”:,“cards”:[[“image”,{“src”:“https://static.ghost.org/v1.0.0/images/marketplace.jpg",“caption”:"Anyone can write a completely custom Ghost theme with some solid knowledge of HTML and CSS”}]],“markups”:[[“a”,[“href”,“https://ghost.org/marketplace/"]],[“code”],[“a”,[“href”,“https://github.com/TryGhost/Casper”]],[“a”,[“href”,“https://ghost.org/docs/api/handlebars-themes/”]],[“strong”],[“a”,[“href”,“https://forum.ghost.org/c/themes”]]],“sections”:[[1,“p”,[[0,[],0,"Ghost comes with a beautiful default theme called Casper, which is designed to be a clean, readable publication layout and can be adapted for most purposes. However, Ghost can also be completely themed to suit your needs. Rather than just giving you a few basic settings which act as a poor proxy for code, we just let you write code.”]]],[1,“p”,[[0,,0,“There are a huge range of both free and premium pre-built themes which you can get from the “],[0,[0],1,“Ghost Theme Marketplace”],[0,,0,”, or you can create your own from scratch.”]]],[10,0],[1,“p”,[[0,,0,“Ghost themes are written with a templating language called handlebars, which has a set of dynamic helpers to insert your data into template files. For example: “],[0,[1],1,”{{author.name}}”],[0,,0," outputs the name of the current author."]]],[1,“p”,[[0,,0,“The best way to learn how to write your own Ghost theme is to have a look at “],[0,[2],1,“the source code for Casper”],[0,,0,”, which is heavily commented and should give you a sense of how everything fits together.”]]],[3,“ul”,[[[0,[1],1,“default.hbs”],[0,,0," is the main template file, all contexts will load inside this file unless specifically told to use a different template."]],[[0,[1],1,“post.hbs”],[0,,0," is the file used in the context of viewing a post."]],[[0,[1],1,“index.hbs”],[0,,0," is the file used in the context of viewing the home page."]],[[0,,0,“and so on”]]]],[1,“p”,[[0,,0,“We’ve got “],[0,[3],1,“full and extensive theme documentation”],[0,,0,” which outlines every template file, context and helper that you can use.”]]],[1,“p”,[[0,,0,“If you want to chat with other people making Ghost themes to get any advice or help, there’s also a “],[0,[4],1,“themes”],[0,,0,” section on our “],[0,[5],1,“public Ghost forum”],[0,,0,”.”]]]]}’, NULL, NULL, NULL, false, ‘Ghost comes with a beautiful default theme called Casper, which is designed to\nbe a clean, readable publication layout and can be adapted for most purposes.\nHowever, Ghost can also be completely themed to suit your needs. Rather than\njust giving you a few basic settings which act as a poor proxy for code, we just\nlet you write code.\n\nThere are a huge range of both free and premium pre-built themes which you can\nget from the Ghost Theme Marketplace [https://ghost.org/marketplace/], or you\ncan create your own from scratch.\n\nAnyone can write a completely custom Ghost theme with some solid knowledge of\nHTML and CSSGhost themes are written with a templating language called\nhandlebars, which has a set of dynamic helpers to insert your data into template\nfiles. For example: {{author.name}} outputs the name of the current author.\n\nThe best way to learn how to write your own Ghost theme is to have a look at \nthe\nsource code for Casper [https://github.com/TryGhost/Casper], which is heavily\ncommented and should give you a sense of how everything fits together.\n\n * default.hbs is the main template file, all contexts will load inside this\n file unless specifically told to use a different template.\n * post.hbs is the file used in the context of viewing a post.\n * index.hbs is the file used in the context of viewing the home page.\n * and so on\n\nWe’ve got full and extensive theme documentation\n[https://ghost.org/docs/api/handlebars-themes/] which outlines every template\nfile, context and helper that you can use.\n\nIf you want to chat with other people making Ghost themes to get any advice or\nhelp, there’s also a themes section on our public Ghost forum\n[https://forum.ghost.org/c/themes].’, ‘2019-09-30 17:20:50’, ‘1’, ‘themes’, ‘published’, ‘Creating a custom theme’, NULL, NULL, NULL, ‘2019-09-30 17:20:50’, ‘1’, ‘44659514-74f5-4cd5-8228-be21094a2031’, ‘public’) - ER_BAD_FIELD_ERROR: Unknown column ‘canonical_url’ in ‘field list’

I have tried installing in another machine also.I am getting the same error there too…
I guess there is some issue with the ghost knex migration…