Error creating project: UndefinedColumn('column "organization_id" of relation "sentry_savedsearch" does not exist

I am self-hosting Sentry. When I try to create a project it displays Internal Error and in the logs I see

ERR ProgrammingError: UndefinedColumn('column "organization_id" of relation "sentry_savedsearch" does not exist\nLINE 1: INSERT INTO "sentry_savedsearch" ("project_id", "organizatio...\n                                                        ^\n',)
ERR SQL: INSERT INTO "sentry_savedsearch" ("project_id", "organization_id", "type", "name", "query", "date_added", "is_default", "is_global", "owner_id") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING "sentry_savedsearch"."id"

Any idea how I can resolve this error?

  • List item

sentry upgrade should resolve it. If you provide more details about your setup, we can understand how you ended up with this scenario though.

Thanks for the reply,

If you provide more details about your setup, we can understand how you ended up with this scenario though.

I am trying to host sentry on a CloudFoundry instance following these instructions:

Once I ran sentry upgrade it resolved this issue. However, when I try to click ‘Create a sample event’ I am getting a new exception:

ERR ProgrammingError: UndefinedFunction('function sentry_increment_project_counter(integer, integer) does not exist\nLINE 2:                 select sentry_increment_project_counter(8, 1...\n                               ^\nHINT:  No function matches the given name and argument types. You might need to add explicit type casts.\n',)
ERR SQL: 
ERR                 select sentry_increment_project_counter(%s, %s)

Any idea how I can resolve this error?

I think you are using a Postgres version that is not supported by Sentry. By the way these instructions seem quite dated. I think they can work for Sentry 9.1 but for v10 you’d need more services. Check out the official repo for this: https://github.com/getsentry/onpremise