Skip to content

DB initialization is broken when INFLUXDB_HTTP_AUTH_ENABLED is used #224

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

Open
Equidamoid opened this issue May 12, 2018 · 10 comments
Open

Comments

@Equidamoid
Copy link

Equidamoid commented May 12, 2018

Tried it with :1.5, :1.5-alpine, :1.4, the log is more or less the same:

+ docker run --rm --name=influxdb -p 8086:8086 -p 2003:2003 -e INFLUXDB_DB=test -e INFLUXDB_HTTP_AUTH_ENABLED=1 -e INFLUXDB_ADMIN_USER=dbroot -v influxdb:/var/lib/influxdb influxdb:1.5
influxdb init process in progress...
ts=2018-05-12T12:49:22.247503Z lvl=info msg="InfluxDB starting" log_id=0816DeHl000 version=1.5.2 branch=1.5 commit=02d7d4f043b34ecb4e9b2dbec298c6f9450c2a32
ts=2018-05-12T12:49:22.247778Z lvl=info msg="Go runtime" log_id=0816DeHl000 version=go1.9.2 maxprocs=1
ts=2018-05-12T12:49:22.401471Z lvl=info msg="Using data dir" log_id=0816DeHl000 service=store path=/var/lib/influxdb/data
ts=2018-05-12T12:49:22.403338Z lvl=info msg="Open store (start)" log_id=0816DeHl000 service=store trace_id=0816Detl000 op_name=tsdb_open op_event=start
ts=2018-05-12T12:49:22.404857Z lvl=info msg="Open store (end)" log_id=0816DeHl000 service=store trace_id=0816Detl000 op_name=tsdb_open op_event=end op_elapsed=1.533ms
ts=2018-05-12T12:49:22.405348Z lvl=info msg="Opened service" log_id=0816DeHl000 service=subscriber
ts=2018-05-12T12:49:22.405759Z lvl=info msg="Starting monitor service" log_id=0816DeHl000 service=monitor
ts=2018-05-12T12:49:22.406430Z lvl=info msg="Registered diagnostics client" log_id=0816DeHl000 service=monitor name=build
ts=2018-05-12T12:49:22.406455Z lvl=info msg="Registered diagnostics client" log_id=0816DeHl000 service=monitor name=runtime
ts=2018-05-12T12:49:22.406492Z lvl=info msg="Registered diagnostics client" log_id=0816DeHl000 service=monitor name=network
ts=2018-05-12T12:49:22.406508Z lvl=info msg="Registered diagnostics client" log_id=0816DeHl000 service=monitor name=system
ts=2018-05-12T12:49:22.406746Z lvl=info msg="Starting precreation service" log_id=0816DeHl000 service=shard-precreation check_interval=10m advance_period=30m
ts=2018-05-12T12:49:22.407587Z lvl=info msg="Starting snapshot service" log_id=0816DeHl000 service=snapshot
ts=2018-05-12T12:49:22.407605Z lvl=info msg="Starting continuous query service" log_id=0816DeHl000 service=continuous_querier
ts=2018-05-12T12:49:22.407616Z lvl=info msg="Starting HTTP service" log_id=0816DeHl000 service=httpd authentication=true
ts=2018-05-12T12:49:22.407625Z lvl=info msg="opened HTTP access log" log_id=0816DeHl000 service=httpd path=stderr
ts=2018-05-12T12:49:22.407719Z lvl=info msg="Listening on HTTP" log_id=0816DeHl000 service=httpd addr=127.0.0.1:8086 https=false
ts=2018-05-12T12:49:22.407769Z lvl=info msg="Starting retention policy enforcement service" log_id=0816DeHl000 service=retention check_interval=30m
ts=2018-05-12T12:49:22.407885Z lvl=info msg="Listening for signals" log_id=0816DeHl000
ts=2018-05-12T12:49:22.409321Z lvl=info msg="Storing statistics" log_id=0816DeHl000 service=monitor db_instance=_internal db_rp=monitor interval=10s
ts=2018-05-12T12:49:22.410203Z lvl=info msg="Sending usage statistics to usage.influxdata.com" log_id=0816DeHl000
[httpd] 127.0.0.1 - - [12/May/2018:12:49:23 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" e549969a-55e2-11e8-8001-000000000000 214
[httpd] 127.0.0.1 - - [12/May/2018:12:49:23 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" e549c86b-55e2-11e8-8002-000000000000 280
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:24 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" e5e4f81d-55e2-11e8-8003-000000000000 44
[httpd] 127.0.0.1 - - [12/May/2018:12:49:24 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" e5e51759-55e2-11e8-8004-000000000000 97
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:25 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" e67f8c18-55e2-11e8-8005-000000000000 73
[httpd] 127.0.0.1 - - [12/May/2018:12:49:25 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" e67fb803-55e2-11e8-8006-000000000000 238
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:26 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" e71ab3f7-55e2-11e8-8007-000000000000 45
[httpd] 127.0.0.1 - - [12/May/2018:12:49:26 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" e71acfac-55e2-11e8-8008-000000000000 98
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:27 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" e7b542ed-55e2-11e8-8009-000000000000 74
[httpd] 127.0.0.1 - - [12/May/2018:12:49:27 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" e7b56ffb-55e2-11e8-800a-000000000000 156
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:28 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" e85089df-55e2-11e8-800b-000000000000 55
[httpd] 127.0.0.1 - - [12/May/2018:12:49:28 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" e850b055-55e2-11e8-800c-000000000000 132
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:29 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" e8ec0567-55e2-11e8-800d-000000000000 44
[httpd] 127.0.0.1 - - [12/May/2018:12:49:29 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" e8ec241a-55e2-11e8-800e-000000000000 89
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:30 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" e9875d04-55e2-11e8-800f-000000000000 132
[httpd] 127.0.0.1 - - [12/May/2018:12:49:30 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" e987a3d2-55e2-11e8-8010-000000000000 107
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:31 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" ea22f3c0-55e2-11e8-8011-000000000000 136
[httpd] 127.0.0.1 - - [12/May/2018:12:49:31 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" ea23483c-55e2-11e8-8012-000000000000 90
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:32 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" eabec11b-55e2-11e8-8013-000000000000 296
[httpd] 127.0.0.1 - - [12/May/2018:12:49:32 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" eabef722-55e2-11e8-8014-000000000000 106
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:33 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" eb595a51-55e2-11e8-8015-000000000000 54
[httpd] 127.0.0.1 - - [12/May/2018:12:49:33 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" eb598ea4-55e2-11e8-8016-000000000000 113
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:34 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" ebf3e5e3-55e2-11e8-8017-000000000000 72
[httpd] 127.0.0.1 - - [12/May/2018:12:49:34 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" ebf41298-55e2-11e8-8018-000000000000 163
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:35 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" ec8f1011-55e2-11e8-8019-000000000000 74
[httpd] 127.0.0.1 - - [12/May/2018:12:49:35 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" ec8f3b65-55e2-11e8-801a-000000000000 229
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:36 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" ed2a7332-55e2-11e8-801b-000000000000 44
[httpd] 127.0.0.1 - - [12/May/2018:12:49:36 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" ed2a9298-55e2-11e8-801c-000000000000 95
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:37 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" edc5c271-55e2-11e8-801d-000000000000 138
[httpd] 127.0.0.1 - - [12/May/2018:12:49:37 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" edc60ddf-55e2-11e8-801e-000000000000 94
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:38 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" ee6146af-55e2-11e8-801f-000000000000 130
[httpd] 127.0.0.1 - - [12/May/2018:12:49:38 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" ee61fb62-55e2-11e8-8020-000000000000 302
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:39 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" eefd7a0d-55e2-11e8-8021-000000000000 44
[httpd] 127.0.0.1 - - [12/May/2018:12:49:39 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" eefd9495-55e2-11e8-8022-000000000000 90
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:40 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" ef97d42b-55e2-11e8-8023-000000000000 53
[httpd] 127.0.0.1 - - [12/May/2018:12:49:40 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" ef97f5b1-55e2-11e8-8024-000000000000 128
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:41 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" f03256cd-55e2-11e8-8025-000000000000 72
[httpd] 127.0.0.1 - - [12/May/2018:12:49:41 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" f03283e3-55e2-11e8-8026-000000000000 163
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:42 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" f0cd7a68-55e2-11e8-8027-000000000000 72
[httpd] 127.0.0.1 - - [12/May/2018:12:49:42 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" f0cda3c3-55e2-11e8-8028-000000000000 159
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:43 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" f168e1de-55e2-11e8-8029-000000000000 44
[httpd] 127.0.0.1 - - [12/May/2018:12:49:43 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" f16900c3-55e2-11e8-802a-000000000000 96
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:44 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" f204500c-55e2-11e8-802b-000000000000 130
[httpd] 127.0.0.1 - - [12/May/2018:12:49:44 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" f2048158-55e2-11e8-802c-000000000000 98
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:45 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" f29fb00b-55e2-11e8-802d-000000000000 130
[httpd] 127.0.0.1 - - [12/May/2018:12:49:45 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" f2a02222-55e2-11e8-802e-000000000000 214
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:46 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" f33b580f-55e2-11e8-802f-000000000000 137
[httpd] 127.0.0.1 - - [12/May/2018:12:49:46 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" f33bcbf1-55e2-11e8-8030-000000000000 99
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:47 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" f3d632fa-55e2-11e8-8031-000000000000 55
[httpd] 127.0.0.1 - - [12/May/2018:12:49:47 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" f3d65222-55e2-11e8-8032-000000000000 125
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:48 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" f470b703-55e2-11e8-8033-000000000000 73
[httpd] 127.0.0.1 - - [12/May/2018:12:49:48 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" f470e29f-55e2-11e8-8034-000000000000 163
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:49 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" f50be77f-55e2-11e8-8035-000000000000 72
[httpd] 127.0.0.1 - - [12/May/2018:12:49:49 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" f50c12c2-55e2-11e8-8036-000000000000 219
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:50 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" f5a74e96-55e2-11e8-8037-000000000000 49
[httpd] 127.0.0.1 - - [12/May/2018:12:49:50 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" f5a77e7f-55e2-11e8-8038-000000000000 94
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:51 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" f642dd86-55e2-11e8-8039-000000000000 44
[httpd] 127.0.0.1 - - [12/May/2018:12:49:51 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" f642fc80-55e2-11e8-803a-000000000000 90
influxdb init process in progress...
[httpd] 127.0.0.1 - - [12/May/2018:12:49:52 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.5.2" f6de3674-55e2-11e8-803b-000000000000 130
[httpd] 127.0.0.1 - - [12/May/2018:12:49:52 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+test HTTP/1.1" 403 87 "-" "InfluxDBShell/1.5.2" f6de8a4b-55e2-11e8-803c-000000000000 98
influxdb init process in progress...
influxdb init process failed.

Without INFLUXDB_HTTP_AUTH_ENABLED=1 it seems to work fine (but all INFLUXDB_*_USERs are not created).

@alexbowers
Copy link

Did you ever figure out the issue on this?

@Equidamoid
Copy link
Author

@alexbowers I don't really remember.
The deploy script I have doesn't have INFLUXDB_ADMIN_USER and INFLUXDB_DB set, so I believe in the end I just did the stuff more or less manually after starting the container.

@alexbowers
Copy link

Any chance you could share how you do that?

What im aiming for is to build a docker container for testing on Travis, so something automated.

is that what you managed to do?

@PSanetra
Copy link
Contributor

PSanetra commented Aug 1, 2018

Please try INFLUXDB_HTTP_AUTH_ENABLED=true instead of INFLUXDB_HTTP_AUTH_ENABLED=1 as a workaround for the moment.

@alexbowers
Copy link

alexbowers commented Aug 1, 2018

version: "3"
services:
  influxdb2:
    restart: always
    image: influxdb:latest
    environment:
      INFLUXDB_DB: timepiece
      INFLUXDB_HTTP_AUTH_ENABLED: "true"
      INFLUXDB_ADMIN: "timepiece"
      INFLUXDB_ADMIN_PASSWORD: "IncrediblySecurePassword"
    ports:
      - "8087:8086"
    volumes:
      - "/tmp/influxdb2:/var/lib/influxdb"

Using this as my docker-compose.yml file, as you can see it is "true", not "1" and it doesn't work.

@PSanetra
Copy link
Contributor

PSanetra commented Aug 2, 2018

@alexbowers you need to use INFLUXDB_ADMIN_USER

@alexbowers
Copy link

alexbowers commented Aug 2, 2018

Using

influxdb2:
  restart: always
  image: influxdb:latest
  environment:
    INFLUXDB_DB: timepiece
    INFLUXDB_HTTP_AUTH_ENABLED: "true"
    INFLUXDB_ADMIN_USER: "timepiece"
    INFLUXDB_ADMIN_PASSWORD: "IncrediblySecurePassword"
  ports:
    - "8087:8086"
  volumes:
    - "/tmp/influxdb2:/var/lib/influxdb"

and sending a request to localhost:8087 I still get errors.

version: "3"
services:
  influxdb2:
    restart: always
    image: influxdb:latest
    environment:
      INFLUXDB_DB: timepiece
      INFLUXDB_HTTP_AUTH_ENABLED: "true"
      INFLUXDB_ADMIN_USER: "timepiece"
      INFLUXDB_ADMIN_PASSWORD: "IncrediblySecurePassword"
    ports:
      - "8087:8086"
    volumes:
      - "/tmp/influxdb2:/var/lib/influxdb"

cURL request:

curl -X POST 'http://localhost:8087/query?q=CREATE%20DATABASE%20mydb3' -H 'authorization: Basic dGltZXBpZWNlOkluY3JlZGlibHlTZWN1cmVQYXNzd29yZA=='

Response:

{"error":"error authorizing query: create admin user first or disable authentication"}

Do you have an example of it working that I can copy the docker commands for?

The log I have in docker is:

influxdb2_1  | [httpd] 172.21.0.1 - timepiece [02/Aug/2018:19:12:05 +0000] "POST /query?q=CREATE+DATABASE+mydb3 HTTP/1.1" 403 87 "-" "curl/7.54.0" f1aa0658-9687-11e8-8006-000000000000 155

The entire log is as follows:

➜  tests git:(master) ✗ docker-compose up
Creating tests_influxdb2_1 ... done
Attaching to tests_influxdb2_1
influxdb2_1  | ts=2018-08-02T19:06:23.151631Z lvl=info msg="InfluxDB starting" log_id=09g0OCBl000 version=1.6.0 branch=1.6 commit=62ab18a0f43ee342b84debaaae5486b8b2d8682c
influxdb2_1  | ts=2018-08-02T19:06:23.151646Z lvl=info msg="Go runtime" log_id=09g0OCBl000 version=go1.9.2 maxprocs=4
influxdb2_1  | ts=2018-08-02T19:06:23.256259Z lvl=info msg="Using data dir" log_id=09g0OCBl000 service=store path=/var/lib/influxdb/data
influxdb2_1  | ts=2018-08-02T19:06:23.256871Z lvl=info msg="Open store (start)" log_id=09g0OCBl000 service=store trace_id=09g0OCb0000 op_name=tsdb_open op_event=start
influxdb2_1  | ts=2018-08-02T19:06:23.305777Z lvl=info msg="Reading file" log_id=09g0OCBl000 engine=tsm1 service=cacheloader path=/var/lib/influxdb/wal/_internal/monitor/2/_00001.wal size=2274
influxdb2_1  | ts=2018-08-02T19:06:23.308251Z lvl=info msg="Reading file" log_id=09g0OCBl000 engine=tsm1 service=cacheloader path=/var/lib/influxdb/wal/_internal/monitor/1/_00001.wal size=1192782
influxdb2_1  | ts=2018-08-02T19:06:23.368535Z lvl=info msg="Opened shard" log_id=09g0OCBl000 service=store trace_id=09g0OCb0000 op_name=tsdb_open index_version=inmem path=/var/lib/influxdb/data/_internal/monitor/1 duration=74.997ms
influxdb2_1  | ts=2018-08-02T19:06:23.622079Z lvl=info msg="Opened shard" log_id=09g0OCBl000 service=store trace_id=09g0OCb0000 op_name=tsdb_open index_version=inmem path=/var/lib/influxdb/data/_internal/monitor/2 duration=328.554ms
influxdb2_1  | ts=2018-08-02T19:06:23.622201Z lvl=info msg="Open store (end)" log_id=09g0OCBl000 service=store trace_id=09g0OCb0000 op_name=tsdb_open op_event=end op_elapsed=365.333ms
influxdb2_1  | ts=2018-08-02T19:06:23.622227Z lvl=info msg="Opened service" log_id=09g0OCBl000 service=subscriber
influxdb2_1  | ts=2018-08-02T19:06:23.622233Z lvl=info msg="Starting monitor service" log_id=09g0OCBl000 service=monitor
influxdb2_1  | ts=2018-08-02T19:06:23.622248Z lvl=info msg="Registered diagnostics client" log_id=09g0OCBl000 service=monitor name=build
influxdb2_1  | ts=2018-08-02T19:06:23.622331Z lvl=info msg="Registered diagnostics client" log_id=09g0OCBl000 service=monitor name=runtime
influxdb2_1  | ts=2018-08-02T19:06:23.622334Z lvl=info msg="Registered diagnostics client" log_id=09g0OCBl000 service=monitor name=network
influxdb2_1  | ts=2018-08-02T19:06:23.622340Z lvl=info msg="Registered diagnostics client" log_id=09g0OCBl000 service=monitor name=system
influxdb2_1  | ts=2018-08-02T19:06:23.622628Z lvl=info msg="Starting precreation service" log_id=09g0OCBl000 service=shard-precreation check_interval=10m advance_period=30m
influxdb2_1  | ts=2018-08-02T19:06:23.622654Z lvl=info msg="Starting snapshot service" log_id=09g0OCBl000 service=snapshot
influxdb2_1  | ts=2018-08-02T19:06:23.622663Z lvl=info msg="Starting continuous query service" log_id=09g0OCBl000 service=continuous_querier
influxdb2_1  | ts=2018-08-02T19:06:23.622668Z lvl=info msg="Starting HTTP service" log_id=09g0OCBl000 service=httpd authentication=true
influxdb2_1  | ts=2018-08-02T19:06:23.622673Z lvl=info msg="opened HTTP access log" log_id=09g0OCBl000 service=httpd path=stderr
influxdb2_1  | ts=2018-08-02T19:06:23.622669Z lvl=info msg="Storing statistics" log_id=09g0OCBl000 service=monitor db_instance=_internal db_rp=monitor interval=10s
influxdb2_1  | ts=2018-08-02T19:06:23.622937Z lvl=info msg="Listening on HTTP" log_id=09g0OCBl000 service=httpd addr=[::]:8086 https=false
influxdb2_1  | ts=2018-08-02T19:06:23.622973Z lvl=info msg="Starting retention policy enforcement service" log_id=09g0OCBl000 service=retention check_interval=30m
influxdb2_1  | ts=2018-08-02T19:06:23.623195Z lvl=info msg="Listening for signals" log_id=09g0OCBl000
influxdb2_1  | ts=2018-08-02T19:06:23.623693Z lvl=info msg="Sending usage statistics to usage.influxdata.com" log_id=09g0OCBl000
influxdb2_1  | [httpd] 172.21.0.1 - admin [02/Aug/2018:19:06:41 +0000] "POST /query?q=CREATE+DATABASE+mydb3 HTTP/1.1" 403 87 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 30e18292-9687-11e8-8001-000000000000 416
influxdb2_1  | [httpd] 172.21.0.1 - admin [02/Aug/2018:19:08:13 +0000] "POST /query?q=CREATE+DATABASE+mydb3 HTTP/1.1" 403 87 "-" "curl/7.54.0" 6753613f-9687-11e8-8002-000000000000 111
influxdb2_1  | [httpd] 172.21.0.1 - timepiece [02/Aug/2018:19:09:55 +0000] "POST /query?q=CREATE+DATABASE+mydb3 HTTP/1.1" 403 87 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" a480b3d1-9687-11e8-8003-000000000000 78
influxdb2_1  | [httpd] 172.21.0.1 - timepiece [02/Aug/2018:19:10:20 +0000] "POST /query?q=CREATE+DATABASE+mydb3 HTTP/1.1" 403 87 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" b362ed78-9687-11e8-8004-000000000000 76
influxdb2_1  | [httpd] 172.21.0.1 - timepiece [02/Aug/2018:19:10:51 +0000] "POST /query?q=CREATE+DATABASE+mydb3 HTTP/1.1" 403 87 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" c58cd434-9687-11e8-8005-000000000000 110
influxdb2_1  | [httpd] 172.21.0.1 - timepiece [02/Aug/2018:19:12:05 +0000] "POST /query?q=CREATE+DATABASE+mydb3 HTTP/1.1" 403 87 "-" "curl/7.54.0" f1aa0658-9687-11e8-8006-000000000000 155

@PSanetra
Copy link
Contributor

PSanetra commented Aug 2, 2018

@alexbowers please clean your volume /tmp/influxdb2 before trying to initialize influxdb again. The init script won't try to initialize influxdb if it can find a meta directory in it.

@alexbowers
Copy link

alexbowers commented Aug 2, 2018 via email

@mleonhard
Copy link

mleonhard commented Mar 6, 2020

The bug is in /init-influxdb.sh. That script always tries to run a query. If you enable authentication, then the script requires INFLUXDB_ADMIN_USER and INFLUXDB_ADMIN_PASSWORD to also be set.

My workaround is to write /etc/influxdb/influxdb.conf and replace /init-influxdb.sh with a simple script that starts influxd and creates users & databases:

#!/bin/sh -ev
influxd &
/influxdb-apply.py /influxdb-apply.yaml http://localhost:8086/
wait

matletix added a commit to matletix/docs that referenced this issue Nov 3, 2020
Setting the `INFLUXDB_HTTP_AUTH_ENABLED` variable to something other than `true` (eg. `INFLUXDB_HTTP_AUTH_ENABLED=1`) can result in errors in the init script. More details here : influxdata/influxdata-docker#224
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants