Infocaster/UrlTracker

System.Data.SqlClient.SqlException: 'Column name 'Culture' does not exist in the target table or view.'

weinerm opened this issue · 5 comments

Describe the bug
Using version: 9.0.1
Umbraco version: 9.3.1
Getting a runtime error when debugging.
System.Data.SqlClient.SqlException: 'Column name 'Culture' does not exist in the target table or view.'
This exception was originally thrown at this call stack:
[External Code]
...Program.Main(string[]) in Program.cs

To Reproduce
Steps to reproduce the behavior:

  1. Install Umbraco 9.3.1
  2. Install UrlTracker 9.0.1
  3. Configure Startup.cs
  4. Start debugging

Did I miss a step with installation?

Hi @weinerm ! thank you for reaching out!

You've followed the installation steps perfectly. I'll see if I can reproduce this issue and then come back. In the meantime, perhaps you could answer me these questions:

  1. Did you perform these steps on a fresh database or did you upgrade from an older version? (older version of umbraco and older version of the URL Tracker)
  2. Can you confirm the existence of two tables in your database icUrlTracker and icUrlTrackerIgnore404?
  3. Can you check if both tables have a column called 'Culture' or if it is indeed missing?

I've seen reports on the old version (4.x and lower) missing the culture column, but I didn't expect any such issues on fresh installs of the new version, so I'm wondering if you've updated from a lower version.

Hi @D-Inventor

Thanks for following up.

  1. I'm in the process of upgrading from Umbraco 7 -> 9. Though the site was running in 9.3.1 prior to installing UrlTracker
    That sparked the epiphany that I was using an ancient version of UrlTracker on the v7 site: 3.11, so some tables were preexisting (which is surely the issue).
  2. I have a table icUrlTracker, missing table icUrlTrackerIgnore404
  3. Existing table does not have a Culture column

icUrlTracker table has 1.5 million rows of data! There must have been a bug relating to that, so it might be best to just purge it and deal with the consequences.

Should I just drop the table an reinstall the package?

If you're ok with starting fresh with our URL Tracker, then yeah you should just drop the table and reinstall. Also, after dropping the table, make sure you check the umbracoKeyValue for a row with key='Umbraco.Core.Upgrader.State+UrlTracker' and delete that as well. Not the whole table, just the row with that particular key.

Since v5, the URL Tracker makes proper use of Umbraco's migrations. So to start fresh, you need to reset the migration state.

As for 1.5 million rows of data, that's quite a lot, though not uncommon in my experience. It's unfortunate that the initial authors decided to combine redirects and client errors into one single table, but I'm planning to work on that, separate everything a bit better and probably significantly improving the memory footprint in the database. I think there's also some nice performance improvements to be had!

That being said, you may want to check if the old URL Tracker version that you had installed already has the export function (I'm not too familiar with the versions before 4.x). I know there was an export feature for Umbraco 7 and it should still be compatible with the import / export for Umbraco 9, so that's definitely worth a try.

I believe dropping the table and reinstalling solved my issue. I'm having another issue where a test redirect isn't working, but it might be related to my multi-site setup. Will open a separate thread for that.

Unfortunately the old version doesn't have an export option, but it'll probably be fairly easy to export/import data manually.

Thanks for your input!