jupinx icon indicating copy to clipboard operation
jupinx copied to clipboard

NewConnectionError when building websites from notebooks that access the web

Open MaxGhenis opened this issue 4 years ago • 8 comments

I'm using jupinx to build an rst that pulls data from the web, The executed notebook builds fine, but the webpage gives this error:

NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7e2a5d9b4690>: Failed to establish a new connection: [Errno -2] Name or service not known ... MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /PSLmodels/Tax-Calculator/master/taxcalc/reforms/2017_law.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7e2a5d9b4690>: Failed to establish a new connection: [Errno -2] Name or service not known'))

I've tried rebuilding a couple times, but the error is consistent.

MaxGhenis avatar Jun 21 '20 01:06 MaxGhenis

thanks for reporting @MaxGhenis -- will try and take a look this week.

mmcky avatar Jun 21 '20 02:06 mmcky

FYI I'm getting the same error in jupyter-book: https://github.com/executablebooks/jupyter-book/issues/735

MaxGhenis avatar Jun 26 '20 19:06 MaxGhenis

@MaxGhenis , can you send along the rst which is causing this error? The rst link above gives 404. From the error screenshot, it looks more like a urllib or other python package configuration/bug then jupinx bug itself.

AakashGfude avatar Jun 30 '20 00:06 AakashGfude

https://github.com/PSLmodels/Tax-Calculator/blob/1eb9c41d957fd8b14213a05e6a1686eb8dd0afad/docs/jupinx/source/recipe01.rst

I haven't had this issue running it locally as a notebook before.

MaxGhenis avatar Jun 30 '20 14:06 MaxGhenis

@MaxGhenis So, I ran the build for your rst file. Same as in your case I suppose, the website produced locally works fine. But it throws the error in github pages or htmlpreview.github.io. I suspect there might be some proxy or other things involved in these hosted services, or has to do with urllib3, or the taxcalc package? Which we cant particularly fix in jupinx ? Let me know what you think.

AakashGfude avatar Jul 07 '20 01:07 AakashGfude

hey @MaxGhenis -- are you using CI to build your project? @AakashGfude is indicating that locally this builds ok but may not establish a connection via urllib when building on a remote service?

mmcky avatar Jul 08 '20 04:07 mmcky

No I'm not using CI. The notebook works when I run it through the Jupyter Notebook interface, but fails when it runs through jupyter-book build (locally).

It's also finicky--sometimes it runs OK with jupyter-book build and sometimes it doesn't.

MaxGhenis avatar Jul 08 '20 19:07 MaxGhenis

See https://github.com/executablebooks/jupyter-book/issues/735#issuecomment-655923318

MaxGhenis avatar Jul 09 '20 06:07 MaxGhenis