DanDiplo / Diplo.LinkChecker

Link Checker for Umbraco 7
3 stars 7 forks source link

Diplo Link Checker - endless checking #2

Closed Auraya86 closed 3 years ago

Auraya86 commented 6 years ago

Hi,

I installed the Diplo Link Checker https://our.umbraco.org/projects/backoffice-extensions/diplo-link-checker/ on my UmbracoVersion 7.3.0

The Plugin is scanning the project and stops at 249 pages, but it will not finish. I get no result, neither error nor succes message.

I checked the console-log and see 1000 errors

failed to load resource: the server respond with a status of 500 (Internal Server Error)

  at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at Diplo.LinkChecker.Services.HttpCheckerService.<GetHtmlFromUrl>d__17.MoveNext() in D:\Websites\Umbraco\Packages\Diplo.LinkChecker\Diplo.LinkChecker\Services\HttpCheckerService.cs:line 74
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Diplo.LinkChecker.Controllers.LinkCheckerController.<CheckPage>d__0.MoveNext() in D:\Websites\Umbraco\Packages\Diplo.LinkChecker\Diplo.LinkChecker\Controllers\LinkCheckerController.cs:line 53
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
DanDiplo commented 6 years ago

Hi. The Link Checker will attempt to make a request to every page you have in your Umbraco website. It then gets the HTML from the request and checks the links it finds in the HTML.

From the information you posted it appears that some of the pages it is trying to check on your Umbraco website are throwing a 500 server error. Are you able to check all the pages in your site work and don't throw a server error when visited?

I can't really tell much more than that from the stack trace you posted.

Auraya86 commented 6 years ago

Does the LinkChecker need to have access from external? I am working on a protected/development system, external users don't have access to the site. The pages are available for me. And the page is used with SSL.

DanDiplo commented 6 years ago

It does make an HTTP GET request to every page in the site, but it does that in the context of where it is run from. If, for example, you run it from Visual Studio then it will make the request to localhost, but it should work in that context. But if you have other forms of authentication configured then that could cause the issue.

The SSL may also be an issue. Under the hood the checker uses the .NET HTTP Client and this can throw errors if the certificate isn't valid (ie. self-signed) or uses a more modern version of TSL than it was expecting. It's quite fussy, I've found.

Unfortunately, this is quite an old project - could do with updating, so it's not something I've looked at for a while.

Auraya86 commented 6 years ago

Unfortunately, I dont work on localhost. My devsystem is on a remote server, however it should work from the current context as you describe before.

Does the certificate problem is on my site? How can I solve it? The certificate on my server is valid until Decemer 2019 and it is not self-signed.

Or do you have to update your code?

DanDiplo commented 6 years ago

I can't really tell if the certificate is the issue without accessing it. If it's valid for the domain and not self-signed then it shouldn't be. Do you know what version of SSL/TLS it uses? (If you use Chrome and then go to Dev Tools and then Security tab it should say eg. "the connection to this site uses TLS 1.2 (a strong protocol)").

If the certificate is an issue then I'd probably need to update my code to tell the .NET HttpClient not to throw an error if there is a certificate problem. I think this can be done, but it's not something I can easily test.

But it still could be an authentication issue. Have you got any other tools, such as Postman you can make an HTTP request with to test what response you get back?