bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
9k stars 9.21k forks source link

influxdb cannot running when providing initdbScripts #13153

Closed FeiYing9 closed 1 year ago

FeiYing9 commented 2 years ago

Name and Version

bitnami/infludb 4.0.12

What steps will reproduce the bug?

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.0", GitCommit:"c2b5237ccd9c0f1d600d3072634ca66cefdf272f", GitTreeState:"clean", BuildDate:"2021-08-04T18:03:20Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.0", GitCommit:"c2b5237ccd9c0f1d600d3072634ca66cefdf272f", GitTreeState:"clean", BuildDate:"2021-08-04T17:57:25Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}

$ helm version
version.BuildInfo{Version:"v3.9.0", GitCommit:"7ceeda6c585217a19a1131663d8cd1f7d641b2a7", GitTreeState:"clean", GoVersion:"go1.17.5"}

Are you using any custom parameters or values?

my extra custom values like this:

image:
  debug: true

architecture: high-availability
auth:
  admin:
    username: admin
    password: admin
  user:
    username: influx
    password: influx

influxdb:
  replicaCount: 1 
  initdbScripts:   
    vcloud.txt: |-
      CREATE DATABASE console WITH REPLICATION 3 SHARD DURATION 168h SHARD BUCKET 1;

persistence:
  enabled: true
  size: 8Gi

What do you see instead?

$ kubectl get po -owide -w | grep influx
influxdb-0                            0/1     Error               0             8s

$ kubectl  logs -f influxdb-0
influxdb 17:21:34.34
influxdb 17:21:34.34 Welcome to the Bitnami influxdb container
influxdb 17:21:34.34 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-influxdb
influxdb 17:21:34.35 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-influxdb/issues
influxdb 17:21:34.35
influxdb 17:21:34.35 INFO  ==> ** Starting InfluxDB setup **
influxdb 17:21:34.38 DEBUG ==> Validating settings in INFLUXDB_* env vars...
influxdb 17:21:34.39 INFO  ==> No injected configuration files found. Creating default config files...
influxdb 17:21:34.39 INFO  ==> influx CLI configuration /opt/bitnami/influxdb/etc/influxdb.conf detected!
influxdb 17:21:34.39 INFO  ==> Deploying InfluxDB with persisted data
influxdb 17:21:34.40 INFO  ==> Loading user's custom files from /docker-entrypoint-initdb.d ...
influxdb 17:21:34.40 INFO  ==> Starting InfluxDB in background...
ts=2022-10-26T09:21:34.599725Z lvl=info msg="Welcome to InfluxDB" log_id=0dluOwXl000 version=v2.2.0 commit=a2f8538 build_date=2022-10-26T09:21:34Z
ts=2022-10-26T09:21:34.614456Z lvl=info msg="Resources opened" log_id=0dluOwXl000 service=bolt path=/bitnami/influxdb/influxd.bolt
ts=2022-10-26T09:21:34.614596Z lvl=info msg="Resources opened" log_id=0dluOwXl000 service=sqlite path=/bitnami/influxdb/influxd.sqlite
ts=2022-10-26T09:21:34.643169Z lvl=info msg="Checking InfluxDB metadata for prior version." log_id=0dluOwXl000 bolt_path=/bitnami/influxdb/influxd.bolt
ts=2022-10-26T09:21:34.643313Z lvl=info msg="Using data dir" log_id=0dluOwXl000 service=storage-engine service=store path=/bitnami/influxdb/data
ts=2022-10-26T09:21:34.643594Z lvl=info msg="Compaction settings" log_id=0dluOwXl000 service=storage-engine service=store max_concurrent_compactions=4 throughput_bytes_per_second=50331648 throughput_bytes_per_second_burst=50331648
ts=2022-10-26T09:21:34.643615Z lvl=info msg="Open store (start)" log_id=0dluOwXl000 service=storage-engine service=store op_name=tsdb_open op_event=start
ts=2022-10-26T09:21:34.643885Z lvl=info msg="Open store (end)" log_id=0dluOwXl000 service=storage-engine service=store op_name=tsdb_open op_event=end op_elapsed=0.272ms
ts=2022-10-26T09:21:34.643920Z lvl=info msg="Starting retention policy enforcement service" log_id=0dluOwXl000 service=retention check_interval=30m
ts=2022-10-26T09:21:34.643933Z lvl=info msg="Starting precreation service" log_id=0dluOwXl000 service=shard-precreation check_interval=10m advance_period=30m
ts=2022-10-26T09:21:34.647120Z lvl=info msg="Starting query controller" log_id=0dluOwXl000 service=storage-reads concurrency_quota=1024 initial_memory_bytes_quota_per_query=9223372036854775807 memory_bytes_quota_per_query=9223372036854775807 max_memory_bytes=0 queue_size=1024
ts=2022-10-26T09:21:34.649750Z lvl=info msg="Configuring InfluxQL statement executor (zeros indicate unlimited)." log_id=0dluOwXl000 max_select_point=0 max_select_series=0 max_select_buckets=0
ts=2022-10-26T09:21:34.694010Z lvl=info msg=Listening log_id=0dluOwXl000 service=tcp-listener transport=http addr=0.0.0.0:8086 port=8086
ts=2022-10-26T09:21:34.694054Z lvl=info msg=Starting log_id=0dluOwXl000 service=telemetry interval=8h
influxdb 17:21:34.93 DEBUG ==> Executing /docker-entrypoint-initdb.d/..2022_10_26_09_21_28.011260454/vcloud.txt
Incorrect Usage. flag provided but not defined: -host

