CiscoDevNet / yang-explorer

An open-source Yang Browser and RPC Builder Application
Apache License 2.0
438 stars 177 forks source link

Cannot upload some yang modules #60

Closed jean-christophe-manciot closed 5 years ago

jean-christophe-manciot commented 7 years ago

Login as guest Manage Models -> Workspace -> Add -> Browse -> Select some Yang Modules -> OK -> Upload leads to: yang-explorer - uploading yang models

jean-christophe-manciot commented 7 years ago

The trace from CLI is:

[14/Apr/2017 11:56:23]"GET /static/YangExplorer.html HTTP/1.1" 200 6622
[14/Apr/2017 11:56:23]"GET /static/YangExplorer.html HTTP/1.1" 200 6622
[14/Apr/2017 11:56:24] WARNING [django.request] Not Found: /favicon.ico
WARNING:django.request:Not Found: /favicon.ico
[14/Apr/2017 11:56:24]"GET /favicon.ico HTTP/1.1" 404 2546
[14/Apr/2017 11:56:24]"GET /static/history/history.css HTTP/1.1" 304 0
[14/Apr/2017 11:56:24]"GET /static/history/history.js HTTP/1.1" 304 0
- Broken pipe from ('127.0.0.1', 35512)
[14/Apr/2017 11:56:24]"GET /static/swfobject.js HTTP/1.1" 304 0
[14/Apr/2017 11:56:24]"GET /static/YangExplorer000700.swf HTTP/1.1" 304 0
[14/Apr/2017 11:56:26]"GET /explorer/session HTTP/1.1" 200 97
[14/Apr/2017 11:56:35]"POST /explorer/login HTTP/1.1" 200 343
INFO:explorer.views:Received admin request modulelist for user guest
INFO:explorer.views:request_handler: Received Request: (get-collection-list)
[14/Apr/2017 11:56:35]"GET /explorer/userprofiles HTTP/1.1" 200 121
[14/Apr/2017 11:56:35]"GET /explorer/netconf?mode=get%2Dcollection%2Dlist HTTP/1.1" 200 83
INFO:explorer.utils.admin:ModuleAdmin.get_modules: returning (5) modules .. exit
[14/Apr/2017 11:56:35]"GET /explorer/admin?action=modulelist HTTP/1.1" 200 344
[14/Apr/2017 11:56:35]"GET /explorer/modules?node=root HTTP/1.1" 200 348
ERROR:root:Session storage data/session/jsqc46setdw8m16i8pnwrelh42djirf5 does not exist
[14/Apr/2017 11:56:41]"GET /explorer/upload?mode=init HTTP/1.1" 200 64
WARNING:explorer.views:User must be logged in !!
[14/Apr/2017 11:57:21]"POST /explorer/upload/upload-add HTTP/1.1" 200 48
jean-christophe-manciot commented 7 years ago

The documentation says:

###4. Caveats
Yang Model upload fails, Workaround: Use Google Chrome.

Problem: chrome does not work with yang explorer as it does not support flash anymore:

To view this page ensure that Adobe Flash Player version 16.0.0 or greater is installed.
jean-christophe-manciot commented 7 years ago

I feel like speaking in a ghost town.

rustogi commented 7 years ago

Jean-Christophe,

I tried the following version (latest) of chrome on Mac OS X and didn't have any issues. Need your help in reproducing it.

The version of chrome I am using - Version 58.0.3029.96 (64-bit)

Could you indicate your chrome browser version.

Here are the steps I used to reproduce this. Are you following the same steps or are they different, if so could you indicate the differences.

bash setup.sh
./start.sh

$ ./start.sh 

Activating virtualenv ..
Starting YangExplorer server ..
Use http://0.0.0.0:8090/static/YangExplorer.html

Performing system checks...

System check identified no issues (0 silenced).
May 06, 2017 - 13:50:26
Django version 1.8.3, using settings 'server.settings'
Starting development server at http://0.0.0.0:8090/
Quit the server with CONTROL-C.

Then go to http://localhost:8088/static/YangExplorer.html in google chrome.

[06/May/2017 13:50:44]"GET /explorer/session HTTP/1.1" 200 345
[06/May/2017 13:50:44]"GET /explorer/userprofiles HTTP/1.1" 200 121
INFO:explorer.views:Received admin request modulelist for user guest
INFO:explorer.utils.admin:ModuleAdmin.get_modules: returning (6) modules .. exit
[06/May/2017 13:50:44]"GET /explorer/admin?action=modulelist HTTP/1.1" 200 370
INFO:explorer.views:request_handler: Received Request: (get-collection-list)
[06/May/2017 13:50:44]"GET /explorer/modules?node=root HTTP/1.1" 200 205
[06/May/2017 13:50:44]"GET /explorer/netconf?mode=get%2Dcollection%2Dlist HTTP/1.1" 200 83

Then click on 'guest' tab and login as guest/guest

[06/May/2017 13:52:28]"POST /explorer/login HTTP/1.1" 200 96
[06/May/2017 13:52:45]"POST /explorer/login HTTP/1.1" 200 343
[06/May/2017 13:52:45]"GET /explorer/userprofiles HTTP/1.1" 200 121
[06/May/2017 13:52:45]"GET /explorer/modules?node=root HTTP/1.1" 200 205
INFO:explorer.views:request_handler: Received Request: (get-collection-list)
[06/May/2017 13:52:45]"GET /explorer/netconf?mode=get%2Dcollection%2Dlist HTTP/1.1" 200 83
INFO:explorer.views:Received admin request modulelist for user guest
INFO:explorer.utils.admin:ModuleAdmin.get_modules: returning (6) modules .. exit
[06/May/2017 13:52:45]"GET /explorer/admin?action=modulelist HTTP/1.1" 200 370

Then click on 'Manage Models', 'Workspace', and 'Add'.

ERROR:root:Session storage data/session/ocnu5swfy4uj12q4na0t8xag58wjq5rh does not exist
[06/May/2017 13:54:09]"GET /explorer/upload?mode=init HTTP/1.1" 200 64

Then 'Browse' and 'Upload' and that worked for me.

[06/May/2017 13:58:49]"POST /explorer/upload/upload-add HTTP/1.1" 200 100
INFO:explorer.views:Received sync request for ietf-system@2014-08-06.yang, index 0
/home/vagrant/yang/bugs/yang-explorer/v/bin/pyang
/home/vagrant/yang/bugs/yang-explorer/v/bin/pyang
WARNING:root:Dependent modules ietf-netconf-acm not found in dependency list !!
WARNING:root:Dependent modules iana-crypt-hash not found in dependency list !!
WARNING:root:get_dependencies: Dependency (ietf-inet-types) not satisfied, compilation may fail !!
WARNING:root:get_dependencies: Dependency (ietf-yang-types) not satisfied, compilation may fail !!
WARNING:root:get_dependencies: Dependency (ietf-netconf-acm) not satisfied, compilation may fail !!
WARNING:root:get_dependencies: Dependency (iana-crypt-hash) not satisfied, compilation may fail !!
[06/May/2017 13:58:49]"GET /explorer/upload?index=0&file=ietf%2Dsystem%402014%2D08%2D06%2Eyang&mode=sync HTTP/1.1" 200 54
WARNING:root:Dependent modules ietf-netconf-acm not found in dependency list !!
WARNING:root:Dependent modules iana-crypt-hash not found in dependency list !!
WARNING:root:get_dependencies: Dependency (ietf-netconf-acm) not satisfied, compilation may fail !!
WARNING:root:get_dependencies: Dependency (iana-crypt-hash) not satisfied, compilation may fail !!
[06/May/2017 13:58:50]"GET /explorer/upload?mode=commit HTTP/1.1" 200 119
INFO:explorer.views:Received admin request modulelist for user guest
INFO:explorer.utils.admin:ModuleAdmin.get_modules: returning (6) modules .. exit
[06/May/2017 13:58:50]"GET /explorer/admin?action=modulelist HTTP/1.1" 200 370
[06/May/2017 13:58:50]"GET /explorer/modules?node=root HTTP/1.1" 200 205
jean-christophe-manciot commented 7 years ago

@rustogi Please read previous post here. Hence, I was forced to use latest Firefox 53.0 (64-bit) on Linux 4.8 Ubuntu 16.10

jean-christophe-manciot commented 7 years ago

I cannot see any 'guest' tab per say, just a login box: no guest tab When logged in as guest/guest: logged in and try to upload the modules, I get the first same error as you, which you have silently ignored:

ERROR:root:Session storage data/session/88xct034q5tb0ld0v9jfqwi95o3n7y5v does not exist

and then the guest user is not seen: not logged in

[09/May/2017 14:41:46]"GET /explorer/upload?mode=init HTTP/1.1" 200 64
WARNING:explorer.views:User must be logged in !!
[09/May/2017 14:43:50]"POST /explorer/upload/upload-add HTTP/1.1" 200 48
jean-christophe-manciot commented 7 years ago

Also, it would be so much more efficient to be able to indicate a folder to be recursively searched instead of *.yang models within a single folder. If you try to upload all openconfig models, you will feel the pain..

rustogi commented 7 years ago

@jean-christophe-manciot

Regarding your comment "Please read previous post here." <---- This is pointing back at this post itself where you mention

"Problem: chrome does not work with yang explorer as it does not support flash anymore"

But I am able to use the chrome version (which I indicated above) fine and it does support flash. Could you point me to what error were you seeing with chrome? And also indicate your chrome version.

As for your comment "Hence, I was forced to use latest Firefox 53.0 (64-bit) on Linux 4.8 Ubuntu 16.10", since we support Chrome currently, I want to first debug this with chrome, if possible.

As for the error "ERROR:root:Session storage data/session/88xct034q5tb0ld0v9jfqwi95o3n7y5v does not exist" this is harmless and can be ignored. I see it too and it does not cause any issues.

Agree with your observation that the tab should be "Login" not "Guest" - my bad - I will fix the typo.

Also would really appreciate it if you could follow the same template I provided above (in me earlier response on this thread), from starting the yang explorer and then capture server side logs for each of the different operations/key presses on the browser side. This will allow me to see the entire progression of messages to debug this. I apologize for asking this, but as I mentioned I am not seeing this issue so first trying to reproduce it.

jean-christophe-manciot commented 7 years ago

@rustogi OK, my chrome was not setup correctly on Ubuntu, so you can dismiss my remarks about it. I am now able to upload some official openconfig models, but: 1) it is very cumbersome to use because a) it is not possible to recursively upload a folder b) we have to close the "upload yang" window each time to upload another group of models one upload done 2) some fail some fail to upload When I look at the CLI errors, they come from issue 1a):

ERROR:root:invoke_compile: Compile Errors: ['data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-acl@2016-08-08.yang:11: error: module "openconfig-interfaces" not found in search path', 'data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-packet-match-types@2016-08-08.yang:12: error: module "openconfig-extensions" not found in search path', '']
...
ERROR:root:invoke_compile: Compile Errors: ['data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-aft-network-instance@2017-01-13.yang:8: error: module "openconfig-network-instance" not found in search path', 'data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-aft@2017-01-13.yang:9: error: module "openconfig-extensions" not found in search path', 'data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-aft@2017-01-13.yang:13: error: module "openconfig-mpls-types" not found in search path', 'data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-aft@2017-01-13.yang:14: error: module "openconfig-interfaces" not found in search path', 'data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-aft@2017-01-13.yang:16: error: module "openconfig-policy-types" not found in search path', 'data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-aft@2017-01-13.yang:17: error: module "openconfig-types" not found in search path', '']

3) once a group of yang files have been uploaded, they are nowhere to be found on the GUI nowhere to be found

rustogi commented 7 years ago

Ok Tx for verifying the chrome issue. I will try and reproduce the other issue you mentioned wrt uploading models and update this thread accordingly.

jean-christophe-manciot commented 7 years ago

@rustogi Trying to upload the Cisco yang models available on https://github.com/YangModels/yang in vendor/cisco/xe/1641 triggers a lot of warnings and errors:

data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/cisco-flow-monitor@2015-10-26.yang:8: warning: imported module tailf-common not used
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/cisco-qos-action-marking-cfg@2015-05-09.yang:23: warning: imported module ietf-diffserv-action not used
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/cisco-qos-action-qlimit-cfg@2015-05-09.yang:19: warning: imported module ietf-diffserv-policy not used
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/cisco-qos-action-qlimit-cfg@2015-05-09.yang:23: warning: imported module ietf-diffserv-action not used
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/ned@2016-10-24.yang:63067: warning: locally scoped grouping pfr-border-grouping not used
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-aft-network-instance@2017-01-13.yang:8: error: module "openconfig-network-instance" not found in search path
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-aft@2017-01-13.yang:13: error: module "openconfig-mpls-types" not found in search path
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-aft@2017-01-13.yang:14: error: module "openconfig-interfaces" not found in search path
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-aft@2017-01-13.yang:16: error: module "openconfig-policy-types" not found in search path
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-bgp-common@2017-02-02.yang:9: error: module "openconfig-routing-policy" not found in search path
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-bgp-global@2017-02-02.yang:7: error: module "openconfig-extensions" not found in search path
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-bgp-global@2017-02-02.yang:8: error: module "openconfig-yang-types" not found in search path
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-bgp-global@2017-02-02.yang:9: error: module "openconfig-inet-types" not found in search path
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/openconfig-bgp-types@2017-02-02.yang:8: error: module "openconfig-types" not found in search path
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/pim@2014-06-27.yang:7: warning: imported module ietf-inet-types not used
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/pim@2014-06-27.yang:8: warning: imported module ietf-yang-types not used
data/session/8cftfs9u07ok0ihcw1bl1cza8hvrqt3m/pim@2014-06-27.yang:9: warning: imported module ietf-interfaces not used

This reminds me of another issue previously discussed with @einarnn here.

jean-christophe-manciot commented 7 years ago

When I take a look at yang-explorer/requirements.txt, I notice:

rustogi commented 7 years ago

@jean-christophe-manciot I will let @einarnn respond to your questions regarding warnings and errors you are seeing as generated by pyang tool.

As for your previous comment regarding recursively loading models from sub-directories under the top level directory, the way I do that is once I click the "Browse" button, I am asked to pick the local directory under which my .yang files exist. Then I block select all models (.yang files) under that directory and then click "Upload". Once I do that , all those models are uploaded. As to the compilation issues wrt those models, I will defer to @einarnn.

jean-christophe-manciot commented 7 years ago

@rustogi It does not add up:

einarnn commented 7 years ago

Jean-Christophe,

The yang-explorer uses lxml as it's XML parser for dealing with YANG-derived NETCONF payloads. pyang uses lxml (if it's installed) as a library for validating certain aspects of YANG modules (e.g. regular expressions). Thus we unfortunately see that the YANG explorer triggers some errors when pyang is used in the same virtual environment.

A better solution may have been for pyang to be configurable with respect to some parts of validation, rather than how it does it today, which is to perform the validation if lxml just happens to be installed.

Also, it's also interesting to note that even when pyang reports errors, it doesn't necessarily return them in a way that is easily consumed by a client. For example, only some errors return an error that is testable via shell script return code checking. As part of integrating pyang into the Travis CI check for https://github.com/YangModels/yang, see the script at https://github.com/YangModels/yang/blob/master/vendor/cisco/xr/check.sh#L21-L28, which is:

    for f in Cisco-IOS-XR-*-cfg.yang; do         errors=pyang $pyang_flags $f 2>&1 | grep "error:"         if [ ! -z "$errors" ]; then             echo Errors in $f             echo $errors             exit_status="failed!"         fi     done

As you can see, the script has to explicitly check returned output from both stdout and stderr for errors. Thus at this stage I suspect that the yang-explorer currently ignores any error codes from pyang, and as long as a schema tree is available, it works with what it can.

You also ask about the version constraint on pyang. This comes from using the command "pip freeze" to generate dependencies, and is the version that we have tested yang-explorer with. It is entirely possible that pyang 1.7.x will work fine for yang-explorer, but, as yet, we haven't gone through any validation of that.

BTW, I agree about your enhancement suggestion to allow a folder to be specified for recursive upload from a filesystem. @rustogi, I suggest we add that as something to look at. @jean-christophe-manciot, pull requests are also welcome ;-)

Cheers,

Einar

On May 12, 2017, 6:26 PM +0100, Jean-Christophe Manciot notifications@github.com, wrote:

When I take a look at yang-explorer/requirements.txt, I notice:

• lxml==3.4.4: this is precisely the dependency explaining most warnings and errors according to @einarnn • pyang==1.6.0: is there a reason why you're putting a strong version constraint instead of using the latest (1.7.1) with >=1.6.0?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

rustogi commented 7 years ago

@einarnn @jean-christophe-manciot I agree that just allowing a folder would be better. But given the flash dependency of yang-explorer for any gui side changes, the preference would be to make such gui changes in the next (non-flash-based version) of yang explorer gui.

So in the meantime I was just trying to see if with no gui changes we could address @jean-christophe-manciot's use case.

So I created a directory and added some yang models and then added another sub-directory and added more yang models in it and was able to get all yang models uploaded by block selecting models in parent as well as sub-directories, all in one-shot. So just trying to confirm if that is a reasonable workaround till we can address gui changes.

@einarnn please chime is also if this is a reasonable course of action.

@jean-christophe-manciot could you point me to the openconfig directory that I should try this with.

Here is a snapshot of what I had tried.

screen shot 2017-05-15 at 11 19 55 am

screen shot 2017-05-15 at 11 20 21 am

jean-christophe-manciot commented 7 years ago

The official openconfig models are available here. On Ubuntu file manager, you don't have access at what is inside the folders, unless you navigate within them. This means you cannot make a mult-folder files selection. Regarding your upload trial, you have bundled beforehand a special group of models which is not found anywhere "as such". This bundle does not exist by default on the official site: if you try on a fresh install to upload all the models included within, for instance yang/vendor/cisco/xr/601, my guess is the upload will fail.

rustogi commented 7 years ago

@jean-christophe-manciot

Ok I will try these.

jean-christophe-manciot commented 7 years ago

@rustogi Another example of error when trying to upload on a freshly installed software (without any prior manually uploaded models) all default models shipped with yang-explorer from iana (no errors) then ietf (following error) from yang-explorer/v/share/yang/modules: upload error

From the CLI log:

INFO:explorer.views:Received sync request for ietf-inet-types@2013-07-15.yang, index 0
/home/actionmystique/Ansible/yang-explorer/v/bin/pyang
ERROR:root:invoke_compile: Compile Errors: ['Traceback (most recent call last):', '  File "/home/actionmystique/Ansible/yang-explorer/v/bin/pyang", line 420, in <module>', '    run()', '  File "/home/actionmystique/Ansible/yang-explorer/v/bin/pyang", line 290, in run', '    expect_failure_error=False)', '  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pyang/__init__.py", line 100, in add_module', '    module.i_adler32 = zlib.adler32(text)', "UnicodeEncodeError: 'ascii' codec can't encode characters in position 212-214: ordinal not in range(128)", '']

From the GUI log:

Traceback (most recent call last):
File "/home/actionmystique/Ansible/yang-explorer/v/bin/pyang", line 420, in <module>
run()
File "/home/actionmystique/Ansible/yang-explorer/v/bin/pyang", line 290, in run
expect_failure_error=False)
File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pyang/__init__.py", line 100, in add_module
module.i_adler32 = zlib.adler32(text)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 212-214: ordinal not in range(128)
jean-christophe-manciot commented 7 years ago

It seems that trying to upload a model which has already been uploaded by default blocks the whole process for other models which don't show up in the GUi, despite being shown as "uploaded" in the log.

jean-christophe-manciot commented 7 years ago

Other models shipped in yang-explorer/v/share/yang/modules which are not installed by default and trigger the same previous error are:

jean-christophe-manciot commented 7 years ago

I was able to finally find a way though the uploading process. Since it does not appear to be documented somewhere, this workaround should interest some users:

cisco models uploaded

jean-christophe-manciot commented 7 years ago

I am not able to upload any yang-models/vendor/cisco/nx/7.0-3-I5-* and yang-models/vendor/cisco/xr/612 models: they fail with error during compilation.

ruissalo commented 7 years ago

on OSX , compilation errors go away if pyang is upgraded to the latest version.

jean-christophe-manciot commented 7 years ago

Same compilation errors for NX-OS yang modules 7.0-3-I5-2/7.0-3-I6-1 with pyang 1.7.2 on Linux 4.10. @ruissalo What exact modules were you able to compile/upload?

ruissalo commented 7 years ago

I was able to upload and compile some openconfig modules (bgp, interfaces and system). Without upgrading to latest pyang version I was getting compilation errors

Aileen123456 commented 6 years ago

@ruissalo I encountered the compilation errors. How to upgrade pyang to the latest version? Thanks!

Aileen123456 commented 6 years ago

INFO:explorer.views:Received sync request for aaa@2016-01-24.yang, index 0 /opt/home/testmin/Downloads/yang-explorer/v/bin/pyang ERROR:root:invoke_compile: Compile Errors: ['Traceback (most recent call last):', ' File "/opt/home/testmin/Downloads/yang-explorer/v/bin/pyang", line 420, in ', ' run()', ' File "/opt/home/testmin/Downloads/yang-explorer/v/bin/pyang", line 290, in run', ' expect_failure_error=False)', ' File "/opt/home/testmin/Downloads/yang-explorer/v/lib/python2.7/site-packages/pyang/init.py", line 100, in add_module', ' module.i_adler32 = zlib.adler32(text)', "UnicodeEncodeError: 'ascii' codec can't encode characters in position 38647-38649: ordinal not in range(128)", ''] [19/Apr/2018 06:22:54]"GET /explorer/upload?mode=sync&index=0&file=aaa%402016%2D01%2D24%2Eyang HTTP/1.1" 200 775

Aileen123456 commented 6 years ago

failed

dplore commented 5 years ago

INFO:explorer.views:Received sync request for aaa@2016-01-24.yang, index 0 /opt/home/testmin/Downloads/yang-explorer/v/bin/pyang ERROR:root:invoke_compile: Compile Errors: ['Traceback (most recent call last):', ' File "/opt/home/testmin/Downloads/yang-explorer/v/bin/pyang", line 420, in ', ' run()', ' File "/opt/home/testmin/Downloads/yang-explorer/v/bin/pyang", line 290, in run', ' expect_failure_error=False)', ' File "/opt/home/testmin/Downloads/yang-explorer/v/lib/python2.7/site-packages/pyang/init.py", line 100, in add_module', ' module.i_adler32 = zlib.adler32(text)', "UnicodeEncodeError: 'ascii' codec can't encode characters in position 38647-38649: ordinal not in range(128)", ''] [19/Apr/2018 06:22:54]"GET /explorer/upload?mode=sync&index=0&file=aaa%402016%2D01%2D24%2Eyang HTTP/1.1" 200 775

Upgrade to pyang fixed this problem for me,

pip -U pyang
dplore commented 5 years ago

I am

Also, it would be so much more efficient to be able to indicate a folder to be recursively searched instead of *.yang models within a single folder. If you try to upload all openconfig models, you will feel the pain..

Did you find a solution to upload openconfig modules? Given the imports between folders, it doesn't seem possible right now.

einarnn commented 5 years ago

Easiest solution, sorry, workaround is to place all openconfig yang models in a single folder and upload from there.

Cheers,

Einar

dplore commented 5 years ago

Thanks, that worked for me!

On Fri, Jun 14, 2019 at 5:25 AM Einar Nilsen-Nygaard < notifications@github.com> wrote:

Easiest solution is to just place all openconfig yang models in a single folder and upload from there.

Cheers,

Einar

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/CiscoDevNet/yang-explorer/issues/60?email_source=notifications&email_token=ABMCGMY7BI6EAH4F74XT3NDP2OE2BA5CNFSM4DHWVVT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXWULJA#issuecomment-502089124, or mute the thread https://github.com/notifications/unsubscribe-auth/ABMCGM3DAMEEUZNPCIPGP6LP2OE2BANCNFSM4DHWVVTQ .

jabelk commented 5 years ago

was able to progress, made a fresh install on an ubuntu 14 vm, using python manage.py bulkupload --user guest --dir $HOME/oc_models/models/ with all the oc models in a single directory. though still getting errors and not seeing it show up in gui

(v) vagrant@vagrant:server (master)$ pip install -U pyang  lxml
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
/home/vagrant/yang-explorer/v/local/lib/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:354: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  SNIMissingWarning
/home/vagrant/yang-explorer/v/local/lib/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecurePlatformWarning
Collecting pyang
/home/vagrant/yang-explorer/v/local/lib/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecurePlatformWarning
  Downloading https://files.pythonhosted.org/packages/e8/49/355305b2f9588164e6b6a31e3f5fd597c287c1731692a9f3112766bf783d/pyang-2.0.1-py2.py3-none-any.whl (529kB)
     |████████████████████████████████| 532kB 1.1MB/s
Collecting lxml
  Downloading https://files.pythonhosted.org/packages/af/31/47cce58942bbf4b8f1c975ec2d1ab52141f7b7cf8cdecb58f25546d2c4fd/lxml-4.3.4-cp27-cp27mu-manylinux1_x86_64.whl (5.6MB)
     |████████████████████████████████| 5.6MB 11.8MB/s
Installing collected packages: lxml, pyang
  Found existing installation: lxml 3.4.4
    Uninstalling lxml-3.4.4:
      Successfully uninstalled lxml-3.4.4
  Found existing installation: pyang 1.6
    Uninstalling pyang-1.6:
      Successfully uninstalled pyang-1.6
