open-metadata / OpenMetadata

OpenMetadata is a unified metadata platform for data discovery, data observability, and data governance powered by a central metadata repository, in-depth column level lineage, and seamless team collaboration.
https://open-metadata.org
Apache License 2.0
5.67k stars 1.06k forks source link

Unable to connect to OpenMetadata API via Python SDK #13855

Closed fritzwijaya closed 1 year ago

fritzwijaya commented 1 year ago

Hi team, I am trying to connect to OpenMetada API via Python SDK, but bump into error 500.

requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://localhost:8585/api/v1/version

My local OpenMetadata is running via docker compose using v1.2.0 Release https://github.com/open-metadata/OpenMetadata/releases/download/1.2.0-release/docker-compose-postgres.yml

The python script for testing is using same with given example, only change the jwt token

from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import (
    OpenMetadataConnection,
)
from metadata.generated.schema.security.client.openMetadataJWTClientConfig import (
    OpenMetadataJWTClientConfig,
)
from metadata.ingestion.ometa.ometa_api import OpenMetadata

server_config = OpenMetadataConnection(
    hostPort="http://localhost:8585/api",
    authProvider="openmetadata",
    securityConfig=OpenMetadataJWTClientConfig(
        jwtToken="<token>"
    ),
)
metadata = OpenMetadata(server_config)

assert metadata.health_check()

https://docs.open-metadata.org/v1.2.x/sdk/python/ingestion/lineage Please advise what to do to resolve the issue? Thanks :pray:

fritzwijaya commented 1 year ago

Turns out using the obsolete versions of the client. Upgrade to latest versions solve this issue. The docs should be update to the latest releases.