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

PR tests fail because of jsonschema #4038

Closed
Hyaxia opened this issue Sep 26, 2018 · 9 comments · Fixed by #4041
Closed

PR tests fail because of jsonschema #4038

Hyaxia opened this issue Sep 26, 2018 · 9 comments · Fixed by #4041

Comments

@Hyaxia
Copy link
Contributor

Hyaxia commented Sep 26, 2018

Hi everyone.
I have submitted a PR and waited for the tests to complete - #4036
The tests on travis failed, resulting in a long output that repeats itself saying:

The command "symlinks=$(find . -type l| grep -v './node_modules/' | grep -v './git-hooks')
if [[ $(echo $symlinks) ]]; then
    echo "Repository contains symlinks which won't work on windows:"
    echo $symlinks
    echo ""
    false
else
    true
fi
" exited with 0.
5.04s$ if [[ $GROUP == js* ]]; then travis_retry python -m notebook.jstest ${GROUP:3}; fi
Test group: base
Notebook failed to start: 
['/home/travis/virtualenv/python3.6.3/bin/python', '-m', 'notebook', '--no-browser', '--notebook-dir', '/tmp/tmpfsrwphhz', '--NotebookApp.token=', '--NotebookApp.base_url=/a@b/', '--KernelManager.transport=ipc']
Traceback (most recent call last):
  File "/opt/python/3.6.3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/opt/python/3.6.3/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/notebook/__main__.py", line 4, in <module>
    from notebook import notebookapp as app
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/notebook/notebookapp.py", line 82, in <module>
    from .services.contents.manager import ContentsManager
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/notebook/services/contents/manager.py", line 17, in <module>
    from nbformat import sign, validate as validate_nb, ValidationError
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/nbformat/__init__.py", line 33, in <module>
    from .validator import validate, ValidationError
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/nbformat/validator.py", line 12, in <module>
    from jsonschema import ValidationError
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/jsonschema/__init__.py", line 21, in <module>
    from jsonschema._types import TypeChecker
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/jsonschema/_types.py", line 49, in <module>
    class TypeChecker(object):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/jsonschema/_types.py", line 64, in TypeChecker
    _type_checkers = attr.ib(default=pmap(), converter=pmap)
TypeError: attrib() got an unexpected keyword argument 'converter'
Running tests with notebook directory '/tmp/tmpfsrwphhz'

I have found another topic about this issue, same error but I think the symptoms are different : jupyterhub/batchspawner#110

but not idea how can it be connected here....

Can someone explain to me what to do so the error will not occur?
It is 100% not becuase of my code, I have tried multiple times to run it with different versions of python and it all goes fine.

Thanks!

@Carreau
Copy link
Member

Carreau commented Sep 26, 2018

Hi, i've edited your comment to better format it. When pasting multiline error you can use triple backticks:

```
This 
will render as
is with wixed with font
```

I'll investigate further. Test can be flaky sometime.

@Carreau
Copy link
Member

Carreau commented Sep 26, 2018

The error does not come from your PRs, the Master branch has the same issue.

2 packages have conflicting requirements for the attrs package, one requiring 0.17.4+ and the other 0.17.3. Not sure what.

@Hyaxia
Copy link
Contributor Author

Hyaxia commented Sep 26, 2018

@Carreau I will appreciate it a lot if you could also write the way that you investigate it.
Thank you!

@Hyaxia
Copy link
Contributor Author

Hyaxia commented Sep 26, 2018

@Carreau Could you explain how did you come to the conclusion that the attrs of the schema may be the problem?

@Carreau
Copy link
Member

Carreau commented Sep 26, 2018

Could you explain how did you come to the conclusion that the attrs of the schema is the problem?

Sure, but a lot of that is just experience and flair.

the like that caught my eyes was :

pkg_resources.ContextualVersionConflict: (attrs 17.3.0 (/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages), Requirement.parse('attrs>=17.4.0'), {'jsonschema'})

You can see on this line VersionConflict, 17.3.0 and 17.4.0.

pkg_resource at the beginning of the line is typical from runtime check of installed versions. I also know that attrs already have version issues some time in the past. So that smelled to me like attrs version might be the cause.

If you dig higher in the test suite you see jsonschema 3.0.0a2 has requirement attrs>=17.4.0, but you'll have attrs 17.3.0 which is incompatible. Which is another hint.

THe thing you should watch out for is During handling of the above exception, another exception occurred:, so while the second traceback show that there is another issue while trying to recover from the fist; you usually want to fix the original error first.

In this case, the second exception pluggy.PluginValidationError: Plugin 'nbval' could not be loaded: (attrs 17.3.0 (/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages), Requirement.parse('attrs>=17.4.0'), {'jsonschema'})!

Seem to have the same root cause, but in general you forget about it until you fix the first error.

I'm still unsure my fix will work, but it's a good first step to try to update attrs.

@Hyaxia
Copy link
Contributor Author

Hyaxia commented Sep 26, 2018

Could you explain how did you come to the conclusion that the attrs of the schema is the problem?

Sure, but a lot of that is just experience and flair.

the like that caught my eyes was :

pkg_resources.ContextualVersionConflict: (attrs 17.3.0 (/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages), Requirement.parse('attrs>=17.4.0'), {'jsonschema'})

You can see on this line VersionConflict, 17.3.0 and 17.4.0.

pkg_resource at the beginning of the line is typical from runtime check of installed versions. I also know that attrs already have version issues some time in the past. So that smelled to me like attrs version might be the cause.

If you dig higher in the test suite you see jsonschema 3.0.0a2 has requirement attrs>=17.4.0, but you'll have attrs 17.3.0 which is incompatible. Which is another hint.

THe thing you should watch out for is During handling of the above exception, another exception occurred:, so while the second traceback show that there is another issue while trying to recover from the fist; you usually want to fix the original error first.

In this case, the second exception pluggy.PluginValidationError: Plugin 'nbval' could not be loaded: (attrs 17.3.0 (/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages), Requirement.parse('attrs>=17.4.0'), {'jsonschema'})!

Seem to have the same root cause, but in general you forget about it until you fix the first error.

I'm still unsure my fix will work, but it's a good first step to try to update attrs.

I cant seem to find those exceptions in the logs that travis outputs.
For example the line

pkg_resources.ContextualVersionConflict: (attrs 17.3.0 (/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages), Requirement.parse('attrs>=17.4.0'), {'jsonschema'})

where do you find it at?

@Carreau
Copy link
Member

Carreau commented Sep 26, 2018

Let's take for example this run,
we can find the ContextualVersionConflict is at line 951

The Json Schema compatibility error is at line 877, you need to expand withe the arrow on the left sometime.

It can take some time to get use to reading travis logs that can be busy.

@Hyaxia
Copy link
Contributor Author

Hyaxia commented Sep 26, 2018

@Carreau It really is something I need to get more used to.
By are there any rules to read it the right way?
There are multiple checks that have failed, is there any order to read them? or just try to find something fishy?

BTW!!! the tests for the PR worked! you have been a tremendous help!!! thanks alot 🥇 💯

@Carreau
Copy link
Member

Carreau commented Sep 26, 2018

By are there any rules to read it the right way?

No, mostly experience tell you were to look at. It depends also on languages. That's why programmers have not been replaced (yet).

Usually fix the first error, as following errors may be consequences of the first.

Here the following advice is not helpful as the error was at startup, but otherwise:
When reading a given traceback, start at the bottom with the exception type, and phrase before looking at the stack itself. Then in the stack try to find the interesting place where the error occured.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants