You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hugegraph.apache.org by GitBox <gi...@apache.org> on 2022/06/30 02:25:56 UTC
[GitHub] [incubator-hugegraph] shangrilaxie opened a new issue, #1911: Gremlin console 不能连接启用了用户验证与授权的HugeGraph 0.11.2
shangrilaxie opened a new issue, #1911:
URL: https://github.com/apache/incubator-hugegraph/issues/1911
### Problem Type (问题类型)
configs (配置项 / 文档相关)
### Before submit
- [X] 我已经确认现有的 [Issues](https://github.com/hugegraph/hugegraph/issues) 与 [FAQ](https://hugegraph.github.io/hugegraph-doc/guides/faq.html) 中没有相同 / 重复问题
### Environment (环境信息)
- Server Version: v0.11.x
- Backend: RocksDB x nodes, HDD or SSD
- OS: windows11 wsl -ubutun20.03,x86 8-core CPU, 16 G RAM
- Data Size: 6000 vertices, 60000 edges <!-- (like 1000W 点, 9000W 边) -->
### Your Question (问题描述)
不启用验证与授权,console是可以正常访问server的。启用验证与授权后,console不能正常访问server。(curl/postman两种情况下都是可以正常访问server的)
Gremlin Server 配置
# authentication
authentication: {
authenticator: com.baidu.hugegraph.auth.StandardAuthenticator,
authenticationHandler: com.baidu.hugegraph.auth.WsAndHttpBasicAuthHandler,
config: {tokens: conf/rest-server.properties}
}
rest Server 配置
# authentication:StandardAuthenticator
auth.authenticator=com.baidu.hugegraph.auth.StandardAuthenticator
auth.graph_store=hugegraph
console配置:remote-secure.yaml
hosts: [localhost]
port: 8182
username: admin
password: hugeadmin
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: {
serializeResultToString: false,
ioRegistries: [com.baidu.hugegraph.io.HugeGraphIoRegistry]
}
}
其它根据文档描述配置。
1、init-store.sh启动正常,设置admin密码。
2、启动Server正常。使用curl/postman工具进行验证授权等的使用是正常的。但是hubble工具只能使用admin进行操作,如果使用创建好的其它用户是不能连接访问的,总是提示用户验证和授权错误。
3、启动Console
$ bin/gremlin-console.sh
\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: HugeGraph
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> :remote connect tinkerpop.server conf/remote-secure.yaml
==>Configured localhost/127.0.0.1:8182
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
gremlin> hugegraph
Authenticator is not ready to handle requests
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin>
### 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
[GitHub] [incubator-hugegraph] javeme commented on issue #1911: Gremlin console 不能连接启用了用户验证与授权的HugeGraph 0.11.2
Posted by GitBox <gi...@apache.org>.
javeme commented on issue #1911:
URL: https://github.com/apache/incubator-hugegraph/issues/1911#issuecomment-1173716634
感谢反馈,经过分析发现是`StandardAuthenticator`未实现`Authenticator.newSaslNegotiator()`方法导致的,欢迎贡献代码。
具体实现流程可参考:
```java
// StandardAuthenticator.newSaslNegotiator()
@Override
public SaslNegotiator newSaslNegotiator(InetAddress remoteAddress) {
throw new StandardAuthenticator.PlainTextSaslNegotiator();
}
```
可参考如下实现Tinkerpop的[SimpleAuthenticator.PlainTextSaslAuthenticator](https://github.com/apache/tinkerpop/blob/master/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java#L118)实现:
```java
// SimpleAuthenticator.PlainTextSaslAuthenticator
private class PlainTextSaslAuthenticator implements Authenticator.SaslNegotiator {
// ...
}
```
--
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
[GitHub] [incubator-hugegraph] shangrilaxie commented on issue #1911: Gremlin console 不能连接启用了用户验证与授权的HugeGraph 0.11.2
Posted by GitBox <gi...@apache.org>.
shangrilaxie commented on issue #1911:
URL: https://github.com/apache/incubator-hugegraph/issues/1911#issuecomment-1173688357
环境:windows11 WSL2-ubutun
版本:hugegraph 0.11.2 多图配置
根据Tinkerpop文档来配置gremlin console访问 启用用户验证与授权的server。不知hugegraph是否有相关文档说明(console访问hugegraph server,原有文档说不能同时通过console和http方式访问:事实上配置WsAndHttpChannel协议时可以的。)
问题:Authenticator is not ready to handle requests
操作过程:
~/hg11.2/hugegraph-0.11.2$ bin/start-hugegraph.sh
Starting HugeGraphServer...
Connecting to HugeGraphServer (http://0.0.0.0:8080/graphs)........OK
Started [pid 2359]
~/hg11.2/hugegraph-0.11.2$ bin/gremlin-console.sh
\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: HugeGraph
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin>
gremlin> :remote connect tinkerpop.server conf/remote-secure.yaml
==>Configured localhost/127.0.0.1:8182
gremlin>
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
gremlin> hugegraph
**Authenticator is not ready to handle requests**
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin> hugegraph.traversal().V()
Authenticator is not ready to handle requests
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin>
查看后台server消息:
2022-07-04 17:46:15 283707 [gremlin-server-worker-1] [ERROR] org.apache.tinkerpop.gremlin.server.handler.SaslAuthenticationHandler [] - StandardAuthenticator is not ready to handle requests - check it's configuration or related services
是不是后台有啥特别的配置吗?
另外:curl访问时可以的。
C:\>curl -u admin:cirroadmin http://localhost:8080/graphs/hugegraph/schema/propertykeys
{"propertykeys": [{"id":6,"name":"weight","data_type":"FLOAT","cardinality":"SINGLE","aggregate_type":"NONE","properties":[],"status":"CREATED","user_data":{"~create_time":"2022-06-28 11:59:45.228"}},{"id":3,"name":"addr","data_type":"TEXT","cardinality":"SINGLE","aggregate_type":"NONE","properties":[],"status":"CREATED","user_data":{"~create_time":"2022-06-28 11:59:45.224"}},{"id":2,"name":"age","data_type":"INT","cardinality":"SINGLE","aggregate_type":"NONE","properties":[],"status":"CREATED","user_data":{"~create_time":"2022-06-28 11:59:45.223"}},{"id":5,"name":"tag","data_type":"TEXT","cardinality":"SINGLE","aggregate_type":"NONE","properties":[],"status":"CREATED","user_data":{"~create_time":"2022-06-28 11:59:45.226"}},{"id":4,"name":"lang","data_type":"TEXT","cardinality":"SINGLE","aggregate_type":"NONE","properties":[],"status":"CREATED","user_data":{"~create_time":"2022-06-28 11:59:45.225"}},{"id":1,"name":"name","data_type":"TEXT","cardinality":"SINGLE","aggregate_type":"
NONE","properties":[],"status":"CREATED","user_data":{"~create_time":"2022-06-28 11:59:45.218"}}]}
C:\>
--
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
[GitHub] [incubator-hugegraph] javeme commented on issue #1911: Gremlin console 不能连接启用了用户验证与授权的HugeGraph 0.11.2
Posted by GitBox <gi...@apache.org>.
javeme commented on issue #1911:
URL: https://github.com/apache/incubator-hugegraph/issues/1911#issuecomment-1173370350
@shangrilaxie 感谢反馈,是否可以提供更多错误信息,比如版本号、错误堆栈信息。
--
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