Error: flag provided but not defined: -host
NAME:
   influx - Influx Client

USAGE:
   influx [command]

COMMANDS:
   version              Print the influx CLI version
   write                Write points to InfluxDB
   bucket               Bucket management commands
   completion           Generates completion scripts
   query                Execute a Flux query
   config               Config management commands
   org, organization    Organization management commands
   delete               Delete points from InfluxDB
   user                 User management commands
   task                 Task management commands
   telegrafs            List Telegraf configuration(s). Subcommands manage Telegraf configurations.
   dashboards           List Dashboard(s).
   export               Export existing resources as a template
   secret               Secret management commands
   v1                   InfluxDB v1 management commands
   auth, authorization  Authorization management commands
   apply                Apply a template to manage resources
   stacks               List stack(s) and associated templates. Subcommands manage stacks.
   template             Summarize the provided template
   bucket-schema        Bucket schema management commands
   ping                 Check the InfluxDB /health endpoint
   setup                Setup instance with initial user, org, bucket
   backup               Backup database
   restore              Restores a backup directory to InfluxDB
   remote               Remote connection management commands
   replication          Replication stream management commands
   server-config        Display server config
   help, h              Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h  show help
influxdb 17:21:34.94 INFO  ==> Stopping InfluxDB...

Additional information

the exec commands like this:

influx -host 127.0.0.1 -port xxx -username xxx -password xxx -execute `cat $file`
github-actions[bot] commented 1 year ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

corico44 commented 1 year ago

Hello @FeiYing9,

Thank you very much for your contribution. I have created a task internally to review this error. We currently have a lot on our plate. For this reason, we will notify you in this same issue when the error has been solved.

fevisera commented 1 year ago

Hi @FeiYing9,

Unfortunately, InfluxDB 2.x does not support creating databases. Instead, databases have been replaced by buckets. You can create a bucket by following this guide.

A similar command to create a bucket based on your database creation statement could look like this:

$ influx bucket create -n console --org-id <your_org_id> --shard-group-duration 168h -t <your_token>

Removing the unsupported customization, your customization file should resemble the following:

image:
  debug: true

architecture: high-availability
auth:
  admin:
    username: admin
    password: adminpassword
  user:
    username: influx
    password: influxpassword

persistence:
  enabled: true
  size: 8Gi

Note that for current versions, the InfluxDB UI has changed. You can now find and generate tokens from a different menu: Untitled

Please, let us know if that answers your issue. Thank you.

FeiYing9 commented 1 year ago

thanks a lot, that's the answers