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

write doesn't work when the db starts with a lowercase letter #182

Open
ronytigo opened this issue Mar 16, 2023 · 13 comments
Open

write doesn't work when the db starts with a lowercase letter #182

ronytigo opened this issue Mar 16, 2023 · 13 comments

Comments

@ronytigo
Copy link

when I call :8086/query?q=show databases

I get only the databases that start with a capital letter.

@offa
Copy link
Owner

offa commented Mar 16, 2023

Please provide more information to reproduce the issue.

@ronytigo
Copy link
Author

ronytigo commented Mar 16, 2023

It happens on 2 different machines, but doesn't happen on 2 others, so I'm not sure how to make sure it's reproduced.
The code I'm running is the code from the example:

auto influxdb = influxdb::InfluxDBFactory::Get("http://localhost:8086?db=test");
influxdb->write(influxdb::Point{"test"}
  .addField("value", 10)
  .addTag("host", "localhost")
);

if I use Test instead of test, it works (I have both test and Test buckets)

@offa
Copy link
Owner

offa commented Mar 17, 2023

(I have both test and Test buckets)

Using two names that only differ in case sound's a bit risky.

It happens on 2 different machines, but doesn't happen on 2 others, so I'm not sure how to make sure it's reproduced.

Do these running the same OS?

@ronytigo
Copy link
Author

It happens also if I use different names.
I use the same docker-compose file.
For the host, It works OK on this one:

NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"

Doesn't work on this one:

NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"

@offa offa added the question label Mar 19, 2023
@offa
Copy link
Owner

offa commented Mar 19, 2023

Do they run the same influxdb version?

@ronytigo
Copy link
Author

Yes, all machines use the docker image.
InfluxDB v2.4.0 (git: de247bab08) build_date: 2022-08-18T19:41:15Z

@offa
Copy link
Owner

offa commented Mar 20, 2023

Can you reproduce the issue with plain curl requests?

@ronytigo
Copy link
Author

I'll check how I can add a bucket using the api.

@ronytigo
Copy link
Author

@offa

curl --location '<ip>:8086/api/v2/buckets' \
--header 'Authorization: Token <token>' \
--header 'Content-Type: text/plain' \
--data '{
  "description": "abcd bucket",
  "name": "abcd",
  "orgID": "<orgID>",
  "retentionRules": [
  ],
  "rp": "0",
  "schemaType": "implicit"
}'

and

curl --location '<ip>:8086/api/v2/buckets' \
--header 'Authorization: Token <token>' \
--header 'Content-Type: text/plain' \
--data '{
  "description": "Abucket",
  "name": "A",
  "orgID": "<orgID>",
  "retentionRules": [
  ],
  "rp": "0",
  "schemaType": "implicit"
}'

and

curl --location '<ip>:8086/query?q=show%20databases' \
--header 'Authorization: Token <token>' \
--header 'Content-Type: text/plain' \
--data '{{body}}'

@offa
Copy link
Owner

offa commented Mar 21, 2023

What's the result of those? Were you able to reproduce the issue?

@ronytigo
Copy link
Author

Yes, the buckets are created and only A is returned from /query?q=show databases.

@offa
Copy link
Owner

offa commented Mar 22, 2023

Wired …

If I understand aright, you do get the same behaviour with plain curl calls?

influxdb->execute(…) returns the response unchanged and eventually boils down to calling libcurl. You may have a look at the raw response (here).

@ronytigo
Copy link
Author

Why should I look here if the problem occurs when I use plain curl calls? I already see a wrong response.

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

No branches or pull requests

2 participants