We have been using the SEO checker successfully for a while now. Our client has added in a tonne of redirects. But just recently something has broken and we don't know why.
With a copy of my client's site locally, the redirects don't work, even using localhost.
But with a clean copy of Umbraco 8.6.1 the same version as my client, and a clean version of SEOChecker, the redirects work perfectly.
So I unintsalled SEOChecker on my client's site, deleted plugin files, dlls etc. and reinstalled as a fresh copy, and it is still not working.
Is there something you could point me towards to help us figure out why the redirects would all of a sudden stop working? e.g. I really should disable Umbraco's built in redirects.
Best not to -re-install etc to fix this. I think either an inbound link error, or ignored inbound link error cause the issue. Check if the redirect that is failing exists in one of those overviews and remove from there.
Redirect settings:
1. Enable redirect module - tick
2. Track url history - tick
3. Store domain for not found urls - not ticked
4. Store querystring for not found urls - not ticked
5. Forward querystring - ticked
6. Redirect when node exists - not ticked
The entry I am testing with:
/ordering
the node doesn't exist, and it falls to a 404 page but it should be redirecting to /support/ordering.
The site is a multi lingual site, if that might make a difference, but with my testing on another site, the multi lingual stuff worked beautifully! (Amazing work by the way! Thank you!!)
Your point on the configuration leads me into the Log Viewer:
SEOChecker: SEOChecker: Error during validating Configuration
System.NullReferenceException: Object reference not set to an instance of an object.
at SEOChecker.Core.Umbraco.DocumentWrappers.UmbracoDocumentBase.<>c__DisplayClass4_0`1.<GetPropertyValue>b__1(DocumentProperty p)
at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
at SEOChecker.Core.Umbraco.DocumentWrappers.UmbracoDocumentBase.GetPropertyValue[T](String propertyAlias, Boolean recursive, String culture, String segment)
at SEOChecker.Core.Umbraco.DocumentWrappers.UmbracoDocument..ctor(IContent doc, IContextInfo info, String culture, String segment)
at SEOChecker.Core.Helpers.UmbracoDocumentHelper.GetFirstPublishedChildNode(IContextInfo contextInfo, String culture, String segment)
at SEOChecker.Validators.ConfigurationValidators.TrailingSlashValidator.SEOChecker.Extensions.Validation.ConfigurationValidation.IConfigurationValidator.Parse(List`1 result, IContextInfo contextInfo)
at SEOChecker.Core.Validation.ConfigurationValidators.ConfigurationValidator.Validate()
SourceContext SEOChecker.Core.Validation.ConfigurationValidators.ConfigurationValidator
So it reads like there is an error with configuration but I cannot see where and what precisely is wrong.
The ConfigurationError comes from the ConfigurationIssuesOverview. Also interesting and shoudl be catched but should not cause any redirect issues. If it's caused by this database only then an invalid redirect could exists in the database. Not any errors related to seochcheckerpagenot found table?
I just found out that renaming a page does not create a redirect. All the configuration seems right, so I am scratching my hair. I also have the same configuration error in my log.
I also had a look in the log of one of the sites that does not work, and I think I have found a related error message. Are you seeing something similar Colin?
(Actual "sitename" removed for privacy)
System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated in table 'cxgtafbfvyd.dbo.SEOChecker_PageNotFound', column 'Url'. Truncated value: '&data=04%7C01%[email protected]%7C75f1733f41ad4dfb505408d90577a0b2%7Ca0898660117a4c92af2f0042067055bc'.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at NPoco.Database.ExecuteScalarHelper(DbCommand cmd)
at NPoco.Database.InsertImp[T](PocoData pocoData, String tableName, String primaryKeyName, Boolean autoIncrement, T poco)
at NPoco.Database.Insert[T](String tableName, String primaryKeyName, Boolean autoIncrement, T poco)
at NPoco.Database.Save[T](T poco)
at SEOChecker.Core.Repository.PageNotFound.PageNotFoundRepository.Insert(Uri uri, Uri referer, Int32 documentId, String redirect, Boolean isNotFound, ContentTypeEnum contentType, Boolean storeDomain, Boolean wildCard, Boolean storeQueryString)
at SEOChecker.Core.Repository.PageNotFound.PageNotFoundRepository.Insert(Uri uri, Uri referer, ContentTypeEnum contentType)
at SEOChecker.Core.Components.UrlRedirectComponent.(Object , EventArgs )
ClientConnectionId:00bdca18-626b-4730-92c3-60bf9bfbecf0
Error Number:2628,State:1,Class:16
Tested it on a couple of sites, both running Umbraco 8.13.1 and SeoChecker 2.10.1, on Umbraco Cloud. Also tested it locally, and that does not work either.
I just did that. Changed it to nvarchar(1000).
The error seems to be gone now.
But, I just tried to rename a node, and I get this error.
And the old URL does not redirect.
Yup. Upadting the Url column to nvarchar(1000) worked. I also updated the RedirectUrl column to nvarchar(1000) as I noticed that column was mostly empty albeit with 60k entries.
I can't test the publishing of pages, or updating them as it's quite a controlled website (long story), but there are tonnes of other errors in the log view for SEO checker which doesn't feel healthy. The logs don't go back far as they are regular deleted, but 11 pages of just SEO Checker errors since the 9th December...
Okay, for some reason, I am no longer able to provoque the error in the log. But it still doesnt work. When renaming a page, no redirect is created automatically.
Unfortunately, although this was the fix, the redirects have stopped working again.
When I don't have the "even if page exists" set, no redirects work.
When I have "even if page exists" set, redirects that are in the table work (as expected) but the table is FULL of pages without a trailing slash redirecting to themselves with a trailing slash, but this causes "too many redirects" issue. So I have to have that set to off, in order to stop the too many redirects, and I have to set the Trailing Slash setting to on, in order to get the trailing slash in the Url. But that then breaks the pages that do exist but need to redirect, that are set in the Redirect manager.
It feels like my client's site is a super edge case in all your logic, and I am not sure how to fix it.
We also have multiple languages which is compounding the case.
One thing also I have noted, the "Validate SEO" button doesn't seem to do anything on any page. It only ever returns "[]" when I check in the Network tab in Chrome Tools.
And this is in the error logs:
"SEOChecker: SEOChecker: Document with Id '1293' and 1with url https://www.peakscientific.com/products/ could not be validated because of the exception 'The operation has timed out' on the page"
A possible link that something isn't working well...?
One of which is code that was added before I got involved. I found a composition.SetContentLastChanceFinder
By removing that I find the code works.
But there is still the issue of Looping too many times when "trailing slash" is set to on and "redirect if node exists" because of database entries:
Url Document ID
/products 1234
where 1234 is the Products page, and because it exists and because your code checks things by removing the first and last forward slash, it will cause a never ending loop.
I am currently tidying up our database to remove those rows and duplicate entries as well.
Tis fun.
But the main redirect issue was someone else's code being applied after your content finder. Two worlds collided, almost rival nations.
From that I found all entries in the table that were essentially pointing to itself which causes the infinite loop when "even if node exists". I deleted them all.
I then tidied up the duplicates where Url and DocumentId matched, removing all but one.
My database table is half the size (still a lot of junk) but things are working correctly now.
Redirect stopped working
We have been using the SEO checker successfully for a while now. Our client has added in a tonne of redirects. But just recently something has broken and we don't know why.
With a copy of my client's site locally, the redirects don't work, even using localhost.
But with a clean copy of Umbraco 8.6.1 the same version as my client, and a clean version of SEOChecker, the redirects work perfectly.
So I unintsalled SEOChecker on my client's site, deleted plugin files, dlls etc. and reinstalled as a fresh copy, and it is still not working.
Is there something you could point me towards to help us figure out why the redirects would all of a sudden stop working? e.g. I really should disable Umbraco's built in redirects.
Any help would be appreciated!
Hi
Best not to -re-install etc to fix this. I think either an inbound link error, or ignored inbound link error cause the issue. Check if the redirect that is failing exists in one of those overviews and remove from there.
Hope this helps,
Richard
All of the redirects no longer work. It's not a specific redirect.
Did you disable the redirect module in settings?
Good question. I inherited the project last week :D
I did disable the Url Tracker via the UI in Umbraco 8 to no affect, but if you are saying there is a "redirect module in settings":
Do you mean system.webServer > rewrite rules?
Or do you mean "disableRedirectUrlTracking="false""?
Colin
No I mean in SEOChecker go to the general settings and see if redirect manager is turned off.
Redirect settings: 1. Enable redirect module - tick 2. Track url history - tick 3. Store domain for not found urls - not ticked 4. Store querystring for not found urls - not ticked 5. Forward querystring - ticked 6. Redirect when node exists - not ticked
The entry I am testing with:
/ordering
the node doesn't exist, and it falls to a 404 page but it should be redirecting to /support/ordering.
The site is a multi lingual site, if that might make a difference, but with my testing on another site, the multi lingual stuff worked beautifully! (Amazing work by the way! Thank you!!)
Your point on the configuration leads me into the Log Viewer:
So it reads like there is an error with configuration but I cannot see where and what precisely is wrong.
Could maybe an update be helpful in this circumstance?
The ConfigurationError comes from the ConfigurationIssuesOverview. Also interesting and shoudl be catched but should not cause any redirect issues. If it's caused by this database only then an invalid redirect could exists in the database. Not any errors related to seochcheckerpagenot found table?
About to go offiline but will reply on monday.
Best,
Richard
seochcheckerpagenot - no errors in the logs for that.
If you haven't gone, where are the Urls stored in the database?
Url's are stored in SEOChecker_PageNotFound table
+1 on this.
I just found out that renaming a page does not create a redirect. All the configuration seems right, so I am scratching my hair. I also have the same configuration error in my log.
I also had a look in the log of one of the sites that does not work, and I think I have found a related error message. Are you seeing something similar Colin? (Actual "sitename" removed for privacy)
Tested it on a couple of sites, both running Umbraco 8.13.1 and SeoChecker 2.10.1, on Umbraco Cloud. Also tested it locally, and that does not work either.
Can you try increase the url column length?
I just did that. Changed it to nvarchar(1000). The error seems to be gone now. But, I just tried to rename a node, and I get this error. And the old URL does not redirect.
I just tried with the latest version 2.11.2 And don't see this issue. Can you try with the latest version as well?
Best,
Richard
I just triede installing the latest version. Still get the same error. Is there something special you have to do when upgrading from 2.10.1 to 2.11.2?
Weird,
And is anything in the tree of this document unpublished maybe?
Best,
Richard
There is an unpublished variant in another language, on both the root that was renamed and it's child.
Yup. Upadting the Url column to nvarchar(1000) worked. I also updated the RedirectUrl column to nvarchar(1000) as I noticed that column was mostly empty albeit with 60k entries.
I can't test the publishing of pages, or updating them as it's quite a controlled website (long story), but there are tonnes of other errors in the log view for SEO checker which doesn't feel healthy. The logs don't go back far as they are regular deleted, but 11 pages of just SEO Checker errors since the 9th December...
But that's all for another day :-)
I only changed the Url column. Will try with also changing the RedirectUrl column.
Edit: Tried that, did not help. Found the entry for the node i renamed in the PageNotFound table. Looks like this:
No automatic redirect created, but no error to see in the log. This is local testing btw.
Also, no redirects to see on the property editor on the node itself:
Okay, for some reason, I am no longer able to provoque the error in the log. But it still doesnt work. When renaming a page, no redirect is created automatically.
2 things in one thread :-) Track url history still enabled in general settings?
Yes, it's enabled.
Weird, when the page get's published it should check the name in that case and create a redirect (or fail and the log an error)
I agree.
Unfortunately, although this was the fix, the redirects have stopped working again.
When I don't have the "even if page exists" set, no redirects work. When I have "even if page exists" set, redirects that are in the table work (as expected) but the table is FULL of pages without a trailing slash redirecting to themselves with a trailing slash, but this causes "too many redirects" issue. So I have to have that set to off, in order to stop the too many redirects, and I have to set the Trailing Slash setting to on, in order to get the trailing slash in the Url. But that then breaks the pages that do exist but need to redirect, that are set in the Redirect manager.
It feels like my client's site is a super edge case in all your logic, and I am not sure how to fix it.
We also have multiple languages which is compounding the case.
One thing also I have noted, the "Validate SEO" button doesn't seem to do anything on any page. It only ever returns "[]" when I check in the Network tab in Chrome Tools.
And this is in the error logs:
"SEOChecker: SEOChecker: Document with Id '1293' and 1with url https://www.peakscientific.com/products/ could not be validated because of the exception 'The operation has timed out' on the page"
A possible link that something isn't working well...?
Is this on all pages? Could be that an outgoing request can't be made.
Yes it is. I won't worry about that though here now.
The redirect is absolutely not working and no errors in the logs to say why.
I added "/jobby" to the Redirect Manager, to redirect to "http://www.google.co.uk". When I hit "/jobby" in the browser it does not redirect.
https://www.peakscientific.com/jobby
Help?!
In Inbound link errors is jobby logged? Otherwise in ignored inbound link errors?
I've disabled the Url Redirects in favour of the old school 301s in a redirect.config file until I can work out why this is happening.
As an FYI:
The PageNotFound table has ~40k entries in it, but only 2339 unique ones.
Turns out there are a couple of issues.
One of which is code that was added before I got involved. I found a composition.SetContentLastChanceFinder
By removing that I find the code works.
But there is still the issue of Looping too many times when "trailing slash" is set to on and "redirect if node exists" because of database entries:
where 1234 is the Products page, and because it exists and because your code checks things by removing the first and last forward slash, it will cause a never ending loop.
I am currently tidying up our database to remove those rows and duplicate entries as well.
Tis fun.
But the main redirect issue was someone else's code being applied after your content finder. Two worlds collided, almost rival nations.
I used the SEO Checker's API to GetAll redirects.
From that I found all entries in the table that were essentially pointing to itself which causes the infinite loop when "even if node exists". I deleted them all.
I then tidied up the duplicates where Url and DocumentId matched, removing all but one.
My database table is half the size (still a lot of junk) but things are working correctly now.
Thanks.
@Richard this is funny:
https://our.umbraco.com/packages/website-utilities/seo-checker/feature-request/101390-lastchancecontentfinder#comment-317468
Because yeah, First One Wins (or Last One In etc). But yeah, that nailed the problem.
is working on a reply...