Giter VIP home page Giter VIP logo

Comments (7)

ovizii avatar ovizii commented on May 28, 2024 1

I do understand you can't support all sorts of configurations and I'm thankful for pointers. I'm ready to follow all your steps to debug but I spotted the problem:

my selector was simply * as stated in the very first sentence of this thread while your step 5 said to use .* and now it works :-)

from netbox-docker.

cimnine avatar cimnine commented on May 28, 2024

This is weird, as Graphviz is clearly installed:

https://github.com/ninech/netbox-docker/blob/81f8c7386d430358aa0f140f3d3e6a188cf9a47e/Dockerfile#L8

from netbox-docker.

ovizii avatar ovizii commented on May 28, 2024

It might be me messing things up, I'm quite new to Docker. Maybe this could be the cause? I wanted to map data into specific folders for backup purposes instead of using the docker volumes:

docker-compose.yml

version: '3'
services:
  netbox: &netbox
    build:
      context: .
      args:
        - BRANCH=${VERSION-master}
    image: ninech/netbox:${VERSION-latest}
    depends_on:
    - postgres
    - redis
    - netbox-worker
    env_file: env/netbox.env
    volumes:
    - ./startup_scripts:/opt/netbox/startup_scripts:ro
    - ./initializers:/opt/netbox/initializers:ro
    - ./configuration:/etc/netbox/config:ro
    - /mnt/netbox/netbox-nginx-config:/etc/netbox-nginx/
    - /mnt/netbox/netbox-static-files:/opt/netbox/netbox/static
    - /mnt/netbox/netbox-media-files:/opt/netbox/netbox/media
    - /mnt/netbox/netbox-report-files:/etc/netbox/reports:ro
  netbox-worker:
    <<: *netbox
    depends_on:
    - redis
    entrypoint:
    - python3
    - /opt/netbox/netbox/manage.py
    command:
    - rqworker
  nginx:
    command: nginx -c /etc/netbox-nginx/nginx.conf
    image: nginx:1.15-alpine
    depends_on:
    - netbox
    ports:
    - 8777:8080
    volumes:
    - /mnt/netbox/netbox-static-files:/opt/netbox/netbox/static:ro
    - /mnt/netbox/netbox-nginx-config:/etc/netbox-nginx/:ro
  postgres:
    image: postgres:10.4-alpine
    env_file: env/postgres.env
    volumes:
    - /mnt/netbox/netbox-postgres-data:/var/lib/postgresql/data
  redis:
    image: redis:4-alpine
    command:
    - sh
    - -c # this is to evaluate the $REDIS_PASSWORD from the env
    - redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
    env_file: env/redis.env
    volumes:
    - /mnt/netbox/netbox-redis-data:/data

Look at the volumes section. This had led to me having to manually copy the nginx.conf file into: /mnt/netbox/netbox-nginx-config

Maybe that is unnecessary? Would it be enough to map the postgres data into a folder for backup and reverse the other changes I made to volumes?

  postgres:
    image: postgres:10.4-alpine
    env_file: env/postgres.env
    volumes:
    - /mnt/netbox/netbox-postgres-data:/var/lib/postgresql/data

from netbox-docker.

cimnine avatar cimnine commented on May 28, 2024

Would it be enough to map the postgres data into a folder for backup and reverse the other changes I made to volumes?

Yes. All persistent data is stored in PostgreSQL.
If you use webhook, you may want to backup the redis data directory, if it's critical that no webhook is lost in a crash. (At least those webhooks that were already sent to Redis by Netbox, for all others there's no guarantee anyway.)

But I would suggest to use a cronjob/systemd timer which periodically performs PostgreSQL backups like this:

docker-compose exec postgres sh -c 'pg_dump -cU $POSTGRES_USER $POSTGRES_DB' | gzip > db_dump.sql.gz

netbox-nginx-config is specific to the "netbox-docker" version. (That's because we ship the Nginx config with the netbox-docker container in order to ship just one container.)
netbox-static-files files are specific to each Netbox version and are shared with the Nginx container, because the Nginx container is serving static files.

from netbox-docker.

cimnine avatar cimnine commented on May 28, 2024

Can you revert/stash your changes to see if this was the issue? (Or clone the project into a separate directory.)

from netbox-docker.

ovizii avatar ovizii commented on May 28, 2024

hm, I tried reversing my changes except for the volume where postgres data is stored. An sdiff between my docker-compose.yml and the original from this site which I renamed docker-compose.yml.sample clearly shows no other changes:

image

my modified file is on the left. did a docker-compose down followed by docker-compose up -d and still getting this error when visualizing a topology map:

There was an error generating the requested graph. Ensure that the GraphViz executables have been installed correctly.

Any other ideas what could cause this? The only other files I touched are the env/. ones

Thanks for the pointers with the postgres backups. To give more insight into why I am doing this, I generyll try and separate data from servers so basically in my example: /mnt/netbox would be an NFS share which means I have data backed up separately from my docker host server. I can restore or setup a new docker host, mount my shares and start up my containers again without having to worry about the data.

from netbox-docker.

cimnine avatar cimnine commented on May 28, 2024

I just tested it with the latest docker image on my mac. It works fine.

Do you run this on a Linux machine and do you have SELinux or AppArmor turned on? Can you please check the security log of the respecting technology?

I hope you can understand that it's not possible to provide support for any setup that is not according to the default setup.

Therefore:

  1. please revert/stash all changes (or clone the project into a separate directory)
  2. please cleanup any old docker volumes: docker-compose down -v --remove-orphans (this will remove any data stored in the DB. make a backup first if you need this data.)
  3. run docker-compose up and wait for the application to be available
  4. create a site 'a', device role 'a', manufacturer 'a', device type 'a' and a device 'a'
  5. create a topo map with the following selector .*
  6. try to render the topo map

If it still fails, disable SELinux/AppArmor and try again.

Please report back if it still fails.

from netbox-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.