Commit Graph

35273 Commits (master)

Author SHA1 Message Date
Jeffrey Smith II a10adf6b0e
feat: add fields to tasks bucket to match cloud (#23406)
* feat: add name field to tasks bucket to match cloud (#23156)

* refactor: Cleanup function signature

* feat: add more fields
2022-06-08 14:19:00 -04:00
Dane Strandboge 910d5a2bac
build: upgrade Go to 1.18.3 (#23410) 2022-06-07 13:09:28 -05:00
davidby-influx 8c9768cdb7
fix: replace unprintable and invalid characters in errors (#23387) (#23395)
Replace unprintable and invalid characters with '?'
in logged errors.  Truncate consecutive runs of them to
only 3 repeats of '?'

closes https://github.com/influxdata/influxdb/issues/23386

(cherry picked from commit 0ae0bd6e2e)

closes https://github.com/influxdata/influxdb/issues/23389
2022-06-01 14:42:51 -07:00
Jamie Strandboge ab8be8016b
chore: update jsonparser to 1.1.1 and yaml.v3 to 3.0.1 (#23385)
* chore: update jsonparser to 1.1.1 and yaml.v3 to 3.0.1

Perform:

  $ go mod edit -require github.com/buger/jsonparser@v1.1.1
  $ go mod edit -require gopkg.in/yaml.v3@v3.0.1
  $ go mod tidy

* chore(tests): adjust for whitespace in test output
2022-06-01 11:20:37 -05:00
Sean Brickley 8f54774146
build(flux): update flux to v0.169.0 (#23384) 2022-05-31 14:05:57 -04:00
Dane Strandboge 9e20f9f3dc
feat: add signifier to replication user agent (#23370) 2022-05-31 11:50:53 -05:00
Jonathan A. Sternberg 2e9e174c24
fix(query/control): add all of the statistics from flux statistics instead of only metadata (#23375)
This changes the statistics merging to use the `Add` method on the
entire statistics struct instead of only the metadata. The purpose of
this is that we want to utilize the existing function for merging the
statistics so that additional properties can be added without modifying
the query controller.

At the same time, there are certain properties that are computed in the
controller and we want to ensure they aren't double counted if flux
starts computing these itself. So we blacklist certain attributes that
we compute so that if flux is modified to return these values, we just
ignore them until we change our own code to use those values.

In immediate terms, we're changing to use the `Add` method so that we
can add profiles to the statistics and have those profiles propagate to
the query controller. This property doesn't exist yet so we can't add it
and we don't want to add it after flux is modified because it could
break the operator profile.

But, we also don't want to only use `Add` because we want to move the
properties such as `TotalAllocated` and `TotalDuration` into flux itself
and to remove the controller. But, the controller needs to be compatible
with whatever changes we make to flux so that there's no circumstance
where functionality stops working.
2022-05-26 09:28:18 -05:00
Brandon Pfeifer afd0b99bdb
build: update changelogger to ignore case when parsing verbs (#23369) 2022-05-24 16:08:04 -04:00
Nathaniel Cook 6222ea2ef8
build(flux): update flux to v0.168.0 (#23363) 2022-05-23 16:44:33 -06:00
Brandon Pfeifer d9065071e9
chore: upgrade flux to v0.167.0 (#23348)
* fix(fluxtest): update Flux tests for new option support

The Flux test harness now allows inheriting options, this updates the
test cases with the new syntax and simplifies any tests that had to
duplicate the options.

* build(flux): update flux to v0.165.0

* chore: upgrade flux to v0.167.0

Co-authored-by: Nathaniel Cook <nvcook42@gmail.com>
Co-authored-by: Paul Hummer <paul@eventuallyanyway.com>
2022-05-17 15:59:44 -04:00
davidby-influx 9c33764b6d
fix: do not panic on cleaning up failed iterators (#21666) (#23319)
We have seen occasional panics in Iterators.Close()
when cleaning up after failed iterator creation.
This commit checks for nil on any iterator to be
closed, and now returns any errors generated by
that Close().

Closes https://github.com/influxdata/influxdb/issues/19579
Closes https://github.com/influxdata/influxdb/issues/19476

(cherry picked from commit acc4105b8c)

closes https://github.com/influxdata/influxdb/issues/23271
2022-04-29 14:21:21 -07:00
Jacob Marble 71a02c2d40
chore: remove previous semantic pull request config (#23305)
* chore: remove previous semantic pull request config

* chore: update pull request template, conventional commit version
2022-04-27 10:27:30 -04:00
Geoffrey Wossum 30a9fd43f6
fix: MeasurementsCardinality should not be less than 0 (#23304)
Clamp the value of Store.MeasurementsCardinality so that it can not be less
than 0. This primarily shows up as a negative numMeasurements value in
/debug/vars under some circumstances.

refs #23285

(cherry picked from commit 160cf678d5)
2022-04-26 23:37:09 -05:00
Jacob Marble 438eadc879
chore: use common semantic PR and commit message checks (#23300)
After this is merged, the old semantic checker can be disabled, and its config file removed from the repository.
2022-04-26 11:30:48 -07:00
Paul Hummer 1805f4b575
build(flux): update flux to v0.164.1 (#23280) 2022-04-19 10:03:18 -06:00
Dane Strandboge 05840ce2a6
fix(systemd): fix operator in host detection (#23276)
original PR: #22859
2022-04-14 15:14:10 -05:00
Alfonso Acosta c535994992
fix: remove controller 64bit misalignment (#23260)
See https://pkg.go.dev/sync/atomic#pkg-note-BUG fore more details
2022-04-14 14:22:47 -05:00
Nathaniel Cook 24f64a735f
fix(annotations): skip flaky annotation tests (#23275)
See https://github.com/influxdata/influxdb/issues/23272
2022-04-14 11:00:29 -06:00
Dane Strandboge 82d1123e78
build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
Paul Hummer cf1f2e2414
build(flux): update flux to v0.164.0 (#23269) 2022-04-13 13:43:17 -06:00
Jonathan A. Sternberg bb849050b1
build(flux): update flux to v0.163.0 (#23259) 2022-04-08 10:07:25 -05:00
Jonathan A. Sternberg 72c4c55609
build(flux): update flux to v0.162.0 (#23255) 2022-04-05 16:10:41 -05:00
Dane Strandboge 359fcc46b5
feat: add maximum age to replication queues (#23206)
Co-authored-by: Sam Arnold <sarnold@influxdata.com>
2022-03-25 13:06:05 -05:00
Jonathan A. Sternberg 89916ec98a
build(flux): update flux to v0.161.0 (#23227) 2022-03-24 16:27:32 -05:00
Jonathan A. Sternberg 5231d2d197
feat(query): enable the mqtt pool dialer by default (#23226) 2022-03-24 12:35:10 -05:00
Phil Bracikowski 050449803a
fix(models): reset provided slice correctly (#23223)
A preallocated slice needs to be cleared to be used with append,
otherwise the existing elements will be seen in the result and this does
not appear to be the intention. The bug doesn't seem to have caused
issues as no callsites use a preallocated slice.
2022-03-24 07:37:48 -07:00
Jamie Strandboge e304ef9764
fix: add write permissions check for DELETE and DROP MEASUREMENT (#23219)
We previously allowed read tokens access to all of v1 query, including
InfluxQL queries that made state changes to the DB, specifically,
'DELETE' and 'DROP MEASUREMENT'. This allowed tokens with only read
permissions to delete points via the legacy /query endpoint.
/api/v2/query was unaffected.

This adjusts the behavior to verify that the token has write permissions
when specifying 'DELETE' and 'DROP MEASUREMENT' InfluxQL queries. We
follow the same pattern as other existing v1 failure scenarios and
instead of failing hard with 401, we use ectx.Send() to send an error to
the user (with 200 status):

{"results":[{"statement_id":0,"error":"insufficient permissions"}]}

Returning in this manner is consistent with Cloud 2, which also returns
200 with "insufficient permissions" for these two InfluxQL queries.

To facilitate authorization unit tests, we add MustNewPermission() to
testing/util.go.

Closes: #22799
2022-03-24 07:28:38 -05:00
Jonathan A. Sternberg 5e3ea7b94c
refactor(flux): convert the allocator into an interface (#23214)
This follows the changes from influxdata/flux#4539.
2022-03-22 12:33:52 -05:00
Jamie Strandboge 2c930fd127
feat: add --hardening-enabled option to limit flux/pkger HTTP requests (#23207)
Flux HTTP and template fetching requests do not perform IP address
checks for local addresses. This behavior on the one hand allows SSRF
(Server Side Request Forgery) attacks via authenticated requests but on
the other hand is useful for scenarios that have legitimate requirements
to fetch from private addresses (eg, hosting templates internally or
performing flux queries to local resources during development).

To not break existing installations, the default behavior will remain
the same but a new --hardening-enabled option is added to influxd to
turn on IP address verification and limit both flux and template
fetching HTTP requests to non-private addresses. We plan to enable new
security features that aren't suitable for the default install with this
option.  Put another way, this new option is intended to be used to make
it easy to turn on all security options when running in production
environments. The 'Manage security and authorization' section of the
docs will also be updated for this option.

Specifically for flux, when --hardening-enabled is specified, we now
pass in PrivateIPValidator{} to the flux dependency configuration. The
flux url validator will then tap into the http.Client 'Control'
mechanism to validate the IP address since it is called after DNS lookup
but before the connection starts.

For pkger (template fetching), when --hardening-enabled is specified,
the template parser's HTTP client will be configured to also use
PrivateIPValidator{}. Note that /api/v2/stacks POST ('init', aka create)
and PATCH ('update') only store the new url to be applied later with
/api/v2/templates/apply. While it is possible to have InitStack() and
UpdateStack() mimic net.DialContext() to setup a go routine to perform a
DNS lookup and then loop through the returned addresses to verify none
are for a private IP before storing the url, this would add considerable
complexity to the stacks implementation. Since the stack's urls are
fetched when it is applied and the IP address is verified as part of
apply (see above), for now we'll keep this simple and not validate the
IPs of the stack's urls during init or update.

Lastly, update pkger/http_server_template_test.go's Templates() test for
disabled jsonnet to also check the contents of the 422 error (since the
flux validator also returns a 422 with different message). Also, fix the
URL in one of these tests to use a valid path.
2022-03-18 10:25:31 -04:00
Sam Arnold a40e12b615
feat: allow changing a password with `influxd recovery user update` (#23202)
Closes: #23158
2022-03-18 08:04:29 -04:00
Sam Arnold 3ec5a570e5
fix: tell browser about cookie expiry (#23201)
Closes #17142
2022-03-18 08:04:15 -04:00
Dane Strandboge dedaa7f092
chore: upgrade to go1.17.8 (#23209) 2022-03-17 13:56:33 -05:00
Sam Arnold 253451b5b5
test: unskip flux group tests (#23193) 2022-03-15 16:12:51 -04:00
Sam Arnold df01d93d8b
fix: allow flux http calls to be unlimited (#23191) 2022-03-15 10:01:20 -04:00
Andrew Charlton 4e08604e48
feat: Add MeasurementNames method to MeasurementFieldSet (#23173) 2022-03-15 10:21:38 +00:00
Sean Brickley 7d310c2241
build(flux): update flux to v0.159.0 (#23190) 2022-03-14 13:43:53 -04:00
Sam Arnold 7c0ec4dd2c
fix: replications replicates flux to() writes (#23188)
Fixes a few issues:
* flux needs to write to the replication service, instead of the engine directly.
* the replication service incorrectly had value receiver methods, I think this
was just an accident. Pointer receivers make things easier to reason about. Also
with value receivers flux was not picking up the replication config properly.
* The flux to() function previously did not receive the org properly for internal
writes. Previously this was not necessary as the write path only needs the bucket
ID at this level (after authentication). But now we need the org id to look up
replications properly.

Closes #23183
2022-03-14 12:17:58 -04:00
Sam Arnold 49ce57c029
fix: remove telegraf endpoint pagination (#23182)
This matches InfluxDB Cloud. The pagination was not exposed to the API,
but meant that API requests were limited to the default 20 pages.

Closes: #21407
2022-03-14 12:17:43 -04:00
Paul Hummer 36df687aa8
build(flux): update flux to v0.158.0 (#23175)
* build(flux): update flux to v0.158.0
* chore(upgrade_arrow): upgrade to apache arrow 7
2022-03-10 10:54:41 -08:00
wiedld 355d32b0cf
chore: update OSS ci pipeline to match the updates to monitor-ci (#23169) 2022-03-09 13:17:35 -08:00
mcfarlm3 0c5bedfd98
refactor: improve logging during influxd upgrade to give mapping metadata at info level (#23117) 2022-02-28 16:30:18 -06:00
Jonathan A. Sternberg adf29dfedf
feat(kit/feature): allow influxdb to set flux feature flags (#23123) 2022-02-24 15:29:17 -06:00
Sam Arnold e5ccbb8831
fix: forbid reading OSS buckets for a token with only write permissions (#23148)
* fix: forbid reading OSS buckets for a token with only write permissions

We previously enabled write tokens to also find DBRP buckets, in order to allow
the legacy /write (not /api/v2/write) endpoint to read the DBRP mappings and
find the real bucket id to write to.

This had the unintended consequency of allowing tokens with only write permissions
to read data in buckets via the legacy /query (not /api/v2/query) endpoint with
InfluxQL.

This change fixes the behaviour to allow writing to /write with a write-only
token, while forbidding reading from /query.

* fix: nanosecond precision in tests
2022-02-24 09:59:14 -05:00
Jonathan A. Sternberg afb9733072
build(flux): update flux to v0.156.0 (#23142)
* build(flux): update flux to v0.156.0

* chore(flux/schema): update schema tests to assert planner rules

The schema test where updated in Flux, this updates them here so that we
can assert that the planner rules are applied. See note about copied
data.

Co-authored-by: Nathaniel Cook <nvcook42@gmail.com>
2022-02-22 13:27:23 -06:00
Jonathan A. Sternberg c4717ef469
refactor(query): remove detailed query traces (#23125)
We're removing this functionality from flux because it doesn't work
properly so remove the invocations here.
2022-02-17 11:54:38 -06:00
Dane Strandboge 0bd28f66bc
fix: update 422 dry-run response to conform to API spec (#23121) 2022-02-11 16:28:49 -06:00
Jonathan A. Sternberg 34c150f65c
build(flux): update flux to v0.154.0 (#23116) 2022-02-11 15:44:51 -06:00
Sam Arnold e20b5e99a6
fix: remove nats for scraper processing (#23107)
* fix: remove nats for scraper processing

Scrapers now use go channels instead of NATS and interprocess communication.
This should fix #23085 .

Additionally, found and fixed #23106 .

* chore: fix formatting

* chore: fix static check and go.mod

* test: fix some flaky tests

* fix: mark NATS arguments as deprecated
2022-02-10 11:23:18 -05:00
Sean Brickley f68758bd94
build(flux): update flux to v0.152.0 (#23086)
* build(flux): update flux to v0.152.0

* chore: use latest cross-builder image
2022-02-04 09:38:36 -05:00
Brandon Pfeifer 64615f462b
chore: remove unused dockerfile (#23100) 2022-02-03 15:12:56 -05:00