arangodb / arangodb-docker

Docker container for ArangoDB
Apache License 2.0
106 stars 32 forks source link

Authentication is always disabled, how to enable it? #43

Closed jbguillois closed 6 years ago

jbguillois commented 6 years ago

I am starting arangodb docker image with docker-compose on my mac:

    arangodb:
      image: arangodb/arangodb
      volumes:
        - ./data/arangodb:/var/lib/arangodb3
      ports:
        - 8529:8529
      environment:
        - ARANGO_NO_AUTH=0
        - ARANGO_ROOT_PASSWORD=password

Arangodb starts properly:

arangodb_1       | automaticaly choosing storage engine
arangodb_1       | 2018-01-18T13:38:00Z [1] INFO ArangoDB 3.3.2 [linux] 64bit, using jemalloc, VPack 0.1.30, RocksDB 5.6.0, ICU 58.1, V8 5.7.492.77, OpenSSL 1.1.0f  25 May 2017
arangodb_1       | 2018-01-18T13:38:00Z [1] INFO detected operating system: Linux version 4.9.60-linuxkit-aufs (root@4a42478ffb9a) (gcc version 6.3.0 (Alpine 6.3.0) ) #1 SMP Mon Nov 6 16:00:12 UTC 2017
arangodb_1       | 2018-01-18T13:38:00Z [1] INFO using storage engine mmfiles
arangodb_1       | 2018-01-18T13:38:00Z [1] INFO {cluster} Starting up with role SINGLE
arangodb_1       | 2018-01-18T13:38:00Z [1] INFO {syscall} file-descriptors (nofiles) hard limit is 1048576, soft limit is 1048576
arangodb_1       | 2018-01-18T13:38:00Z [1] INFO {authentication} Authentication is turned off, authentication for unix sockets is turned on
arangodb_1       | 2018-01-18T13:38:00Z [1] WARNING {memory} /proc/sys/vm/overcommit_memory is set to '1'. It is recommended to set it to a value of 0 or 2
arangodb_1       | 2018-01-18T13:38:00Z [1] WARNING {memory} execute 'sudo bash -c "echo 2 > /proc/sys/vm/overcommit_memory"'
arangodb_1       | 2018-01-18T13:38:00Z [1] INFO running WAL recovery (1 logfiles)
arangodb_1       | 2018-01-18T13:38:00Z [1] INFO replaying WAL logfile '/var/lib/arangodb3/journals/logfile-124.db' (1 of 1)
arangodb_1       | 2018-01-18T13:38:00Z [1] INFO WAL recovery finished successfully
arangodb_1       | 2018-01-18T13:38:01Z [1] INFO using endpoint 'http+tcp://0.0.0.0:8529' for non-encrypted requests
arangodb_1       | 2018-01-18T13:38:04Z [1] INFO ArangoDB (version 3.3.2 [linux]) is ready for business. Have fun!

The docker image is working fine for my dev and CI environments. My problem is regarding the authentication. I enabled the authentication by setting "ARANGO_NO_AUTH=0" in my docker-compose. The logs (see above) are saying it is still not enabled and when accessing the Arangodb Web UI (on localhost:8529), a banner is displayed saying that "Warning: Authentication is disabled. Do not use this setup in production mode.".

What am I doing wrong?

Thanks for any help!

Thx PS:

**Mac OS Version**:
ProductName:    Mac OS X
ProductVersion: 10.13.2
BuildVersion:   17C205

**Docker-compose version**:
Docker-compose version 1.18.0, build 8dd22a9
docker-py version: 2.6.1
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2j  26 Sep 2016

**Docker version**:
Client:
 Version:   17.12.0-ce
 API version:   1.35
 Go version:    go1.9.2
 Git commit:    c97c6d6
 Built: Wed Dec 27 20:03:51 2017
 OS/Arch:   darwin/amd64

Server:
 Engine:
  Version:  17.12.0-ce
  API version:  1.35 (minimum version 1.12)
  Go version:   go1.9.2
  Git commit:   c97c6d6
  Built:    Wed Dec 27 20:12:29 2017
  OS/Arch:  linux/amd64
  Experimental: true
dothebart commented 6 years ago

Hi, this issue seems to arise often to users that docker doesn't forward the environment variables. All previous combatants ended up deleting /var/lib/docker and start over from a fresh environment.

jbguillois commented 6 years ago

@dothebart you mean /var/lib/docker on the host? in the arangodb vm? in the docker internal vm? I don't have any /var/lib/docker on my MacOS file system... Thank you for your help,

dothebart commented 6 years ago

in the docker machine vm most probably - I don't know much about macs and howto run docker on them.

jbguillois commented 6 years ago

Thank you @dothebart but I am not sure how to get access to the internal of my Docker VM. I will post back here if I find any way of doing this on Mac.

rtmruczek commented 6 years ago

Hello, I know this is kind of an old issue but I'm having this problem as well. I'm also on MacOS. I tried deleting all my docker volumes and recreating the images, but had the same issue. If it's helpful, I can post more detailed version info.

Edit: I believe I tracked the issue down to docker-compose caching certain build configurations. Specifying a volume in my docker-compose.yml appeared to fix the issue for me.

Refer to this issue for more info: https://github.com/docker-library/postgres/issues/203#issuecomment-255200501

dothebart commented 6 years ago

Ok, our docker containers now echo on startup that they're working with an existing installation, so this situation can be more easily identified. Closing.