mdn / yari

The platform code behind MDN Web Docs
Mozilla Public License 2.0
1.19k stars 509 forks source link

Flaw crashed with colon in image file name #2643

Closed nschonni closed 3 years ago

nschonni commented 3 years ago

Ran across this

$ yarn content flaws Learn/Getting_started_with_the_web/What_will_your_website_look_like
yarn run v1.22.5
$ env-cmd --silent cross-env CONTENT_ROOT=files node node_modules/@mdn/yari/tool/cli.js flaws Learn/Getting_started_with_the_web/What_will_your_website_look_like
Raw image size: 55.3 KB Compressed: 17.9 KB
Error: ENOENT: no such file or directory, open 'files\en-us\learn\getting_started_with_the_web\what_will_your_website_look_like\screenshot_from_2014-11-03_17:40:49.png'
    at Object.openSync (fs.js:476:3)
    at Object.writeFileSync (fs.js:1467:35)
    at fixFixableFlaws (Z:\mdn-content\node_modules\@mdn\yari\build\flaws.js:491:14)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async buildDocument (Z:\mdn-content\node_modules\@mdn\yari\build\index.js:332:5)
    at async Z:\mdn-content\node_modules\@mdn\yari\tool\cli.js:342:23
    at async Se._action (Z:\mdn-content\node_modules\@mdn\yari\tool\cli.js:27:7)
    at async Se.run (Z:\mdn-content\node_modules\@caporal\core\dist\index.js:1:27579)
    at async Te._run (Z:\mdn-content\node_modules\@caporal\core\dist\index.js:1:32257) {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'files\\en-us\\learn\\getting_started_with_the_web\\what_will_your_website_look_like\\screenshot_from_2014-11-03_17:40:49.png'
}

If I escape the creenshot_from_2014-11-03_17:40:49.png to screenshot_from_2014-11-03_17:40:49.png with : it runs. Without, it failes and leaves the source as src="undefined"

nschonni commented 3 years ago

Although, with the escaping, it still doesn't download/update the image

nschonni commented 3 years ago

Found another

error: ENOENT: no such file or directory, open 'files\en-us\web\api\webrtc_api\build_a_phone_with_peerjs\build_the_server\1*ic3evvgnzvg1koquxo0mmw.png'

Think in this case it's the *

peterbe commented 3 years ago

Uh?? That page doesn't have any flaws:

Screen Shot 2021-01-22 at 2 53 35 PM
nschonni commented 3 years ago

I manually fixed that oneit as part of one of the flaws batches yesterday. Maybe try the WebRTC one, haven't touched it yet