Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Couch DB exit with error with default configuration #29

Open
jeckel opened this issue Oct 10, 2016 · 1 comment
Open

Couch DB exit with error with default configuration #29

jeckel opened this issue Oct 10, 2016 · 1 comment

Comments

@jeckel
Copy link

jeckel commented Oct 10, 2016

Hi,
I'm new with Cozy, but not new with docker...

I tried to use this containers, and the main container enter a loop quickly after starting, it seems that couchdb fail to start, and supervisor is entering a loop trying to restart it for ever.

cozy_1       | 2016-10-10 16:14:41,146 INFO spawned: 'couchdb' with pid 3621
cozy_1       | 2016-10-10 16:14:41,333 INFO reaped unknown pid 3641
cozy_1       | 2016-10-10 16:14:42,069 INFO exited: couchdb (exit status 1; not expected)

I entered in my cozy container ( docker-compose exec cozy bash ) to have a deeper look into logs.
I found this :

=ERROR REPORT==== 10-Oct-2016::16:11:04 ===
File operation error: eacces. Target: /root/ebin. Function: read_file_info. Process: code_server.
Apache CouchDB 1.5.0 (LogLevel=info) is starting.
[error] [<0.129.0>] Could not open file /var/lib/couchdb/_users.couch: permission denied
....
{error_logger,{{2016,10,10},{16,11,7}},std_error,"File operation error: eacces. Target: /root/ebin. Function: read_file_info. Process: code_server."}

I test by setting my local folder with 777 to see what changes, it seems to work for couchDB, but then it's nginx which exit with error :

nginx: [emerg] BIO_new_file("/etc/cozy/server.crt") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/cozy/server.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

I think that the main problem is that some things (I don't know Cozy enough) are created during the build of the container in this directories, but after, when starting with docker-compose up, this things are lost...

@ghost
Copy link

ghost commented Nov 4, 2016

Check in your docker-compose.yml in directive "volumes" that you don't have bound host directories on "/var/lib/couchdb".
If you do so, the original image directory content (filled at image build) is overriden by the one present on your host (which is empty), causing couchdb won't start (since its files have disapeared)
What you can do however is to give a name to this volume, which don't cause overriding.
Everything is very well explained here :
https://madcoda.com/2016/03/docker-named-volume-explained/
here :
https://docs.docker.com/engine/tutorials/dockervolumes/
and here :
http://stackoverflow.com/questions/26050899/how-to-mount-host-volumes-into-docker-containers-in-dockerfile-during-build

My docker-compose file :

version: '2'

networks:
  cozy-network:

volumes:
  cozy-couchdb:
  cozy-etc:
  cozy-usr-local:
  cozy-usr-local-var:

services:

  ############################
  # Cozy Container
  ############################
  cozy-cozy-container:
    build: https://github.com/cozy-labs/cozy-docker.git
    image: cozy/full
    restart: always
    volumes:
      - cozy-couchdb:/var/lib/couchdb
      - cozy-etc:/etc/cozy
      - cozy-usr-local:/usr/local/cozy
      - cozy-usr-local-var:/usr/local/var/cozy
    networks:
      cozy-network :
        aliases:
          - cozy-cozy-hostname
    # Disable SSL since we use a reverse proxy
    environment:
      - DISABLE_SSL=true
    # Ports are not exposed since we use a reverse proxy
    #ports:
    #  - 80:80
    #  - 443:443

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant