trustification / trustify

Apache License 2.0
8 stars 15 forks source link

Database issues, migrations not run #449

Open ctron opened 1 week ago

ctron commented 1 week ago

After updating my demo system, I noticed that the advisories table no longer works. Fetching the data results in (500):

{
  "error": "Database error",
  "message": "Query Error: error returned from database: column \"score\" does not exist"
}

I didn't further investigate. So I don't know if this is a UI issue or a backend issue (or both).

ctron commented 1 week ago

cc @carlosthe19916

ctron commented 1 week ago

I noticed other views failing as well:

carlosthe19916 commented 1 week ago

I have the latest version locally working and I do not see those issues.

ctron commented 1 week ago

That might be the case. The instance is using an external database. I would expect that to "migrate" to the newest schema. I'll try check if that's indeed the case.

ctron commented 1 week ago

Resetting the database partially solved this. The advisories still fail with the same error.

ctron commented 1 week ago

However it also looks like as if the importers fail with similar errors now.

ctron commented 1 week ago

Ok, it might be a mix of "did not run migrations" and PEBKAC: I ran the migrations with the old container.

The real issue seems to me that we did not properly use migrations. So the migrations were assumed to be applied, while in fact that are not.

ctron commented 1 week ago

Ok, so having worked around all the issues (like full disk, wrong migration) I still had to wipe the database for the upgrade.

So @carlosthe19916 you had been right, it was a stale database issue. I guess we need to work on migrations.