Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
All solutions
    • All solutions for Managed Service for YDB
    • Resolving the `RESOURCE_EXHAUSTED` error
    • Resolving the `Unauthenticated` error
    • Fixing error 503 `Service Unavailable`

In this article:

  • Issue description
  • Solution
  1. Managed Service for YDB
  2. Resolving the `Unauthenticated` error

Fixing the Unauthenticated error

Written by
Yandex Cloud
Updated at December 17, 2025
View in Markdown
  • Issue description
  • Solution

Issue descriptionIssue description

When trying to access Managed Service for YDB from a local machine, you get the Unauthenticated error.

SolutionSolution

You can get authenticated using an IAM token or a service account token. You can see some code examples here or here.

Example of using YDB Python SDK
  1. Create a folder, e.g., ydb, and navigate to it via PowerShell or Bash: cd ydb. You will be running all subsequent commands in the terminal from this folder.

  2. Create an authorized key for the service account: yc iam key create --service-account-id <id_CA> --output token.json. You will get the token.json key in the ydb folder.

  3. Check the key: ydb --endpoint grpcs://ydb.serverless.yandexcloud.net:2135 --database /ru-central1/b1gb4.../etn0fu... --sa-key-file token.json discovery whoami. You should get User SID: ajei6s...@as in response. This means the connection has been established.

  4. Clone the example from GitHub: git clone https://github.com/ydb-platform/ydb-python-sdk.git. It will be saved in the current ydb folder for your convenience.

  5. Install the python -m pip install iso8601 library.

  6. Add the location of this file to the YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS environment variable:

    • Linux: export YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS=~/ydb/token.json
    • Microsoft Windows®: $YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS="C:\Users\<user>\ydb\token.json".
  7. Run the script: python ydb-python-sdk/examples/basic_example_v1/ -e grpcs://ydb.serverless.yandexcloud.net:2135 -d /ru-central1/b1gb4.../etn0fu....

Was the article helpful?

Previous
Resolving the `RESOURCE_EXHAUSTED` error
Next
Fixing error 503 `Service Unavailable`
© 2026 Direct Cursus Technology L.L.C.