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

Removing explicit libyang plugin path settings #4144

Merged
merged 1 commit into from
Feb 13, 2020

Conversation

dutta-partha
Copy link
Contributor

@dutta-partha dutta-partha commented Feb 13, 2020

- What I did
Fixes #4059

- How I did it
Removed explicit libyang plugin path settings in rest-server.sh file which starts the REST server.

Libyang debian package installs the extensions in standard location as per build time configuration (install prefix is set in patch/libyang.patch). If plugin directory is not set, libyang explicitly searches the plugins in LYEXT_PLUGINS_DIR which is populated during build. The plugins are installed in LYEXT_PLUGINS_DIR itself through debian package installation.

$ grep -nr LYEXT_PLUGINS_DIR src/
src/plugin_config.h.in:18:#define LYEXT_PLUGINS_DIR "@EXTENSIONS_PLUGINS_DIR_MACRO@" /**< directory with YANG extension plugins */
src/plugins.c:420: pluginsdir = LYEXT_PLUGINS_DIR;

- How to verify it
Once system is ready, just check REST server is able to serve REST API request. Alternatively, just change some configuration using KLISH based sonic-cli and it should be successfully changed. sonic-cli calls REST server internally.

- Description for the changelog

Removed explicit path settings for libyang extension and user types plugins.

- A picture of a cute animal (not mandatory but encouraged)

Removing explicit libyang plugin path settings. Libyang debian package installs the extensions in standard location.
@dutta-partha dutta-partha changed the title Removing explicit libyang plugin path settings Removing explicit libyang plugin path settings [request for 201911 branch] Feb 13, 2020
@dutta-partha dutta-partha changed the title Removing explicit libyang plugin path settings [request for 201911 branch] Removing explicit libyang plugin path settings Feb 13, 2020
@lguohan
Copy link
Collaborator

lguohan commented Feb 13, 2020

retest vsimage please

@lguohan
Copy link
Collaborator

lguohan commented Feb 13, 2020

retest baseimage please

@lguohan lguohan merged commit 2cfdb28 into sonic-net:master Feb 13, 2020
@stephenxs
Copy link
Collaborator

Hi @lguohan,
Could you please add the label "request for 201911"? We also see the issue on 201911.
Thanks.

stepanblyschak pushed a commit to stepanblyschak/sonic-buildimage that referenced this pull request Feb 26, 2020
…ic-net#4144)

Removing explicit libyang plugin path settings. Libyang debian package installs the extensions in standard location.

Libyang debian package installs the extensions in standard location as per build time configuration (install prefix is set in patch/libyang.patch). If plugin directory is not set, libyang explicitly searches the plugins in LYEXT_PLUGINS_DIR which is populated during build. The plugins are installed in LYEXT_PLUGINS_DIR itself through debian package installation.

$ grep -nr LYEXT_PLUGINS_DIR src/
src/plugin_config.h.in:18:#define LYEXT_PLUGINS_DIR "@EXTENSIONS_PLUGINS_DIR_MACRO@" /**< directory with YANG extension plugins */
src/plugins.c:420: pluginsdir = LYEXT_PLUGINS_DIR;
@shaoshouping
Copy link

works!!

@nazariig
Copy link
Collaborator

@lguohan / @yxieca please help to include to 201911

Mar 18 11:02:51.857290 sonic INFO mgmt-framework#supervisord: rest-server REST_SERVER_ARGS = -ui /rest_ui -logtostderr -cert /etc/sonic/telemetry/streamingtelemetryserver.cer -key /etc/sonic/telemetry/streamingtelemetryserver.key -cacert /etc/sonic/telemetry/dsmsroot.cer
Mar 18 11:02:51.867525 sonic INFO mgmt-framework#supervisord: rest-server ERROR: logging before flag.Parse: I0318 11:02:51.866726      61 util.go:161] Current Values of CVL Configuration File map[TRACE_CREATE:false __comment3__:Display log upto INFO level SKIP_SEMANTIC_VALIDATION:false TRACE_YPARSER:false TRACE_DELETE:false TRACE_CACHE:false __comment1__:Log trace data when error occurs TRACE_ONERROR:true LOGTOSTDERR:false VERBOSITY:0 SKIP_VALIDATION:false TRACE_UPDATE:false TRACE_SEMANTIC:false TRACE_SYNTAX:false __comment2__:Set LOGTOSTDER to 'true' to log on standard error STDERRTHRESHOLD:ERROR __comment4__:Display log upto INFO level 8 TRACE_LIBYANG:false]
Mar 18 11:02:51.867754 sonic INFO mgmt-framework#supervisord: rest-server ERROR: logging before flag.Parse: I0318 11:02:51.866954      61 util.go:161] Current Values of CVL Configuration File map[__comment1__:Log trace data when error occurs TRACE_ONERROR:true LOGTOSTDERR:false VERBOSITY:0 SKIP_VALIDATION:false TRACE_UPDATE:false TRACE_SEMANTIC:false TRACE_SYNTAX:false __comment2__:Set LOGTOSTDER to 'true' to log on standard error STDERRTHRESHOLD:ERROR __comment4__:Display log upto INFO level 8 TRACE_LIBYANG:false TRACE_CREATE:false __comment3__:Display log upto INFO level SKIP_SEMANTIC_VALIDATION:false TRACE_YPARSER:false TRACE_DELETE:false TRACE_CACHE:false]
Mar 18 11:02:51.869099 sonic INFO mgmt-framework#supervisord: rest-server libyang[1]: Failed to open libyang extensions plugins directory "/usr/lib/x86_64-linux-gnu/libyang/extensions" (No such file or directory).
Mar 18 11:02:51.869446 sonic INFO mgmt-framework#supervisord: rest-server libyang[1]: Failed to open libyang user types plugins directory "/usr/lib/x86_64-linux-gnu/libyang/user_types" (No such file or directory).
Mar 18 11:02:51.871062 sonic INFO mgmt-framework#supervisord: rest-server libyang[0]: Invalid keyword "type" as a child to "annotation". (path: /)
Mar 18 11:02:51.871062 sonic INFO mgmt-framework#supervisord: rest-server libyang[0]: Module "yang" parsing failed.
Mar 18 11:02:51.871986 sonic INFO mgmt-framework#supervisord: rest-server libyang[0]: Invalid arguments (lys_parse_path()).
Mar 18 11:02:51.871986 sonic INFO mgmt-framework#supervisord: rest-server ERROR: logging before flag.Parse: F0318 11:02:51.871391      61 util.go:167] Unable to parse schema file sonic-acl-deviation.yin
Mar 18 11:02:51.871986 sonic INFO mgmt-framework#supervisord: rest-server goroutine 1 [running, locked to thread]:
Mar 18 11:02:51.872620 sonic INFO mgmt-framework#supervisord: rest-server github.com/golang/glog.stacks(0xc0000a8000, 0x0, 0x0, 0x0)
Mar 18 11:02:51.872620 sonic INFO mgmt-framework#supervisord: rest-server #011/sonic/src/sonic-mgmt-framework/gopkgs/src/github.com/golang/glog/glog.go:769 +0xf6
Mar 18 11:02:51.872620 sonic INFO mgmt-framework#supervisord: rest-server github.com/golang/glog.(*loggingT).output(0x1d0d940, 0x3, 0xc0001a4160, 0x19fef6b, 0x7, 0xa7, 0x0)
Mar 18 11:02:51.872620 sonic INFO mgmt-framework#supervisord: rest-server #011/sonic/src/sonic-mgmt-framework/gopkgs/src/github.com/golang/glog/glog.go:720 +0x406
Mar 18 11:02:51.872620 sonic INFO mgmt-framework#supervisord: rest-server github.com/golang/glog.(*loggingT).printf(0x1d0d940, 0x3, 0xc00003c300, 0x33, 0x0, 0x0, 0x0)
Mar 18 11:02:51.872654 sonic INFO mgmt-framework#supervisord: rest-server #011/sonic/src/sonic-mgmt-framework/gopkgs/src/github.com/golang/glog/glog.go:655 +0x207
Mar 18 11:02:51.872654 sonic INFO mgmt-framework#supervisord: rest-server github.com/golang/glog.Fatalf(0xc00003c300, 0x33, 0x0, 0x0, 0x0)
Mar 18 11:02:51.872676 sonic INFO mgmt-framework#supervisord: rest-server #011/sonic/src/sonic-mgmt-framework/gopkgs/src/github.com/golang/glog/glog.go:1148 +0x67
Mar 18 11:02:51.872676 sonic INFO mgmt-framework#supervisord: rest-server cvl/internal/util.CVL_LEVEL_LOG(0x303, 0xc00003c300, 0x33, 0x0, 0x0, 0x0)
Mar 18 11:02:51.872676 sonic INFO mgmt-framework#supervisord: rest-server #011/sonic/src/sonic-mgmt-framework/src/cvl/internal/util/util.go:167 +0x14d
Mar 18 11:02:51.872696 sonic INFO mgmt-framework#supervisord: rest-server cvl.CVL_LOG(0x111d103, 0xc00003c300, 0x33, 0x0, 0x0, 0x0)
Mar 18 11:02:51.872817 sonic INFO mgmt-framework#supervisord: rest-server #011/sonic/src/sonic-mgmt-framework/src/cvl/cvl.go:154 +0x5c
Mar 18 11:02:51.872817 sonic INFO mgmt-framework#supervisord: rest-server cvl.Initialize(0x0)
Mar 18 11:02:51.872817 sonic INFO mgmt-framework#supervisord: rest-server #011/sonic/src/sonic-mgmt-framework/src/cvl/cvl_api.go:139 +0x9fa
Mar 18 11:02:51.872817 sonic INFO mgmt-framework#supervisord: rest-server cvl.init.0()
Mar 18 11:02:51.872817 sonic INFO mgmt-framework#supervisord: rest-server #011/sonic/src/sonic-mgmt-framework/src/cvl/cvl.go:187 +0x436

