apache / gravitino

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
https://gravitino.apache.org
Apache License 2.0
1.1k stars 345 forks source link

[Bug report] Unable to list catalog via REST #775

Closed justinmclean closed 11 months ago

justinmclean commented 1 year ago

Describe what's wrong

You can list all meta lakes via: curl http://localhost:8090/api/metalakes

And details about a meta lakes via: curl http://localhost:8090/api/metalakes/metalake-name

And you can list all catalogs via: curl http://localhost:8090/api/metalakes/metalake-name/catalogs

But trying to list a single catalog fails with an error: curl http://localhost:8090/api/metalakes/metalake-name/catalogs/catalog-name

and looks like it tries to create one instead. Not sure if this is a bug, but it seems inconsistent.

Error message and/or stacktrace

{"code":1001,"type":"IllegalArgumentException","message":"Failed to operate catalog(s) [hive] operation [LOAD] under metalake [netgame], reason [IllegalArgumentException]","stack":["java.lang.IllegalArgumentException: Properties are required and must be set: [metastore.uris]","\tat com.google.common.base.Preconditions.checkArgument(Preconditions.java:217)"....

How to reproduce

Error occurs on Gravinito 0.2.

curl -X POST -H "Content-Type: application/json" -d '{"name":"netgame","comment":"Netgame metalake"}' http://localhost:8090/api/metalakes

curl -X POST -H "Content-Type: application/json" -d '{"name":"hive","comment":"Netgame catalog","type":"RELATIONAL", "provider":"hive","properties":{"metastore.uris":"thrift://localhost:9083"}}' http://localhost:8090/api/metalakes/netgame/catalogs

curl http://localhost:8090/api/metalakes/netgame/catalogs

curl http://localhost:8090/api/metalakes/netgame/catalogs/hive

Additional context

No response

jerryshao commented 1 year ago

@yuqi1129 Can you please help to check this issue?

yuqi1129 commented 1 year ago

@jerryshao @justinmclean I'm OK with the steps provided by justin, I'm afraid I need more details here.

➜  [/Users/yuqi/project/graviton] git:(main) curl -X POST -H "Content-Type: application/json" -d '{"name":"netgame","comment":"Netgame metalake"}' http://localhost:8090/api/metalakes

{"code":0,"metalake":{"name":"netgame","comment":"Netgame metalake","properties":{"gravitino.identifier":"gravitino.v1.uid2418095895477594928"},"audit":{"creator":"gravitino","createTime":"2023-11-20T07:25:44.681Z"}}}%
➜  [/Users/yuqi/project/graviton] git:(main) curl -X POST -H "Content-Type: application/json" -d '{"name":"hive","comment":"Netgame catalog","type":"RELATIONAL", "provider":"hive","properties":{"metastore.uris":"thrift://localhost:9083"}}' http://localhost:8090/api/metalakes/netgame/catalogs

{"code":0,"catalog":{"name":"hive","type":"relational","provider":"hive","comment":"Netgame catalog","properties":{"gravitino.bypass.hive.metastore.client.capability.check":"false","metastore.uris":"thrift://localhost:9083"},"audit":{"creator":"gravitino","createTime":"2023-11-20T07:25:50.177Z"}}}%
➜  [/Users/yuqi/project/graviton] git:(main) curl http://localhost:8090/api/metalakes/netgame/catalogs

{"code":0,"identifiers":[{"namespace":["netgame"],"name":"hive"}]}%
➜  [/Users/yuqi/project/graviton] git:(main) curl http://localhost:8090/api/metalakes/netgame/catalogs/hive
{"code":0,"catalog":{"name":"hive","type":"relational","provider":"hive","comment":"Netgame catalog","properties":{"gravitino.bypass.hive.metastore.client.capability.check":"false","metastore.uris":"thrift://localhost:9083"},"audit":{"creator":"gravitino","createTime":"2023-11-20T07:25:50.177Z"}}}%
justinmclean commented 1 year ago

Do you need more details from me? From your output above, it seems it might have been fixed after the 0.2 release?

yuqi1129 commented 1 year ago

Do you need more details from me? From your output above, it seems it might have been fixed after the 2.0 release? Unless "gravitino.bypass.hive.metastore.client.capability.check" gives different behaviour?

I don't think it's the configuration gravitino.bypass.hive.metastore.client.capability.check that causes the problem. can you provide your Gravitino configuration file? I need to reproduce it locally.

justinmclean commented 1 year ago

I don't think that is the issue either. The config file is the default one produced by gradlew assembleDistribution. As I said above, this may have been fixed and is only an issue in the 0.2 release.

yuqi1129 commented 1 year ago

this may have been fixed and is only an issue in the 0.2 release

In branch 0.2, I can't reproduce it either. So could you give me your local configuration?