influxdata / influxdata/influxdata-docker
influxdb docker-entrypoint-initdb.d not working for .iql file
- Dominant language
- Shell
- Stars
- 364
- Forks
- 255
- Avg merge
- 3h 18m
- Merged PRs (30d)
- 7
Description
I Use influxdb 1.8.4 image on debian 10.
When I put .iql file in docker-entrypoint-initdb.d directory. They are not executed.
I debugged init-influxdb.sh there is multiple factors :
- If INFLUXDB_INIT_PORT is ommited, INFLUX_CMD is not properly initialized.
- When loading a .iql file with INFLUX_CMD, it seems we cannot use -execute "$(cat ""$f"")". Influx respond something like "empty input".
Fix: I pipe the file into influx with cat
INFLUX_CMD2="influx -host 127.0.0.1 -port $INFLUXDB_INIT_PORT -username ${INFLUXDB_ADMIN_USER} -password ${INFLUXDB_ADMIN_PASSWORD}"
cat "$f" | $INFLUX_CMD
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with init-influxdb.sh and trace how INFLUXDB_INIT_PORT initializes INFLUX_CMD and how .iql files are passed to influx. Reproduce the initialization with an omitted port and a .iql file, then verify both cases execute successfully using the reported pipe-based behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, shell
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100