@nazariig
Copy link
Collaborator

@dutta-partha do we need some special changes for 201911 or we can take this as is?

abdosi pushed a commit that referenced this pull request Mar 20, 2020
Removing explicit libyang plugin path settings. Libyang debian package installs the extensions in standard location.

Libyang debian package installs the extensions in standard location as per build time configuration (install prefix is set in patch/libyang.patch). If plugin directory is not set, libyang explicitly searches the plugins in LYEXT_PLUGINS_DIR which is populated during build. The plugins are installed in LYEXT_PLUGINS_DIR itself through debian package installation.

$ grep -nr LYEXT_PLUGINS_DIR src/
src/plugin_config.h.in:18:#define LYEXT_PLUGINS_DIR "@EXTENSIONS_PLUGINS_DIR_MACRO@" /**< directory with YANG extension plugins */
src/plugins.c:420: pluginsdir = LYEXT_PLUGINS_DIR;
tiantianlv pushed a commit to SONIC-DEV/sonic-buildimage that referenced this pull request Apr 24, 2020
…ic-net#4144)

Removing explicit libyang plugin path settings. Libyang debian package installs the extensions in standard location.

Libyang debian package installs the extensions in standard location as per build time configuration (install prefix is set in patch/libyang.patch). If plugin directory is not set, libyang explicitly searches the plugins in LYEXT_PLUGINS_DIR which is populated during build. The plugins are installed in LYEXT_PLUGINS_DIR itself through debian package installation.

$ grep -nr LYEXT_PLUGINS_DIR src/
src/plugin_config.h.in:18:#define LYEXT_PLUGINS_DIR "@EXTENSIONS_PLUGINS_DIR_MACRO@" /**< directory with YANG extension plugins */
src/plugins.c:420: pluginsdir = LYEXT_PLUGINS_DIR;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[mgmt-framework]: unable to parse schema file sonic-acl-deviation.yin
6 participants