influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

Environment variables should be prefixed with `INFLUXDB3_`

Open ikonia opened this issue 7 months ago • 4 comments

Steps to reproduce:

  1. Download and deploy InfluxDB 3 Core container from docker hub with default options
  2. View error log complaining of start up failure
  3. Attempt to map environment variable names to influx3 parameters/options
  4. View default environment variables that ship with container

Expected behaviour: Consistent naming convention for influx environmental parameters that honour settings.

From reading and engagement with people @pauldix on Influx slack there is an expectation that all influx parameters will be prefixed with INFLUXDB3_.

Actual behaviour: The default docker container ships with these environment parameters by default:

ENV INFLUXDB3_PLUGIN_DIR=/plugins
ENV INFLUXDB3_DATA_DIR=/home/influxdb3/.influxdb3
ENV INFLUXDB_IOX_DB_DIR=/var/lib/influxdb3
ENV LOG_FILTER=info

You can see from the default set of parameters that this does not meet the expectation.

Additional context:

Upon debugging issues and setting the following parameter: INFLUXDB3_OBJECT_STORE=file this parameter is honoured as it should be; however, INFLUXDB3_DATA_DIR and INFLUXDB_IOX_DB_DIR, which are set by default are not honoured, as start up will error with the following:

Serve command failed: Cannot parse object store config: Specified File for the object store, required configuration missing for data-dir

which according to the docs should be picked up with INFLUXDB3_DATA_DIR's destination.

Environment info:

Tested on a Fedora 40 host, current patch level using podman, as well as a Synology NAS

  • Fedora 40 Podman 5.4.2
  • Synology NAS docker 24.0.2

Config:

Example config file being used to deploy the container

{
  "CapAdd": null,
  "CapDrop": null,
  "cmd": "influxdb3 serve",
  "cpu_priority": 50,
  "enable_publish_all_ports": false,
  "enable_restart_policy": false,
  "enable_service_portal": false,
  "enabled": true,
  "env_variables": [
    {
      "key": "PATH",
      "value": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    },
    {
      "key": "INFLUXDB_VERSION",
      "value": "3.0.3"
    },
    {
      "key": "INFLUXDB3_PLUGIN_DIR",
      "value": "/plugins"
    },
    {
      "key": "INFLUXDB3_DATA_DIR",
      "value": "/home/influxdb3/.influxdb3"
    },
    {
      "key": "INFLUXDB_IOX_DB_DIR",
      "value": "/var/lib/influxdb3"
    },
    {
      "key": "LOG_FILTER",
      "value": "info"
    },
    {
      "key": "INFLUXDB3_NODE_IDENTIFIER_PREFIX",
      "value": "test01"
    },
    {
      "key": "INFLUXDB3_OBJECT_STORE",
      "value": "File"
    }
    
  ],
  "exporting": false,
  "id": "3f4da0e0bc7f2f953d1a80926c77551100478976a975dfb0dc908a64cdb671e8",
  "image": "influxdb:3-core",
  "is_ddsm": false,
  "is_package": false,
  "labels": {
    "org.opencontainers.image.ref.name": "ubuntu",
    "org.opencontainers.image.version": "24.04"
  },
  "links": [],
  "memory_limit": 0,
  "name": "influx3-prod",
  "network": [
    {
      "driver": "host",
      "name": "host"
    }
  ],
  "network_mode": "host",
  "port_bindings": [],
  "privileged": false,
  "service_portals": [],
  "shortcut": {
    "enable_shortcut": false,
    "enable_status_page": false,
    "enable_web_page": false,
    "web_page_url": ""
  },
  "use_host_network": true,
  "version": 2,
  "volume_bindings": [
    {
      "host_volume_file": "/docker/influx3/plugins",
      "is_directory": true,
      "mount_point": "/plugins",
      "type": "rw"
    }
  ]
}

Logs:

N/A

ikonia avatar May 26 '25 16:05 ikonia

@ikonia thanks for opening the issue. I opened https://github.com/influxdata/influxdb/pull/26461 to update the Dockerfile to use the correct environment variables.

Regarding the following:

Upon debugging issues and setting the following parameter (real world example) INFLUXDB3_OBJECT_STORE=File this parameter is honoured as it should be, however, INFLUXDB3_DATA_DIR and INFLUXDB_IOX_DB_DIR which are set by default are not honoured, as start up will error. " Serve command failed: Cannot parse object store config: Specified File for the object store, required configuration missing for data-dir "

The correct environment variable to set --data-dir is INFLUXDB3_DB_DIR. There was a mistake in the Dockerfile addressed by the above PR.

There still are environment variables that do not use the INFLUXDB3_ prefix:

  • Logging: uses LOG_, e.g., LOG_FILTER
  • Tracing: uses TRACES_, e.g., TRACES_EXPORTER
  • Some of the cloud-provider-specific object store settings, e.g., AWS_ACCESS_KEY_ID, GOOGLE_SERVICE_ACCOUNT, etc.

If we are to address those by prefixing with INFLUXDB3_, then we may need to do it in a backward compatible fashion.

hiltontj avatar May 26 '25 17:05 hiltontj

Ahhh right, that's a good point. Should all of these have INFLUXDB3_ prepended to them? My gut feeling is yes, but you're right that we'd need to keep the old options around for people that have already started using those. We could deprecate and then remove them for real after some number of point releases.

pauldix avatar May 26 '25 17:05 pauldix

Should all of these have INFLUXDB3_ prepended to them?

I think yes. The only concern I have is if the cloud-provider ones are adhering to some pseudo-standard way of providing credentials for the respective provider; but, if we do this in a backward compatible way, e.g., support AWS_ACCESS_KEY_ID and INFLUXDB3_ AWS_ACCESS_KEY_ID, then it shouldn't matter.

hiltontj avatar May 26 '25 17:05 hiltontj

Yeah, let's do both then

pauldix avatar May 26 '25 17:05 pauldix