question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

An invalid URI problem while rendering

See original GitHub issue

I received such problem while rendering, that the program keeps trying to download one gif file but got an “invalid URI” error, so it stays at the download status :

⠋ Download media file unnamed-348904-0.gif2019-01-17T22:39:15.528Z [error]: ERROR: Invalid URI "https:///%3Ca%20href="
STACK: Error: Invalid URI "https:///%3Ca%20href="
    at Request.init (/usr/local/lib/node_modules/udacimak/node_modules/request/request.js:273:31)
    at new Request (/usr/local/lib/node_modules/udacimak/node_modules/request/request.js:127:8)
    at request (/usr/local/lib/node_modules/udacimak/node_modules/request/index.js:53:10)
    at Promise (/usr/local/lib/node_modules/udacimak/lib/commands/utils/downloadImage.js:84:56)
    at new Promise (<anonymous>)
    at downloadImage (/usr/local/lib/node_modules/udacimak/lib/commands/utils/downloadImage.js:36:10)
    at downloadMediaInHtml (/usr/local/lib/node_modules/udacimak/lib/commands/utils/downloadMediaInHtml.js:77:53)
    at createHtmlText (/usr/local/lib/node_modules/udacimak/lib/commands/render/functions/utils/createHtmlText.js:19:47)
    at createHtmlTextAtom (/usr/local/lib/node_modules/udacimak/lib/commands/render/functions/atoms/createHtmlTextAtom.js:23:48)
    at writeHtmlConcept (/usr/local/lib/node_modules/udacimak/lib/commands/render/functions/writeHtmlConcept.js:51:53)
⠴ Download media file unnamed-348904-0.gif
⠙ Download media file unnamed-348904-0.gif
⠸ Download media file unnamed-348904-0.gif
⠸ Download media file unnamed-348904-0.gif

I am using macOS and trying to download my materials which are in Chinese. Other contents before were well downloaded but it stops at this gif file and keeps trying.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
udacimakcommented, Jan 18, 2019

Thanks @AlainOUYANG

So the issue comes from this JSON entry:

{
  "id": 348904,
  "key": "1bc7f5be-9c0f-47da-990b-47becc82e1e3",
  "title": null,
  "semantic_type": "TextAtom",
  "is_public": true,
  "text": "# 练习:编写 Softmax\n\n现在该你来操作了!我们用 Python 编写 Softmax 公式吧。\n\nSoftmax公式:\n\n<img src=\"http://chart.googleapis.com/chart?cht=tx&chl=\\Large S_i = \\frac{e^i}{\\sum_j{e^j}}\" style=\"border:none;\">\n",
  "instructor_notes": ""
},

The <img> in text key contains URL with space characters, causing the markdown parser and image downloader to fail. I’ll need to debug and update the CLI to be able to handle that. It’ll take some time because my markdown parser has been too hacky due to inconsistency in Udacity’s json data.

For now, you can temporary fix it on your end by changing the text key to this:

  "text": "# 练习:编写 Softmax\n\n现在该你来操作了!我们用 Python 编写 Softmax 公式吧。\n\nSoftmax公式:\n\n<img src=\"http://chart.googleapis.com/chart?cht=tx&chl=\\Large%20S_i%20=%20\\frac{e^i}{\\sum_j{e^j}}\" style=\"border:none;\">\n",

or this:

  "text": "# 练习:编写 Softmax\n\n现在该你来操作了!我们用 Python 编写 Softmax 公式吧。\n\nSoftmax公式:\n\n![](http://chart.googleapis.com/chart?cht=tx&chl=\\Large%20S_i%20=%20\\frac{e^i}{\\sum_j{e^j}})",
},

This will be the result for this atom (in 15. 多类别分类与Softmax 函数.html)

2019-01-18 11_24_54- softmax

Thanks for reporting the bug!

1reaction
AlainOUYANGcommented, Jan 18, 2019

Yeah, it works! Thanks for your reply! I really appreciate that and will recommend this awesome tool to my Chinese classmates cos we are informed yesterday that the term has changed. Btw, the Chinese Udacity Team announced that they will provide a tool for downloading the course “on one click”, but didn’t mention whether it will be only the videos or all other materials as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Invalid URI: The Uri string is too long" error when you render ...
Fixes an issue in which an "Invalid URI: The Uri string is too long" error message is received when you render an SSRS...
Read more >
The format of the URI could not be determined" using .Net ...
Getting error as soon as app starts "UriFormatException: Invalid URI: The format of the URI could not be determined" using .Net core 3.1...
Read more >
Invalid URI: There is an invalid sequence in the string. Error!!
Hi guys, I just moved a project from my pc to a server production (to an. ISP). on my pc it all works...
Read more >
SSRS 2012 Error: Invalid URI: The Uri string is too long
An error occurred during rendering of the report. Invalid URI: The Uri string is too long.
Read more >
Error when trying to render field 'source' as uri - Drupal
I get an error when adding a new CSV file for import. In the error log is show: InvalidArgumentException: The URI ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found