Problem/Motivation

Some links, while detected and in the list to check, are never checked. Some of them are invalid domains. Some of them are working links.

Using a link such as http://127.0.0.1:1/broken can't currently be checked.

Steps to reproduce

Make a basic page with links to http://nonexistentdomainasdf.com, http://eia.gov or http://127.0.0.1:1/broken
Re-scan to add links to list
Run cron
See that links are still listed as "Never" checked

Proposed resolution

Add a more global error catching mechanism. And rather than defaulting to 502, show the actual status code from the exception where possible (if it's status code 0 or undefined, then show that rather than default to 502).

Remaining tasks

Provide MR and tests

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ashbeeb created an issue. See original summary.

marc.bau’s picture

What links are never checked? Example?

If non-existend you should get an error. e.g. host name lookup failed.

eahonet’s picture

Any updates to this one @ashbeeb ? I have a non-existent url (a .com) that continues to show "Last Checked" as "Never".

schlaukopf’s picture

Status: Active » Needs review
StatusFileSize
new1.46 KB

I was able to reproduce the same error and found that the issue occurs with domains that don’t exist. Guzzle was unable to resolve the host, which resulted in a ConnectException being thrown instead of a RequestException. This patch addresses the issue by handling TransferException, which will cover both cases.

divya.sejekan’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new210.96 KB
new140.23 KB

The Patch is applied successfully. Links never checked issue looks resolved , now the links are verified and related error messages . Tried with bunch of different types of URLS.

Steps to reproduce:
1. Make a basic page with links to http://nonexistentdomainasdf.com and http://eia.gov
2. Re-scan to add links to list
3. Run cron
4. See that links are still listed as "Never" checked

RTBC++

eiriksm’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs merge request, +Needs tests

Great work, thanks everyone

If someone could convert this into a merge request, that would be a great start.

It also would be nice to add some tests here. I hope that should be fairly easy, adding to the existing coverage.

Finally. A bit unsure if showing a 502 is more helpful than showing it was never checked. Don't we have other codes for such errors in the codebase already? 🤓

immaculatexavier made their first commit to this issue’s fork.

saidatom’s picture

Version: 2.0.0 » 2.1.x-dev

saidatom’s picture

Status: Needs work » Needs review
Issue tags: -Needs merge request, -Needs tests

@eiriksm MR provided with tests. Everything green.

claudiu.cristea’s picture

Status: Needs review » Needs work
Issue tags: +Needs rebase

The MR needs rebase

claudiu.cristea’s picture

Status: Needs work » Needs review
claudiu.cristea’s picture

Status: Needs review » Needs work

Changed the status by mistake

codebymikey made their first commit to this issue’s fork.

codebymikey’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs rebase

codebymikey changed the visibility of the branch 3469263-links-never-checked to hidden.

codebymikey’s picture

Attached static patch

claudiu.cristea’s picture

Status: Needs review » Reviewed & tested by the community

Looks good and tested on a big project

joelpittet made their first commit to this issue’s fork.

  • joelpittet committed e886c427 on 2.1.x authored by saidatom
    fix: #3469263 Links never checked
    
    By: divya.sejekan
    By: codebymikey
    By...
joelpittet’s picture

Status: Reviewed & tested by the community » Fixed

Thank you all for your work and patience here. I have merged this into the 2.1.x dev branch

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.