Successfully installed lxml-4.3.4 pyang-2.0.1
(v) vagrant@vagrant:server (master)$ python manage.py bulkupload --user guest --dir $HOME/oc_models/models/
Local upload ..
Compiling : user: guest, file: /home/vagrant/yang-explorer/server/data/session/tmpxocHWq/openconfig-if-ip-ext.yang
DEBUG:root:Compiling session dependency ...
/home/vagrant/yang-explorer/v/bin/pyang
DEBUG:root:Rebuilding dependencies for user guest
DEBUG:root:invoke_compile: CMD: ['pyang', '-f', 'pyimport', '--plugindir', 'explorer/plugins', '-p', 'data/users/guest/yang:data/session/tmpxocHWq', 'data/users/guest/yang/ietf-netconf-monitoring@2010-10-04.yang', 'data/users/guest/yang/ietf-yang-types.yang', 'data/users/guest/yang/ietf-inet-types.yang', 'data/users/guest/yang/ietf-interfaces@2013-12-23.yang', 'data/users/guest/yang/iana-if-type@2014-01-15.yang', 'data/session/tmpxocHWq/openconfig-if-ip-ext.yang', 'data/session/tmpxocHWq/openconfig-pf-path-groups.yang', 'data/session/tmpxocHWq/openconfig-aaa-radius.yang', 'data/session/tmpxocHWq/openconfig-isis-policy.yang', 'data/session/tmpxocHWq/openconfig-isis-lsdb-types.yang', 'data/session/tmpxocHWq/openconfig-segment-routing.yang', 'data/session/tmpxocHWq/openconfig-types.yang', 'data/session/tmpxocHWq/openconfig-vlan-types.yang', 'data/session/tmpxocHWq/openconfig-fib-types.yang', 'data/session/tmpxocHWq/openconfig-mpls-ldp.yang', 'data/session/tmpxocHWq/openconfig-network-instance.yang', 'data/session/tmpxocHWq/openconfig-local-routing.yang', 'data/session/tmpxocHWq/openconfig-platform-types.yang', 'data/session/tmpxocHWq/openconfig-ospfv2-area-interface.yang', 'data/session/tmpxocHWq/openconfig-procmon.yang', 'data/session/tmpxocHWq/openconfig-rpc-types.yang', 'data/session/tmpxocHWq/openconfig-rib-bgp.yang', 'data/session/tmpxocHWq/openconfig-ospfv2-area.yang', 'data/session/tmpxocHWq/openconfig-mpls-sr.yang', 'data/session/tmpxocHWq/openconfig-system-logging.yang', 'data/session/tmpxocHWq/openconfig-ospfv2-global.yang', 'data/session/tmpxocHWq/openconfig-aaa-types.yang', 'data/session/tmpxocHWq/openconfig-ospf-policy.yang', 'data/session/tmpxocHWq/openconfig-yang-types.yang', 'data/session/tmpxocHWq/openconfig-rpc.yang', 'data/session/tmpxocHWq/openconfig-catalog-types.yang', 'data/session/tmpxocHWq/openconfig-optical-amplifier.yang', 'data/session/tmpxocHWq/openconfig-vlan.yang', 'data/session/tmpxocHWq/openconfig-fib.yang', 'data/session/tmpxocHWq/openconfig-wavelength-router.yang', 'data/session/tmpxocHWq/openconfig-telemetry.yang', 'data/session/tmpxocHWq/openconfig-bgp-types.yang', 'data/session/tmpxocHWq/openconfig-bgp-peer-group.yang', 'data/session/tmpxocHWq/openconfig-rib-bgp-ext.yang', 'data/session/tmpxocHWq/openconfig-lldp.yang', 'data/session/tmpxocHWq/openconfig-ospf-types.yang', 'data/session/tmpxocHWq/openconfig-policy-types.yang', 'data/session/tmpxocHWq/openconfig-terminal-device.yang', 'data/session/tmpxocHWq/openconfig-platform.yang', 'data/session/tmpxocHWq/openconfig-aaa.yang', 'data/session/tmpxocHWq/openconfig-bgp-common.yang', 'data/session/tmpxocHWq/openconfig-transport-types.yang', 'data/session/tmpxocHWq/openconfig-mpls-te.yang', 'data/session/tmpxocHWq/openconfig-if-aggregate.yang', 'data/session/tmpxocHWq/openconfig-spanning-tree-types.yang', 'data/session/tmpxocHWq/openconfig-isis-lsp.yang', 'data/session/tmpxocHWq/openconfig-rib-bgp-types.yang', 'data/session/tmpxocHWq/openconfig-module-catalog.yang', 'data/session/tmpxocHWq/openconfig-lldp-types.yang', 'data/session/tmpxocHWq/openconfig-transport-line-common.yang', 'data/session/tmpxocHWq/openconfig-inet-types.yang', 'data/session/tmpxocHWq/openconfig-acl.yang', 'data/session/tmpxocHWq/openconfig-isis.yang', 'data/session/tmpxocHWq/openconfig-isis-types.yang', 'data/session/tmpxocHWq/openconfig-mpls-rsvp.yang', 'data/session/tmpxocHWq/openconfig-bgp-neighbor.yang', 'data/session/tmpxocHWq/openconfig-network-instance-types.yang', 'data/session/tmpxocHWq/openconfig-policy-forwarding.yang', 'data/session/tmpxocHWq/openconfig-mpls-static.yang', 'data/session/tmpxocHWq/openconfig-mpls-types.yang', 'data/session/tmpxocHWq/openconfig-if-ethernet.yang', 'data/session/tmpxocHWq/openconfig-bgp-policy.yang', 'data/session/tmpxocHWq/openconfig-bgp-global.yang', 'data/session/tmpxocHWq/openconfig-packet-match.yang', 'data/session/tmpxocHWq/openconfig-if-ip.yang', 'data/session/tmpxocHWq/openconfig-isis-routing.yang', 'data/session/tmpxocHWq/openconfig-mpls-igp.yang', 'data/session/tmpxocHWq/openconfig-bgp-common-multiprotocol.yang', 'data/session/tmpxocHWq/openconfig-system-terminal.yang', 'data/session/tmpxocHWq/openconfig-routing-policy.yang', 'data/session/tmpxocHWq/openconfig-ospfv2-common.yang', 'data/session/tmpxocHWq/openconfig-spanning-tree.yang', 'data/session/tmpxocHWq/openconfig-network-instance-l2.yang', 'data/session/tmpxocHWq/openconfig-bgp-common-structure.yang', 'data/session/tmpxocHWq/openconfig-ospfv2.yang', 'data/session/tmpxocHWq/openconfig-bgp.yang', 'data/session/tmpxocHWq/openconfig-network-instance-l3.yang', 'data/session/tmpxocHWq/openconfig-platform-transceiver.yang', 'data/session/tmpxocHWq/openconfig-aft.yang', 'data/session/tmpxocHWq/openconfig-mpls.yang', 'data/session/tmpxocHWq/openconfig-aft-network-instance.yang', 'data/session/tmpxocHWq/openconfig-pf-forwarding-policies.yang', 'data/session/tmpxocHWq/openconfig-pf-interfaces.yang', 'data/session/tmpxocHWq/openconfig-aaa-tacacs.yang', 'data/session/tmpxocHWq/openconfig-aft-types.yang', 'data/session/tmpxocHWq/openconfig-lacp.yang', 'data/session/tmpxocHWq/openconfig-relay-agent.yang', 'data/session/tmpxocHWq/openconfig-ospfv2-lsdb.yang', 'data/session/tmpxocHWq/openconfig-interfaces.yang', 'data/session/tmpxocHWq/openconfig-system.yang', 'data/session/tmpxocHWq/openconfig-extensions.yang', 'data/session/tmpxocHWq/openconfig-packet-match-types.yang']
ERROR:root:invoke_compile: Compile Errors: ['data/session/tmpxocHWq/openconfig-bgp-policy.yang:1170 (at data/session/tmpxocHWq/openconfig-bgp-policy.yang:791): warning: node "openconfig-bgp-policy::INLINE" is not found in "openconfig-bgp-policy::inline"', 'data/session/tmpxocHWq/openconfig-bgp-policy.yang:1170 (at data/session/tmpxocHWq/openconfig-bgp-policy.yang:850): warning: node "openconfig-bgp-policy::REFERENCE" is not found in "openconfig-bgp-policy::reference"', 'data/session/tmpxocHWq/openconfig-bgp-policy.yang:1170 (at data/session/tmpxocHWq/openconfig-bgp-policy.yang:954): warning: node "openconfig-bgp-policy::INLINE" is not found in "openconfig-bgp-policy::inline"', 'data/session/tmpxocHWq/openconfig-bgp-policy.yang:1170 (at data/session/tmpxocHWq/openconfig-bgp-policy.yang:1015): warning: node "openconfig-bgp-policy::REFERENCE" is not found in "openconfig-bgp-policy::reference"', 'data/session/tmpxocHWq/openconfig-fib-types.yang:3: error: duplicate namespace uri "http://openconfig.net/yang/fib-types" found in module "openconfig-aft-types"', 'data/session/tmpxocHWq/openconfig-if-aggregate.yang:163 (at data/session/tmpxocHWq/openconfig-if-aggregate.yang:95): warning: node "openconfig-if-aggregate::lag-type" is not found in "openconfig-if-aggregate::member"', 'data/session/tmpxocHWq/openconfig-if-aggregate.yang:158: warning: node "openconfig-interfaces::type" is not found in "openconfig-interfaces::interface"', 'data/session/tmpxocHWq/openconfig-if-aggregate.yang:168: warning: node "openconfig-interfaces::type" is not found in "openconfig-if-ethernet::config"', 'data/session/tmpxocHWq/openconfig-if-aggregate.yang:179: warning: node "openconfig-interfaces::type" is not found in "openconfig-if-ethernet::state"', 'data/session/tmpxocHWq/openconfig-isis-types.yang:271: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-isis-types.yang:271: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-isis-types.yang:280: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-isis-types.yang:280: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-isis-types.yang:288: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-isis-types.yang:288: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:303): warning: node "openconfig-network-instance::auth-type" is not found in "openconfig-network-instance::config"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:303): warning: node "openconfig-network-instance::KEY" is not found in "openconfig-network-instance::auth-password"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:313): warning: node "openconfig-network-instance::auth-type" is not found in "openconfig-network-instance::state"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:313): warning: node "openconfig-network-instance::KEY" is not found in "openconfig-network-instance::auth-password"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:319): warning: node "openconfig-network-instance::auth-type" is not found in "openconfig-network-instance::authentication"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:319): warning: node "openconfig-network-instance::KEY_CHAIN" is not found in "openconfig-network-instance::keychain"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:370): warning: node "openconfig-network-instance::auth-type" is not found in "openconfig-network-instance::config"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:370): warning: node "openconfig-network-instance::KEY" is not found in "openconfig-network-instance::auth-password"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:380): warning: node "openconfig-network-instance::auth-type" is not found in "openconfig-network-instance::state"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:380): warning: node "openconfig-network-instance::KEY" is not found in "openconfig-network-instance::auth-password"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:386): warning: node "openconfig-network-instance::auth-type" is not found in "openconfig-network-instance::authentication"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:386): warning: node "openconfig-network-instance::KEY_CHAIN" is not found in "openconfig-network-instance::keychain"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:386): warning: node "openconfig-network-instance::auth-type" is not found in "openconfig-network-instance::hello-authentication"', 'data/session/tmpxocHWq/openconfig-mpls.yang:684 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:486): warning: node "openconfig-mpls::tunnel" is not found in "openconfig-mpls::constrained-path"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:486): warning: node "openconfig-network-instance::mpls" is not found in module "openconfig-network-instance"', 'data/session/tmpxocHWq/openconfig-mpls.yang:684 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:497): warning: node "openconfig-mpls::tunnel" is not found in "openconfig-mpls::constrained-path"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:497): warning: node "openconfig-network-instance::mpls" is not found in module "openconfig-network-instance"', 'data/session/tmpxocHWq/openconfig-mpls.yang:684 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:516): warning: node "openconfig-mpls::tunnel" is not found in "openconfig-mpls::constrained-path"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:516): warning: node "openconfig-network-instance::mpls" is not found in module "openconfig-network-instance"', 'data/session/tmpxocHWq/openconfig-mpls.yang:684 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:534): warning: node "openconfig-mpls::tunnel" is not found in "openconfig-mpls::constrained-path"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:534): warning: node "openconfig-network-instance::mpls" is not found in module "openconfig-network-instance"', 'data/session/tmpxocHWq/openconfig-mpls.yang:684 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:559): warning: node "openconfig-mpls::tunnel" is not found in "openconfig-mpls::constrained-path"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:559): warning: node "openconfig-network-instance::mpls" is not found in module "openconfig-network-instance"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-network-instance.yang:150): warning: node "openconfig-network-instance::type" is not found in "openconfig-network-instance::network-instance"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-network-instance.yang:196): warning: node "openconfig-network-instance::type" is not found in "openconfig-network-instance::network-instance"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-network-instance.yang:214): warning: node "openconfig-network-instance::type" is not found in "openconfig-network-instance::network-instance"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-network-instance.yang:438): warning: node "openconfig-network-instance::type" is not found in "openconfig-network-instance::config"', 'data/session/tmpxocHWq/openconfig-packet-match-types.yang:238: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-packet-match-types.yang:238: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-packet-match.yang:130): warning: node "openconfig-network-instance::ip-version" is not found in "openconfig-network-instance::source-ip-flow-label"', 'data/session/tmpxocHWq/openconfig-acl.yang:713 (at data/session/tmpxocHWq/openconfig-packet-match.yang:130): warning: node "openconfig-acl::ip-version" is not found in "openconfig-acl::source-ip-flow-label"', 'data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-packet-match.yang:143): warning: node "openconfig-network-instance::ip-version" is not found in "openconfig-network-instance::destination-ip-flow-label"', 'data/session/tmpxocHWq/openconfig-acl.yang:713 (at data/session/tmpxocHWq/openconfig-packet-match.yang:143): warning: node "openconfig-acl::ip-version" is not found in "openconfig-acl::destination-ip-flow-label"', 'data/session/tmpxocHWq/openconfig-telemetry.yang:741: error: restriction "require-instance" not allowed for this base type', 'data/session/tmpxocHWq/openconfig-terminal-device.yang:1110 (at data/session/tmpxocHWq/openconfig-terminal-device.yang:815): warning: node "openconfig-terminal-device::logical-channel-type" is not found in "openconfig-terminal-device::config"', 'data/session/tmpxocHWq/openconfig-terminal-device.yang:1110 (at data/session/tmpxocHWq/openconfig-terminal-device.yang:822): warning: node "openconfig-terminal-device::logical-channel-type" is not found in "openconfig-terminal-device::config"', 'data/session/tmpxocHWq/openconfig-transport-line-common.yang:186: warning: node "openconfig-platform::PORT" is not found in "openconfig-platform::component"', 'data/session/tmpxocHWq/openconfig-transport-line-common.yang:197: warning: node "openconfig-interfaces::type" is not found in "openconfig-interfaces::interface"', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:84: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:84: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:100: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:100: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:102: warning: the escape sequence "\\*" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:102: warning: the escape sequence "\\*" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:121: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:121: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:123: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:123: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:125: warning: the escape sequence "\\*" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:125: warning: the escape sequence "\\*" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:130: warning: the escape sequence "\\*" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:130: warning: the escape sequence "\\*" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:131: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:131: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:133: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan-types.yang:133: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-vlan.yang:376 (at data/session/tmpxocHWq/openconfig-vlan.yang:116): warning: node "openconfig-vlan::interface-mode" is not found in "openconfig-vlan::native-vlan"', 'data/session/tmpxocHWq/openconfig-vlan.yang:376 (at data/session/tmpxocHWq/openconfig-vlan.yang:131): warning: node "openconfig-vlan::interface-mode" is not found in "openconfig-vlan::access-vlan"', 'data/session/tmpxocHWq/openconfig-vlan.yang:376 (at data/session/tmpxocHWq/openconfig-vlan.yang:144): warning: node "openconfig-vlan::interface-mode" is not found in "openconfig-vlan::trunk-vlans"', 'data/session/tmpxocHWq/openconfig-vlan.yang:370: warning: node "openconfig-interfaces::type" is not found in "openconfig-if-ethernet::ethernet"', 'data/session/tmpxocHWq/openconfig-vlan.yang:382: warning: node "openconfig-interfaces::type" is not found in "openconfig-if-aggregate::aggregation"', 'data/session/tmpxocHWq/openconfig-vlan.yang:391: warning: node "openconfig-interfaces::type" is not found in "openconfig-interfaces::interface"', 'data/session/tmpxocHWq/openconfig-yang-types.yang:78: warning: the escape sequence "\\-" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-yang-types.yang:78: warning: the escape sequence "\\-" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-yang-types.yang:79: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', 'data/session/tmpxocHWq/openconfig-yang-types.yang:79: warning: the escape sequence "\\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning', '']
Compilation Failed: <messages><message>data/session/tmpxocHWq/openconfig-bgp-policy.yang:1170 (at data/session/tmpxocHWq/openconfig-bgp-policy.yang:791): warning: node "openconfig-bgp-policy::INLINE" is not found in "openconfig-bgp-policy::inline"</message><message>data/session/tmpxocHWq/openconfig-bgp-policy.yang:1170 (at data/session/tmpxocHWq/openconfig-bgp-policy.yang:850): warning: node "openconfig-bgp-policy::REFERENCE" is not found in "openconfig-bgp-policy::reference"</message><message>data/session/tmpxocHWq/openconfig-bgp-policy.yang:1170 (at data/session/tmpxocHWq/openconfig-bgp-policy.yang:954): warning: node "openconfig-bgp-policy::INLINE" is not found in "openconfig-bgp-policy::inline"</message><message>data/session/tmpxocHWq/openconfig-bgp-policy.yang:1170 (at data/session/tmpxocHWq/openconfig-bgp-policy.yang:1015): warning: node "openconfig-bgp-policy::REFERENCE" is not found in "openconfig-bgp-policy::reference"</message><message>data/session/tmpxocHWq/openconfig-fib-types.yang:3: error: duplicate namespace uri "http://openconfig.net/yang/fib-types" found in module "openconfig-aft-types"</message><message>data/session/tmpxocHWq/openconfig-if-aggregate.yang:163 (at data/session/tmpxocHWq/openconfig-if-aggregate.yang:95): warning: node "openconfig-if-aggregate::lag-type" is not found in "openconfig-if-aggregate::member"</message><message>data/session/tmpxocHWq/openconfig-if-aggregate.yang:158: warning: node "openconfig-interfaces::type" is not found in "openconfig-interfaces::interface"</message><message>data/session/tmpxocHWq/openconfig-if-aggregate.yang:168: warning: node "openconfig-interfaces::type" is not found in "openconfig-if-ethernet::config"</message><message>data/session/tmpxocHWq/openconfig-if-aggregate.yang:179: warning: node "openconfig-interfaces::type" is not found in "openconfig-if-ethernet::state"</message><message>data/session/tmpxocHWq/openconfig-isis-types.yang:271: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-isis-types.yang:271: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-isis-types.yang:280: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-isis-types.yang:280: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-isis-types.yang:288: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-isis-types.yang:288: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:303): warning: node "openconfig-network-instance::auth-type" is not found in "openconfig-network-instance::config"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:303): warning: node "openconfig-network-instance::KEY" is not found in "openconfig-network-instance::auth-password"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:313): warning: node "openconfig-network-instance::auth-type" is not found in "openconfig-network-instance::state"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:313): warning: node "openconfig-network-instance::KEY" is not found in "openconfig-network-instance::auth-password"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:319): warning: node "openconfig-network-instance::auth-type" is not found in "openconfig-network-instance::authentication"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:319): warning: node "openconfig-network-instance::KEY_CHAIN" is not found in "openconfig-network-instance::keychain"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:370): warning: node "openconfig-network-instance::auth-type" is not found in "openconfig-network-instance::config"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:370): warning: node "openconfig-network-instance::KEY" is not found in "openconfig-network-instance::auth-password"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:380): warning: node "openconfig-network-instance::auth-type" is not found in "openconfig-network-instance::state"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:380): warning: node "openconfig-network-instance::KEY" is not found in "openconfig-network-instance::auth-password"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:386): warning: node "openconfig-network-instance::auth-type" is not found in "openconfig-network-instance::authentication"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:386): warning: node "openconfig-network-instance::KEY_CHAIN" is not found in "openconfig-network-instance::keychain"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-isis.yang:386): warning: node "openconfig-network-instance::auth-type" is not found in "openconfig-network-instance::hello-authentication"</message><message>data/session/tmpxocHWq/openconfig-mpls.yang:684 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:486): warning: node "openconfig-mpls::tunnel" is not found in "openconfig-mpls::constrained-path"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:486): warning: node "openconfig-network-instance::mpls" is not found in module "openconfig-network-instance"</message><message>data/session/tmpxocHWq/openconfig-mpls.yang:684 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:497): warning: node "openconfig-mpls::tunnel" is not found in "openconfig-mpls::constrained-path"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:497): warning: node "openconfig-network-instance::mpls" is not found in module "openconfig-network-instance"</message><message>data/session/tmpxocHWq/openconfig-mpls.yang:684 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:516): warning: node "openconfig-mpls::tunnel" is not found in "openconfig-mpls::constrained-path"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:516): warning: node "openconfig-network-instance::mpls" is not found in module "openconfig-network-instance"</message><message>data/session/tmpxocHWq/openconfig-mpls.yang:684 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:534): warning: node "openconfig-mpls::tunnel" is not found in "openconfig-mpls::constrained-path"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:534): warning: node "openconfig-network-instance::mpls" is not found in module "openconfig-network-instance"</message><message>data/session/tmpxocHWq/openconfig-mpls.yang:684 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:559): warning: node "openconfig-mpls::tunnel" is not found in "openconfig-mpls::constrained-path"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-mpls-rsvp.yang:559): warning: node "openconfig-network-instance::mpls" is not found in module "openconfig-network-instance"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-network-instance.yang:150): warning: node "openconfig-network-instance::type" is not found in "openconfig-network-instance::network-instance"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-network-instance.yang:196): warning: node "openconfig-network-instance::type" is not found in "openconfig-network-instance::network-instance"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-network-instance.yang:214): warning: node "openconfig-network-instance::type" is not found in "openconfig-network-instance::network-instance"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-network-instance.yang:438): warning: node "openconfig-network-instance::type" is not found in "openconfig-network-instance::config"</message><message>data/session/tmpxocHWq/openconfig-packet-match-types.yang:238: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-packet-match-types.yang:238: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-packet-match.yang:130): warning: node "openconfig-network-instance::ip-version" is not found in "openconfig-network-instance::source-ip-flow-label"</message><message>data/session/tmpxocHWq/openconfig-acl.yang:713 (at data/session/tmpxocHWq/openconfig-packet-match.yang:130): warning: node "openconfig-acl::ip-version" is not found in "openconfig-acl::source-ip-flow-label"</message><message>data/session/tmpxocHWq/openconfig-network-instance.yang:1024 (at data/session/tmpxocHWq/openconfig-packet-match.yang:143): warning: node "openconfig-network-instance::ip-version" is not found in "openconfig-network-instance::destination-ip-flow-label"</message><message>data/session/tmpxocHWq/openconfig-acl.yang:713 (at data/session/tmpxocHWq/openconfig-packet-match.yang:143): warning: node "openconfig-acl::ip-version" is not found in "openconfig-acl::destination-ip-flow-label"</message><message>data/session/tmpxocHWq/openconfig-telemetry.yang:741: error: restriction "require-instance" not allowed for this base type</message><message>data/session/tmpxocHWq/openconfig-terminal-device.yang:1110 (at data/session/tmpxocHWq/openconfig-terminal-device.yang:815): warning: node "openconfig-terminal-device::logical-channel-type" is not found in "openconfig-terminal-device::config"</message><message>data/session/tmpxocHWq/openconfig-terminal-device.yang:1110 (at data/session/tmpxocHWq/openconfig-terminal-device.yang:822): warning: node "openconfig-terminal-device::logical-channel-type" is not found in "openconfig-terminal-device::config"</message><message>data/session/tmpxocHWq/openconfig-transport-line-common.yang:186: warning: node "openconfig-platform::PORT" is not found in "openconfig-platform::component"</message><message>data/session/tmpxocHWq/openconfig-transport-line-common.yang:197: warning: node "openconfig-interfaces::type" is not found in "openconfig-interfaces::interface"</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:84: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:84: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:100: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:100: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:102: warning: the escape sequence "\*" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:102: warning: the escape sequence "\*" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:121: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:121: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:123: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:123: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:125: warning: the escape sequence "\*" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:125: warning: the escape sequence "\*" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:130: warning: the escape sequence "\*" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:130: warning: the escape sequence "\*" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:131: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:131: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:133: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan-types.yang:133: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-vlan.yang:376 (at data/session/tmpxocHWq/openconfig-vlan.yang:116): warning: node "openconfig-vlan::interface-mode" is not found in "openconfig-vlan::native-vlan"</message><message>data/session/tmpxocHWq/openconfig-vlan.yang:376 (at data/session/tmpxocHWq/openconfig-vlan.yang:131): warning: node "openconfig-vlan::interface-mode" is not found in "openconfig-vlan::access-vlan"</message><message>data/session/tmpxocHWq/openconfig-vlan.yang:376 (at data/session/tmpxocHWq/openconfig-vlan.yang:144): warning: node "openconfig-vlan::interface-mode" is not found in "openconfig-vlan::trunk-vlans"</message><message>data/session/tmpxocHWq/openconfig-vlan.yang:370: warning: node "openconfig-interfaces::type" is not found in "openconfig-if-ethernet::ethernet"</message><message>data/session/tmpxocHWq/openconfig-vlan.yang:382: warning: node "openconfig-interfaces::type" is not found in "openconfig-if-aggregate::aggregation"</message><message>data/session/tmpxocHWq/openconfig-vlan.yang:391: warning: node "openconfig-interfaces::type" is not found in "openconfig-interfaces::interface"</message><message>data/session/tmpxocHWq/openconfig-yang-types.yang:78: warning: the escape sequence "\-" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-yang-types.yang:78: warning: the escape sequence "\-" is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-yang-types.yang:79: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message>data/session/tmpxocHWq/openconfig-yang-types.yang:79: warning: the escape sequence "\." is unsafe in double quoted strings - pass the flag --lax-quote-checks to avoid this warning</message><message></message></messages>
Cleaning up /home/vagrant/yang-explorer/server/data/session/tmpxocHWq
(v) vagrant@vagrant:server (master)$
(v) vagrant@vagrant:server (master)$ pyang --version
pyang 2.0.1
(v) vagrant@vagrant:server (master)$ python --version
Python 2.7.6
(v) vagrant@vagrant:server (master)$
jabelk commented 5 years ago

I have been able to solve my problem by updating the bashrc with export YANG_MODPATH=$HOME/yang/modules and putting all the openconfig modules in there with no sub-directories. So when I upload it in the GUI, pyang picks up the modules dependent on each other, otherwise was going into dependency hell trying to upload modules. note I found the following oc modules to still fail, so just have ignored them: openconfig-fib-types openconfig-telemetry openconfig-aft-types

einarnn commented 5 years ago

Glad you have found a workaround!