Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud ID is not properly formatted #244

Closed
stheobald opened this issue May 20, 2024 · 3 comments
Closed

Cloud ID is not properly formatted #244

stheobald opened this issue May 20, 2024 · 3 comments

Comments

@stheobald
Copy link

  File "/.../elastic/chatbot-rag-app/.venv/lib/python3.11/site-packages/elastic_transport/client_utils.py", line 125, in parse_cloud_id
    raise ValueError("Cloud ID is not properly formatted") from None
ValueError: Cloud ID is not properly formatted

Using the Cloud ID found on my https://cloud.elastic.co/deployments/ page.

It seems that the client_utils.py may be expecting to find a '$' separator in part of the decoded id string.

This prevents ingesting data while attempting to connect to a cloud Elasticsearch instance.

@miguelgrinberg
Copy link
Collaborator

@stheobald Just want to make sure you are using the Cloud ID and not the name of your deployment. Your Cloud ID is formed with the name of your deployment, followed by a colon, then followed by a long base64 encoded payload.

See this page for detailed instructions on where to find your cloud id.

@stheobald
Copy link
Author

@miguelgrinberg Correct - as uplifted from the 'Cloud Id' (under the red square) by hitting the 'Copy' button.
rowland_cloud_id

@miguelgrinberg
Copy link
Collaborator

Then you must have made a mistake when you copy/pasted it, because the second part of the cloud id (after the colon) must have two $ after it is base64 decoded. Try this in a python prompt:

>>> import base64
>>> cloud_id = "<paste your cloud id here>"
>>> name, payload = cloud_id.split(':')
>>> payload = base64.b64decode(payload)
>>> payload.split(b'$')
[b'us-east-2.aws.elastic-cloud.com:443', b'...', b'...']

The payload portion of the cloud id should decode to 3 parts. The first is the domain of your deployment. The other two are UUIDs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants