Skip to content

The create_bucket method from buckets_management.py example doesn't work as documented #424

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

Closed
AbhigyaShridhar opened this issue Apr 5, 2022 · 1 comment · Fixed by #425
Milestone

Comments

@AbhigyaShridhar
Copy link

AbhigyaShridhar commented Apr 5, 2022

Steps to reproduce:
Steps followed:

  1. Import the relevant modules:
    from influxdb_client import InfluxDBClient, BucketRetentionRules
  2. Declare the required fields:
    url = "http://localhost:8086" token = "my-token" org = "my-org"
  3. Attempt creating a new bucket:
    client = InfluxDBClient(url=url,token=token)
    retention_rules = BucketRetentionRules(type="expire",every_seconds=3600)
    #create the bucket
    created_bucket = client.buckets_api().create_bucket(bucket_name="bucket-by-python",retention_rules=retention_rules, org=org)

Link to the example followed: https://github.com/influxdata/influxdb-client-python/blob/master/examples/buckets_management.py

Expected behavior:
A new bucket is created

Actual behavior:
Console threw the following error:

raise ValueError("Invalid value for org_id, must not be None") # noqa: E501
ValueError: Invalid value for org_id, must not be None

Specifications:

  • Client Version: 1.27
  • InfluxDB Version: 2.1.1-alpine
  • Platform: Ubuntu 20.04.3 LTS
@AbhigyaShridhar AbhigyaShridhar changed the title The create_bucket method from bucket_management.py example doesn't work as documented The create_bucket method from buckets_management.py example doesn't work as documented Apr 5, 2022
@bednar
Copy link
Contributor

bednar commented Apr 6, 2022

Hi @AbhigyaShridhar,

thanks for using our client.

The error is cause by missing organization with name 'my-org' in your InfluxDB database. The error message is not clear... so I will prepare PR to clarify problem.

Regards

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