Giter Site home page Giter Site logo

Comments (11)

olofhagsand avatar olofhagsand commented on August 29, 2024 1

Bad gateway is (typically) if there is no fastcgi program accessible from nginx, in this case the clixon_restconf daemon.
Ensure the nginx configuration file (/etc/nginx/sites-available/default) looks something like the example in apps/restconf/README.md
And you shouldn't have multiple clixon_backend:s in your ps. Just a single one.

from clixon.

olofhagsand avatar olofhagsand commented on August 29, 2024 1

Can you please supply nginx config file. And exactly how you start backend, restconf and curl command?

from clixon.

olofhagsand avatar olofhagsand commented on August 29, 2024 1

Also www-data need to be member of that group:
clicon:x:1001:shubhtrix,www-data

from clixon.

shubhtrix avatar shubhtrix commented on August 29, 2024

oh ya hi!!!

Thanks a lot, it is working now but some part. Can you help me with this....

AS ROOT : 07:59 PM : restconf :) vim README.md
AS ROOT : 08:00 PM : restconf :) curl -G http://127.0.0.1/restconf
{
"restconf": {
"data": null,
"operations": null,
"yang-library-version": "2016-06-21"
}
}
AS ROOT : 08:00 PM : restconf :) curl -G http://127.0.0.1/restconf/data/interfaces
{
"ietf-restconf:errors" : {
"error": {
"rpc-error": {
"error-tag": "operation-failed",
"error-type": "protocol",
"error-severity": "error",
"error-message": "connecting unix socket: /usr/local/var/example/example.sock.Client should be >member of group $CLICON_SOCK_GROUP: "
}
}
}

}
AS ROOT : 08:00 PM : restconf :)

No multiple restcof's. And Have checked README.md under apps/restconf/. Why restconf is not able to get the data. or Should the question be from where it is reading all that data.

Thanks a lot!!!

Regards,
Shubham

from clixon.

shubhtrix avatar shubhtrix commented on August 29, 2024

Oh sorry!!!

My nginx config file is like this

`# Default server configuration

server {
listen 80 default_server;
listen [::]:80 default_server;

location /restconf {
    root /usr/share/nginx/html/restconf;
    fastcgi_pass unix:/www-data/fastcgi_restconf.sock;
    include fastcgi_params;
}

# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;

# root /var/www/html;

# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;

server_name _;

# location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#	try_files $uri $uri/ =404;
# }

# pass PHP scripts to FastCGI server
#
#location ~ \.php$ {
#	include snippets/fastcgi-php.conf;
#
#	# With php-fpm (or other unix sockets):
#	fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
#	# With php-cgi (or other tcp sockets):
#	fastcgi_pass 127.0.0.1:9000;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
#	deny all;
#}

}`

Not able to get the data now that is the only part remaining.

from clixon.

olofhagsand avatar olofhagsand commented on August 29, 2024

Seems like you have not setup the clixon group.
https://github.com/clicon/clixon/blob/master/doc/FAQ.md#do-i-need-to-setup-anything

from clixon.

olofhagsand avatar olofhagsand commented on August 29, 2024

I have updated https://github.com/clicon/clixon/blob/develop/doc/FAQ.md and https://github.com/clicon/clixon/blob/develop/example/README.md to make this clearer.
Please tell me if it still does not work.
The nginx conf looks OK.

from clixon.

shubhtrix avatar shubhtrix commented on August 29, 2024

Ya ya !!!
Man i'm on it just a sec.

from clixon.

shubhtrix avatar shubhtrix commented on August 29, 2024

Whoa!!!
Hurra :)

AS ROOT : 08:36 PM : doc :) curl -G http://127.0.0.1/restconf/data/
{
"data": {
"interfaces-state": {
"interface": [
{
"name": "eth0",
"type": "ex:eth",
"if-index": 42
}
]
}
}
}

Yo some data came. Ah Thanks a lot so how can I use more manipulation. I know you posted some already at FAQ. But any other suggestions please not the RFC :)

Thanks once again for your so fast responses and help.
Regards,
Shubham

from clixon.

shubhtrix avatar shubhtrix commented on August 29, 2024

Hi!!!

And i think this is just state data. i think I'm not getting the configuration data. Is it so??

Regards,
Shubham

from clixon.

olofhagsand avatar olofhagsand commented on August 29, 2024

Restconf GET gives a combined configuration and state data resources, it differs form netconf in that way that there is no separate config and state data get method.
There are some more examples in apps/restconf/README.md.
I consider this issue closed.

from clixon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.