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

V1 write API doesn't handle buckets that don't fit the "db/rp" pattern #19949

Closed
danxmoran opened this issue Nov 9, 2020 · 3 comments
Closed
Assignees
Labels

Comments

@danxmoran
Copy link
Contributor

danxmoran commented Nov 9, 2020

Steps to reproduce:
List the minimal actions needed to reproduce the behavior.

  1. Create a test bucket using influx setup
  2. Create a test-user V1 token using influx v1 auth create, granting write access on the bucket
  3. Attempt to write data using the test-user token and the write API:
curl -u test-user:${TEST_PWD} localhost:8086/write\?db=test -d "cpu foo=10,bar=11"

Expected behavior:
The write should succeed

Actual behavior:
The write fails with a permissions error. Running influx bucket list shows a new test/autogen bucket has been created.

By stepping through the code, I was able to find that the V1 API:

  1. Checks if an RP was given in the command, and uses "autogen" if not
  2. Checks for the presence of the bucket named "db/rp", creating it if not found
  3. Attempts to write into the new bucket

Step 3 fails the auth check because the user is authorized to write into "test", not "test/autogen"

@stuartcarnie
Copy link
Contributor

@danxmoran I believe this will be resolved with #19945

@danxmoran
Copy link
Contributor Author

If not by that, then I'd expect by #19954

@stuartcarnie
Copy link
Contributor

This is no longer an issue, as we're not auto-creating buckets and DB/RP mappings. We have verified that writes are now working after mappings are setup.

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

No branches or pull requests

2 participants