You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hugegraph.apache.org by "chenhong1990 (via GitHub)" <gi...@apache.org> on 2024/04/02 09:49:45 UTC

[I] hugegraph1.2.0在调用创建图的时候报没有权限,实际是我已经输入用户名和密码 [incubator-hugegraph]

chenhong1990 opened a new issue, #2500:
URL: https://github.com/apache/incubator-hugegraph/issues/2500

   ### Bug Type (问题类型)
   
   rest-api (结果不合预期)
   
   ### Before submit
   
   - [X] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)
   
   ### Environment (环境信息)
   
   - Server Version: 1.2.0 (Apache Release Version)
   - Backend: RocksDB x nodes, HDD or SSD 
   - OS: xx CPUs, xx G RAM, Ubuntu 2x.x / CentOS 7.x 
   - Data Size:  xx vertices, xx edges <!-- (like 1000W 点, 9000W 边) -->
   
   
   ### Expected & Actual behavior (期望与实际表现)
   
   curl --location 'http://172.30.96.162:8081/graphs/test' \
   --header 'Content-Type: text/plain' \
   --header 'Authorization: Basic YWRtaW46MTIzNDU2Nzg=' \
   --data 'gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy
   backend=rocksdb
   serializer=binary
   store=test
   rocksdb.data_path=/data/hugegraph1.2.0/apache-hugegraph-incubating-1.2.0/data/test
   rocksdb.wal_path=/data/hugegraph1.2.0/apache-hugegraph-incubating-1.2.0/wal/test'
   
   
   根据api调用创建图报错如下:
   2024-04-02 17:47:42 [db-open-1] [INFO] o.a.h.b.s.r.RocksDBStore - Opening RocksDB with data path: /data/hugegraph1.2.0/apache-hugegraph-incubating-1.2.0/data/test/s
   2024-04-02 17:47:42 [db-open-1] [INFO] o.a.h.b.s.r.RocksDBStore - Opening RocksDB with data path: /data/hugegraph1.2.0/apache-hugegraph-incubating-1.2.0/data/test/g
   2024-04-02 17:47:42 [grizzly-http-server-8] [INFO] o.a.h.b.s.r.RocksDBStore - Write down the backend version: 1.11
   2024-04-02 17:47:43 [grizzly-http-server-8] [ERROR] o.a.h.c.GraphManager - Failed to create graph 'test' due to: Failed to update/query TaskStore: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Missing authentication context when verifying resource permission
   org.apache.hugegraph.HugeException: Failed to update/query TaskStore: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Missing authentication context when verifying resource permission
   	at org.apache.hugegraph.task.StandardTaskScheduler.call(StandardTaskScheduler.java:717) ~[hugegraph-core-1.2.0.jar:1.2.0]
   	at org.apache.hugegraph.task.StandardTaskScheduler.call(StandardTaskScheduler.java:704) ~[hugegraph-core-1.2.0.jar:1.2.0]
   	at org.apache.hugegraph.task.StandardTaskScheduler.init(StandardTaskScheduler.java:464) ~[hugegraph-core-1.2.0.jar:1.2.0]
   	at org.apache.hugegraph.StandardHugeGraph.initSystemInfo(StandardHugeGraph.java:415) ~[hugegraph-core-1.2.0.jar:1.2.0]
   	at org.apache.hugegraph.StandardHugeGraph.initBackend(StandardHugeGraph.java:364) ~[hugegraph-core-1.2.0.jar:1.2.0]
   	at org.apache.hugegraph.StandardHugeGraph.create(StandardHugeGraph.java:979) ~[hugegraph-core-1.2.0.jar:1.2.0]
   	at org.apache.hugegraph.auth.HugeGraphAuthProxy.create(HugeGraphAuthProxy.java:781) ~[hugegraph-api-1.2.0.jar:1.2.0]
   	at org.apache.hugegraph.core.GraphManager.createGraph(GraphManager.java:586) ~[hugegraph-api-1.2.0.jar:0.71.0.0]
   	at org.apache.hugegraph.core.GraphManager.createGraph(GraphManager.java:186) ~[hugegraph-api-1.2.0.jar:0.71.0.0]
   	at org.apache.hugegraph.api.profile.GraphsAPI.create(GraphsAPI.java:136) ~[hugegraph-api-1.2.0.jar:0.71.0.0]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_202]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_202]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
   	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52) ~[jersey-server-3.0.3.jar:?]
   	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124) ~[jersey-server-3.0.3.jar:?]
   	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167) ~[jersey-server-3.0.3.jar:?]
   	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ObjectOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:192) ~[jersey-server-3.0.3.jar:?]
   	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) ~[jersey-server-3.0.3.jar:?]
   	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475) ~[jersey-server-3.0.3.jar:?]
   	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397) ~[jersey-server-3.0.3.jar:?]
   	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81) ~[jersey-server-3.0.3.jar:?]
   
   
   ### Vertex/Edge example (问题点 / 边数据举例)
   
   _No response_
   
   ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Question] 1.2.0 create graph in rest-api throws auth related permission [incubator-hugegraph]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #2500: [Question] 1.2.0 create graph in rest-api throws auth related permission
URL: https://github.com/apache/incubator-hugegraph/issues/2500


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] hugegraph1.2.0在调用创建图的时候报没有权限,实际是我已经输入用户名和密码 [incubator-hugegraph]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #2500:
URL: https://github.com/apache/incubator-hugegraph/issues/2500#issuecomment-2031730410

   <!-- Answer -->
   Apologies for the confusion earlier, and thank you for your patience, @chenhong1990.
   
   Based on the further guidance provided, it seems the issue might not be related to the client-side authentication setup as initially suggested. Instead, we should approach this problem by first ensuring that the issue isn't related to permission settings or environment-specific configurations.
   
   Here's a step-by-step guide to help you troubleshoot and hopefully resolve the issue:
   
   1. **Access Without Setting Permissions**: Try to access the creation of the graph without setting any permissions first. This step is to ensure that the basic functionality (creating a graph) works without the added complexity of permissions. If this works, it indicates that the issue is likely related to permission settings.
   
   2. **Narrow Down the Scope**: If the graph creation works without permissions, gradually reintroduce permissions to narrow down the specific setting or configuration causing the issue. This incremental approach helps identify the exact cause.
   
   3. **Test in a Clean/Container Environment**: If possible, replicate the issue in a clean environment or a container (e.g., Docker). This can help determine if the issue is environment-specific. A clean environment ensures that no previous configurations or data interfere with the process.
   
   4. **Provide Replication Steps**: If the issue can be easily replicated, especially in a clean or container environment, please provide the steps you took to replicate the problem. This information is invaluable for diagnosing the issue more effectively and can help in identifying whether it's a bug or a misconfiguration.
   
   By following these steps, we aim to isolate the problem and identify whether it's related to permissions, environment configurations, or perhaps something else. Your cooperation and detailed feedback at each step will be crucial in resolving this issue.
   
   If you encounter any specific errors or behaviors at any step, please share them. This information will be critical in understanding what's going wrong and how we can help you fix it.
   
   Thank you for working with us on this, and we look forward to getting to the bottom of this issue together.
   
   
   <!-- Dosu Comment Footer -->
   <details>
   <summary>
   
   #### About Dosu
   </summary>
   
   This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research.
   
   Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
   
   If you want to continue the conversation, start your reply with @dosu-bot.
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [I] [Question] 1.2.0 create graph in rest-api throws auth related permission [incubator-hugegraph]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #2500:
URL: https://github.com/apache/incubator-hugegraph/issues/2500#issuecomment-2103418159

   Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [I] [Question] 1.2.0 create graph in rest-api throws auth related permission [incubator-hugegraph]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #2500:
URL: https://github.com/apache/incubator-hugegraph/issues/2500#issuecomment-2062327614

   Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [I] [Question] 1.2.0 create graph in rest-api throws auth related permission [incubator-hugegraph]

Posted by "JackyYangPassion (via GitHub)" <gi...@apache.org>.
JackyYangPassion commented on issue #2500:
URL: https://github.com/apache/incubator-hugegraph/issues/2500#issuecomment-2073893263

   dynamic create graph you can use this body close the authentication
   ```
   gremlin.graph=org.apache.hugegraph.HugeFactory
   vertex.cache_type=l2
   edge.cache_type=l2
   backend=rocksdb
   serializer=binary
   store=test
   rocksdb.data_path=/hugegraph-server/data/test/data
   rocksdb.wal_path=/hugegraph-server/data/test/wal
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [I] hugegraph1.2.0在调用创建图的时候报没有权限,实际是我已经输入用户名和密码 [incubator-hugegraph]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #2500:
URL: https://github.com/apache/incubator-hugegraph/issues/2500#issuecomment-2031558794

   <!-- Greeting -->
   Hey @chenhong1990, great to see you back here! 😊 I remember our last interaction. Give me a moment to dive into this issue, and I'll get back to you with some insights shortly.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [I] [Question] 1.2.0 create graph in rest-api throws auth related permission [incubator-hugegraph]

Posted by "BreakMeEveryday (via GitHub)" <gi...@apache.org>.
BreakMeEveryday commented on issue #2500:
URL: https://github.com/apache/incubator-hugegraph/issues/2500#issuecomment-2071269606

   @dosu-bot 
   I got the same problem and here is my situation. I did not config any information in `rest-server.properties` such as `auth.authenticator`, so in theory authentication should be not working or **there is an default value to `auth.authenticator`?**
   ```properties
   # authentication configs
   # choose 'org.apache.hugegraph.auth.StandardAuthenticator' or
   # 'org.apache.hugegraph.auth.ConfigAuthenticator'
   #auth.authenticator=
   ```
   
   This is the code in GraphsAPI
   ```java
      @POST
       @Timed
       @Path("{name}")
       @Consumes(TEXT_PLAIN)
       @Produces(APPLICATION_JSON_WITH_CHARSET)
       @RolesAllowed({"admin"}) // The entry point for problem, maybe.
       public Object create(@Context GraphManager manager,
                            @PathParam("name") String name,
                            @QueryParam("clone_graph_name") String clone,
                            String configText) {
           LOG.debug("Create graph '{}' with clone graph '{}', config text '{}'",
                     name, clone, configText);
           HugeGraph graph;
           if (StringUtils.isNotEmpty(clone)) {
               graph = manager.cloneGraph(clone, name, configText);
           } else {
               graph = manager.createGraph(name, configText);
           }
           return ImmutableMap.of("name", graph.name(),
                                  "backend", graph.backend());
       }
   
   ```
   
   Please tell me how to close the authentication or **how to write the right code corresponding `@RolesAllowed({"admin"})`**


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [I] hugegraph1.2.0在调用创建图的时候报没有权限,实际是我已经输入用户名和密码 [incubator-hugegraph]

Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on issue #2500:
URL: https://github.com/apache/incubator-hugegraph/issues/2500#issuecomment-2031725276

   @dosu-bot nope,  u get the wrong context, this should have nothing to do with `OKHTTP`
   
   You should let the user try to access the creation without setting permissions first, check if it is OK, then gradually narrow down the scope of the problem and have the user test it in a clean environment/container environment. 
   
   If it can be easily replicated, provide the steps for replication so that it is convenient to confirm the problem
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org