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

Error with OpenTwins app plugin #6

Open
SusaPereg opened this issue May 8, 2024 · 3 comments
Open

Error with OpenTwins app plugin #6

SusaPereg opened this issue May 8, 2024 · 3 comments

Comments

@SusaPereg
Copy link

Hello,

I have installed OpenTwins using the manual guide for the core functionality. Then, I have added the OpenTwins app plugin to grafana. However, I am facing problems with this plugin.
I cannot create policies, which are necessary to create a new twin. The following image shows the error that I am getting in the Policies tab:
Policies-cursor-error

Is there a fix for this? Thank you.

@RadonicA
Copy link

RadonicA commented May 20, 2024

@SusaPereg Hello! I tried to install OpenTwins on Linux, however, I ran into a problem at the very beginning of the Docker and Kubernetes setup installation. Given that you managed to install OpenTwins, it would mean if you could send me more detailed instructions for installing Docker and Kubernetes setups, which include setting paths and certain settings that are not explained in the instructions from github. On the following link there is an issue that I opened on this repository with images that follow the installation process. #7
I am looking forward to your response. Thank you!

@sergioinf
Copy link
Member

Hello @SusaPereg,
There is no problem with your installation. The current version of the OpenTwins plugin for Grafana does not have the possibility to create policies. Policies are an Eclipse Ditto component to give different users access to certain features. Currently, OpenTwins does not have user control so having different policies does not help.

However, to create a basic policy needed to create the digital twins, it is possible to do it through HTTP requests (e.g. CURL, Postman, etc) to your Eclipse Ditto Nginx (PUT http://yourDittoNginxurl/api/2/policies/{policyId}).

Here you have our basic policy:

{
    "policyId": "default:basic_policy",
    "imports": {},
    "entries": {
        "DEFAULT": {
            "subjects": {
                "pre-authenticated:kafkaml-connection": {
                    "type": "Connection to KafkaML"
                },
                "pre-authenticated:hono-connection": {
                    "type": "Connection to Eclipse Hono"
                },
                "nginx:ditto": {
                    "type": "Ditto user authenticated via nginx"
                }
            },
            "resources": {
                "policy:/": {
                    "grant": [
                        "READ",
                        "WRITE"
                    ],
                    "revoke": []
                },
                "thing:/": {
                    "grant": [
                        "READ",
                        "WRITE"
                    ],
                    "revoke": []
                },
                "message:/": {
                    "grant": [
                        "READ",
                        "WRITE"
                    ],
                    "revoke": []
                }
            },
            "importable": "implicit"
        }
    }
}

@xxabdelxx
Copy link

xxabdelxx commented Nov 4, 2024

Hello, as I commented on another issue, I have added the policy manually through the API. Still the error persist and the console shows bad request "400" when loading policies.

My clarification in the other issue:
"Hello. I have same problem but creating a type page has the button but not in the policies' page where nothing is showing. The error in the console is :
url: 'http://IP_Extended_API/api/policies', bad request 400

accessing that url on browser gives a void message :
{
"message": {}
}

I'm deploying using Minikube. Grafana, the extended API, the Ditto NGINX and Mosquitto are accessible from Internet as I'm deploying on cloud with openstack instance with a floating IP. Grafana OpenTwin plugin is well connected to the Ip addresses of both Ditto NGINX and Extended API. Running API queries such as IP_Ditto_NGINX/api/2/whoami works, inserting and finding a new policy through curl to IP_Ditto_NGINX/api/2/policies/id_policy works. However, in the installation files, it is expected that I find default:basic_policy if I query Ditto NGINX, but it seems it is not their ""error": "policies:policy.notfound",".

I was thinking it could be a problem with mongodb not connected, but as long as I insert and I can find a test policy then it is connected. What could make policies not loading ?

Thank you."

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

No branches or pull requests

4 participants