Skip to content

bug: sdk not working with service account #105

@gfh31fgh2

Description

@gfh31fgh2

Bug Report

mac os ventura, m1
python3.8

python3.8 -m pip install grpcio
python3.8 -m pip install six
python3.8 -m pip install ydk
python3.8 -m pip install grpcio-tools
python3.8 -m pip install iso8601

python3.8 testrun.py

def firstrun_old(endpoint, database, path, safile):
    with ydb.Driver(endpoint=endpoint, database=database, credentials=ydb.iam.ServiceAccountCredentials.from_file("somefile") ) as driver:
        driver.wait(timeout=5, fail_fast=True)

        with ydb.SessionPool(driver) as pool:

            ensure_path_exists(driver, database, path)
File "/path/functions.py", line 510, in somefunc
    with ydb.Driver(endpoint=endpoint, database=database, credentials=ydb.iam.ServiceAccountCredentials.from_file("somefile.json") ) as driver:
  File "/opt/homebrew/lib/python3.8/site-packages/ydb/iam/auth.py", line 107, in from_file
    return cls(
  File "/opt/homebrew/lib/python3.8/site-packages/ydb/iam/auth.py", line 191, in __init__
    super(ServiceAccountCredentials, self).__init__(
  File "/opt/homebrew/lib/python3.8/site-packages/ydb/iam/auth.py", line 125, in __init__
    TokenServiceCredentials.__init__(self, iam_endpoint, iam_channel_credentials)
  File "/opt/homebrew/lib/python3.8/site-packages/ydb/iam/auth.py", line 51, in __init__
    assert (
AssertionError: run pip install==ydb[yc] to use service account credentials
python3.8 -m pip install ydb
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Requirement already satisfied: ydb in /opt/homebrew/lib/python3.8/site-packages (2.12.0)
Requirement already satisfied: grpcio>=1.5.0 in /opt/homebrew/lib/python3.8/site-packages (from ydb) (1.51.1)
Requirement already satisfied: enum-compat>=0.0.1 in /opt/homebrew/lib/python3.8/site-packages (from ydb) (0.0.3)
Requirement already satisfied: protobuf>=3.13.0 in /opt/homebrew/lib/python3.8/site-packages (from ydb) (4.21.12)
Requirement already satisfied: packaging in /opt/homebrew/lib/python3.8/site-packages (from ydb) (23.0)
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621

ydb cli with somefile.json working correct.
but sdk not working
btw: python3.11 - same error

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions