markdown-link-check icon indicating copy to clipboard operation
markdown-link-check copied to clipboard

`result.statusCode: 0` being returned by many external links

Open chris-dura opened this issue 3 years ago • 5 comments

I've recently started getting a result.statusCode: 0 returned when checking my markdown files.

'use strict';

/**
 * @fileoverview This is a stub test to use the `markdown-link-check` library directly,
 * to test whether the problem is truly with `markdown-link-check`,
 * or the underlying `link-check` library
 */

const markdownLinkCheck = require('markdown-link-check');

markdownLinkCheck('[example](http://google.com)', function (err, results) {
	if (err) {
		console.error('Error', err);
		return;
	}
	results.forEach(function (result) {
		console.log('%s is %s', result.link, result.status, result.statusCode);
	});
});

markdownLinkCheck('[example](https://dequeuniversity.com/screenreaders/voiceover-keyboard-shortcuts)', function (err, results) {
	if (err) {
		console.error('Error', err);
		return;
	}
	results.forEach(function (result) {
		console.log('%s is %s', result.link, result.status, result.statusCode);
	});
});


// output:
// http://google.com is alive 200
// https://dequeuniversity.com/screenreaders/voiceover-keyboard-shortcuts is dead 0

Is this perhaps related to https://github.com/tcort/link-check/issues/47#issuecomment-847764254?

chris-dura avatar Sep 29 '22 19:09 chris-dura

Hey @tcort! Do you think that it would be feasible to introduce a generic retry parameter? In coder/coder we can observe some transient network issues which could be fixed with a simple retry/backoff mechanism.

mtojek avatar Dec 06 '22 10:12 mtojek

We also observe similar issues with status code 0 for some links, a manual retry to our GH action usually fix it, would prefer to have the markdown link checker make that retry.

Zvikan avatar Dec 12 '22 16:12 Zvikan

https://developer.android.com/build/multidex#avoid as well

codefromthecrypt avatar Jan 14 '24 02:01 codefromthecrypt