Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snap! Failed to load config section "notebook" Internal Server Error #1295

Closed
skabbe opened this issue May 23, 2018 · 7 comments
Closed

Snap! Failed to load config section "notebook" Internal Server Error #1295

skabbe opened this issue May 23, 2018 · 7 comments

Comments

@skabbe
Copy link

skabbe commented May 23, 2018

Hello,

I have installed Anaconda3-5.1.0 for windows. Afterwards, I installed nbextensions for Jupyter notebook.

I have used following code in Anaconda Prompt for nbextension installation:
pip install jupyter_contrib_nbextensions
jupyter-contrib nbextension install --sys-prefix

When i open Jupyter notebook and click on NBextensions tab, I see following error and also nothing is loaded in notebook.

Snap! Failed to load config section "notebook"
Internal Server Error

Traceback (most recent call last):
  File "C:\Users\AA67116\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\web.py", line 1510, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "C:\Users\AA67116\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\web.py", line 2898, in wrapper
    return method(self, *args, **kwargs)
  File "C:\Users\AA67116\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\services\config\handlers.py", line 19, in get
    self.finish(json.dumps(self.config_manager.get(section_name)))
  File "C:\Users\AA67116\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\services\config\manager.py", line 25, in get
    recursive_update(config, cm.get(section_name))
  File "C:\Users\AA67116\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\config_manager.py", line 85, in get
    recursive_update(data, json.load(f))
  File "C:\Users\AA67116\AppData\Local\Continuum\anaconda3\lib\json\__init__.py", line 299, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "C:\Users\AA67116\AppData\Local\Continuum\anaconda3\lib\json\__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "C:\Users\AA67116\AppData\Local\Continuum\anaconda3\lib\json\decoder.py", line 342, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 15 column 1 (char 360)

I am struggling to figure it out for a while already. I would really appreciate, if you guys help me out here.

Thanks in advance.

@juhasch
Copy link
Member

juhasch commented May 23, 2018

Can you check your JSON config files using this snippet:

import glob
import os
import json
from jupyter_core.paths import jupyter_config_path

for d in jupyter_config_path():
    for p in glob.glob(os.path.join(d, 'nbconfig', '*.json')):
        try:
            with open(p, 'r') as f:
                json.load(f)
            print('File {0} is OK.'.format(p))
        except json.decoder.JSONDecodeError:
            print('Failed JSON file is:', p)

@skabbe
Copy link
Author

skabbe commented May 24, 2018

Hello,

thanks a lot for reply.

here is output:

File C:\Users\kabbe\.jupyter\nbconfig\common.json is OK.
Failed JSON file is: C:\Users\kabbe\.jupyter\nbconfig\notebook.json
File C:\Users\kabbe\.jupyter\nbconfig\tree.json is OK.
File C:\Users\kabbe\AppData\Local\Continuum\anaconda3\etc\jupyter\nbconfig\notebook.json is OK.
File C:\Users\kabbe\AppData\Local\Continuum\anaconda3\etc\jupyter\nbconfig\tree.json is OK.
File C:\ProgramData\jupyter\nbconfig\notebook.json is OK.
File C:\ProgramData\jupyter\nbconfig\tree.json is OK.

@juhasch
Copy link
Member

juhasch commented May 24, 2018

So there is an error in your configuration file C:\Users\kabbe\.jupyter\nbconfig\notebook.json.
Can you take a look at it why it fails or show the contents of the file ?

@skabbe
Copy link
Author

skabbe commented May 24, 2018

Hello,

Please see the content below.

Thanks in advance.

{
  "load_extensions": {
    "snippets/main": true,
    "cell_filter/cell_filter": false,
    "varInspector/main": true,
    "execute_time/ExecuteTime": true,
    "toggle_all_line_numbers/main": true,
    "scratchpad/main": true,
    "freeze/main": true,
    "table_beautifier/main": false,
    "hinterland/hinterland": true,
    "hide_input/main": true
  }
}
{
  "MarkdownCell": {
    "cm_config": {
      "lineWrapping": true
    }
  },
  "CodeCell": {
    "cm_config": {
      "lineWrapping": true
    }
  }
}

@juhasch
Copy link
Member

juhasch commented May 24, 2018

This is invalid JSON, so the error can be expected. You can either remove the second part of the file or fix the structure and merge the two parts by removing lines 14&15 and adding a ,.
Try pasting it at https://jsonlint.com so you can check if it is valid JSON.

@skabbe
Copy link
Author

skabbe commented May 24, 2018

Great!. It works now. Appreciated for your help.

@SyedHasnat
Copy link

Can you check your JSON config files using this snippet:

import glob
import os
import json
from jupyter_core.paths import jupyter_config_path

for d in jupyter_config_path():
    for p in glob.glob(os.path.join(d, 'nbconfig', '*.json')):
        try:
            with open(p, 'r') as f:
                json.load(f)
            print('File {0} is OK.'.format(p))
        except json.decoder.JSONDecodeError:
            print('Failed JSON file is:', p)

I got this how to fix it;
File C:\Users\Syed Hasnat.jupyter\nbconfig\common.json is OK.
File C:\Users\Syed Hasnat.jupyter\nbconfig\edit.json is OK.
Failed JSON file is: C:\Users\Syed Hasnat.jupyter\nbconfig\notebook.json
File C:\Users\Syed Hasnat.jupyter\nbconfig\tree.json is OK.
File C:\ProgramData\jupyter\nbconfig\notebook.json is OK.
File C:\ProgramData\jupyter\nbconfig\tree.json is OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants