imbajin commented on issue #2530:
URL:
https://github.com/apache/incubator-hugegraph/issues/2530#issuecomment-2072242097
> @imbajin @dosu Yeah, I did found the
`org.apache.hugegraph.api.graphs.GraphsAPI.create(String name, String
cloneGraphName, String configText)` in **hugegraph-client** project, it may
works and I will give it a try.
>
> A bad news, I'm failed and here is my result. I had run the test method
`test/java/org.apache.hugegraph.api.GraphsApiTest.testCreateAndDropGraph()` in
**hugegraph-toolchain/hugegraph-client** module.
>
> ```java
> @Test
> public void testCreateAndDropGraph() {
> int initialGraphNumber = graphsAPI.list().size();
>
> // Create new graph dynamically
> String config;
> try {
> config = FileUtils.readFileToString(new File(CONFIG2_PATH),
> StandardCharsets.UTF_8);
> } catch (IOException e) {
> throw new ClientException("Failed to read config file: %s",
> CONFIG2_PATH);
> }
> Map<String, String> result = graphsAPI.create(GRAPH2, null,
config);
> ...
> }
> ```
>
> But a same exception as before occured.
>
>

>
> And here is the **stack of exceptions of server**
>
> ```shell
> java.lang.IllegalStateException: Missing authentication context when
verifying resource permission
> at
com.google.common.base.Preconditions.checkState(Preconditions.java:532)
~[guava-30.0-jre.jar:?]
> at org.apache.hugegraph.util.E.checkState(E.java:64)
~[hugegraph-common-1.3.0.jar:1.3.0]
> at
org.apache.hugegraph.auth.HugeGraphAuthProxy.verifyResPermission(HugeGraphAuthProxy.java:964)
~[classes/:?]
> at
org.apache.hugegraph.auth.HugeGraphAuthProxy.verifyResPermission(HugeGraphAuthProxy.java:955)
~[classes/:?]
> at
org.apache.hugegraph.auth.HugeGraphAuthProxy.verifyPermission(HugeGraphAuthProxy.java:828)
~[classes/:?]
> at
org.apache.hugegraph.auth.HugeGraphAuthProxy.create(HugeGraphAuthProxy.java:781)
~[classes/:?]
> at
org.apache.hugegraph.core.GraphManager.createGraph(GraphManager.java:591)
~[classes/:?]
> at
org.apache.hugegraph.core.GraphManager.createGraph(GraphManager.java:188)
~[classes/:?]
> at
org.apache.hugegraph.api.profile.GraphsAPI.create(GraphsAPI.java:136)
~[classes/:?]
> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[?:?]
> at
jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[?:?]
> at
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[?:?]
> at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
> 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:?]
> at
org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255)
~[jersey-server-3.0.3.jar:?]
> at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
~[jersey-common-3.0.3.jar:?]
> at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
~[jersey-common-3.0.3.jar:?]
> at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
~[jersey-common-3.0.3.jar:?]
> at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
~[jersey-common-3.0.3.jar:?]
> at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
~[jersey-common-3.0.3.jar:?]
> at
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
~[jersey-common-3.0.3.jar:?]
> at
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)
~[jersey-server-3.0.3.jar:?]
> at
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)
~[jersey-server-3.0.3.jar:?]
> at
org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:356)
~[jersey-container-grizzly2-http-3.0.3.jar:?]
> at
org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:190)
~[grizzly-http-server-3.0.1.jar:3.0.1]
> at
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:535)
~[grizzly-framework-3.0.1.jar:3.0.1]
> at
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:515)
~[grizzly-framework-3.0.1.jar:3.0.1]
> at java.lang.Thread.run(Thread.java:829) [?:?]
> ```
>
> U know, **I did nothing to the `username` and `password`** and even I
didn't touch the username and password since using the HugeGraph.
>
> ```java
> public class BaseClientTest {
> protected static final String BASE_URL = "http://192.168.10.70:8080";
> protected static final String GRAPH = "hugegraph";
> protected static final String USERNAME = "admin";
> protected static final String PASSWORD = "pa";
> ...
> }
> ```
1. Try to input your **username/password** (auth info) or remember to
**[init
it](https://hugegraph.apache.org/cn/docs/config/config-authentication/#%E5%9F%BA%E4%BA%8E%E9%89%B4%E6%9D%83%E6%A8%A1%E5%BC%8F%E5%90%AF%E5%8A%A8)**
if u didn't set them before
2. disable the auth function & retry it
3. use docker version to enable/disable auth in one step
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]