Skip to content

influxdb_client.rest.ApiException: (404) when creating invokable script #527

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
HamidKhanamiri opened this issue Nov 1, 2022 · 4 comments
Milestone

Comments

@HamidKhanamiri
Copy link

Python version: 3.10
influxdb_client vesion: 1.34.0
OS: Mac

I am testing the Influxdb python client using local instance of influxdb version 2.1.0. I am able to create/delete buckets, write/read data to/from buckets, update buckets description etc. However, I am running into an exception when trying to create an invokable script. For example, running example below:
https://github.com/influxdata/influxdb-client-python/blob/master/examples/invokable_scripts.py

results in the following outcome. I appreciate any feedback, and hope I have not left out any detail.

------- Create -------

Traceback (most recent call last):
File "/Users/myuser/src/test_invokable_script.py", line 40, in
created_script = scripts_api.create_script(create_request=create_request)
File "/Users/myuser/src/venv/lib/python3.10/site-packages/influxdb_client/client/invokable_scripts_api.py", line 31, in create_script
return self._invokable_scripts_service.post_scripts(script_create_request=create_request)
File "/Users/myuser/src/venv/lib/python3.10/site-packages/influxdb_client/service/invokable_scripts_service.py", line 515, in post_scripts
(data) = self.post_scripts_with_http_info(script_create_request, **kwargs) # noqa: E501
File "/Users/myuser/src/venv/lib/python3.10/site-packages/influxdb_client/service/invokable_scripts_service.py", line 535, in post_scripts_with_http_info
return self.api_client.call_api(
File "/Users/myuser/src/venv/lib/python3.10/site-packages/influxdb_client/_sync/api_client.py", line 343, in call_api
return self.__call_api(resource_path, method,
File "/Users/myuser/src/venv/lib/python3.10/site-packages/influxdb_client/_sync/api_client.py", line 173, in __call_api
response_data = self.request(
File "/Users/myuser/src/venv/lib/python3.10/site-packages/influxdb_client/_sync/api_client.py", line 388, in request
return self.rest_client.POST(url,
File "/Users/myuser/src/venv/lib/python3.10/site-packages/influxdb_client/_sync/rest.py", line 311, in POST
return self.request("POST", url,
File "/Users/myuser/src/venv/lib/python3.10/site-packages/influxdb_client/_sync/rest.py", line 261, in request
raise ApiException(http_resp=r)
influxdb_client.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json; charset=utf-8', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': '2.1.0', 'X-Platform-Error-Code': 'not found', 'Date': 'Tue, 01 Nov 2022 16:05:02 GMT', 'Content-Length': '54'})
HTTP response body: {
"code": "not found",
"message": "path not found"
}

@powersj
Copy link
Contributor

powersj commented Nov 1, 2022

using local instance of influxdb version 2.1.0

I believe the scripts API is only available in InfluxDB cloud at this time

@bednar
Copy link
Contributor

bednar commented Nov 1, 2022

Hi @HamidKhanamiri,

the Invokable scripts are only available on the InfluxDB Cloud. For more info see:

Regards

@bednar bednar closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2022
@bednar bednar added this to the 1.35.0 milestone Nov 1, 2022
@HamidKhanamiri
Copy link
Author

Hi @powersj, @bednar thanks for the answers. Would be great if "invokable script api not available on a local InfluxDB instance" was explicitly mentioned in the documents, or the comment line you referred to in the example file, or in the exception message returned by the Python client.
Also, it is a cool feature to have, so that new users doing only prototyping don't have to get a cloud subscription :)

@bednar
Copy link
Contributor

bednar commented Nov 2, 2022

@HamidKhanamiri thanks for your suggestion 👍

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