Skip to content
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

Error running notify command: nginx -s reload, exit status 1 #536

Closed
Harper04 opened this issue Aug 15, 2016 · 4 comments
Closed

Error running notify command: nginx -s reload, exit status 1 #536

Harper04 opened this issue Aug 15, 2016 · 4 comments

Comments

@Harper04
Copy link

Hi,

i have a problem and no idea where to start debugging/i'm doing wrong.
I get the following log:

root@root:~# docker run -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
forego     | starting nginx.1 on port 5000
forego     | starting dockergen.1 on port 5100
dockergen.1 | 2016/08/15 13:08:13 Generated '/etc/nginx/conf.d/default.conf' from 9 containers
dockergen.1 | 2016/08/15 13:08:13 Error running notify command: nginx -s reload, exit status 1
dockergen.1 | 2016/08/15 13:08:13 Watching docker events
dockergen.1 | 2016/08/15 13:08:13 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'

if remove the 9th container everything works (well, only the 9th has VIRTUAL_HOST set.)
This represents the docker-compose file of the 9th container.

version: '2'
services:
  master:
    image: master
    ports:
      - "9050:80"
      - "9022:22"
    environment:
      - VIRTUAL_PORT=9050
      - STAGE_ENV=local
      - VIRTUAL_HOST=mydomain.de

I've noticed that the upstream block of mydomain.de is empty.

@Harper04
Copy link
Author

I thought the problem could be that compose creates networks for each compose file and nginx-proxy only connects to the default bridge. Therefore i connected nginx-proxy to all networks and used docker-compose restart.
This seems to fix Error running notify command: nginx -s reload, exit status 1 but i still get a Welcome to nginx!-Page.

dockergen.1 | 2016/08/15 16:50:54 Received event die for container 2a4c73a3542f
dockergen.1 | 2016/08/15 16:50:54 Received event die for container 3829fc9b0789
dockergen.1 | 2016/08/15 16:50:55 Received event stop for container 3829fc9b0789
dockergen.1 | 2016/08/15 16:50:55 Received event stop for container 2a4c73a3542f
dockergen.1 | 2016/08/15 16:50:56 Received event start for container 3829fc9b0789
dockergen.1 | 2016/08/15 16:50:56 Received event start for container 2a4c73a3542f
dockergen.1 | 2016/08/15 16:50:56 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
dockergen.1 | 2016/08/15 16:50:57 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
dockergen.1 | 2016/08/15 16:50:57 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
dockergen.1 | 2016/08/15 16:50:57 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
dockergen.1 | 2016/08/15 16:50:58 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
dockergen.1 | 2016/08/15 16:50:58 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'

@Harper04
Copy link
Author

Sorry i think this is a duplicate of #502 or #438

@brians-code
Copy link

I had the same issues, and the problem was exactly what you described. I solved it by creating a network called nginx-proxy:

docker create network nginx-proxy

Then I added the following to the bottom of my docker-compose file:

networks:
  default:
    external:
      name: nginx-proxy

Here is my complete docker-compose.yml:

version: '2'

services:

  prod:
    image: ${COMPOSE_PROJECT_NAME}-prod
    container_name: ${COMPOSE_PROJECT_NAME}-prod
    environment:
      - VIRTUAL_HOST=${COMPOSE_PROJECT_NAME}
    volumes:
      - ./prod/${COMPOSE_PROJECT_NAME}/web:/var/www/html/
      - ./prod/${COMPOSE_PROJECT_NAME}/data:/var/lib/mysql
    restart: always


  dev:
    image: ${COMPOSE_PROJECT_NAME}-dev
    container_name: ${COMPOSE_PROJECT_NAME}-dev
    environment:
      - VIRTUAL_HOST=${COMPOSE_PROJECT_NAME}.dev
    volumes:
      - ./dev/${COMPOSE_PROJECT_NAME}/web:/var/www/html
      - ./dev/${COMPOSE_PROJECT_NAME}/data:/var/lib/mysql


  nginx-proxy:
    image: jwilder/nginx-proxy
    container_name: nginx-proxy
    ports:
      - "80:80"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro


networks:
  default:
    external:
      name: nginx-proxy

@jwilder
Copy link
Collaborator

jwilder commented Aug 25, 2016

Closing as dup of #502

@jwilder jwilder closed this as completed Aug 25, 2016
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

3 participants