GithubHelp home page GithubHelp logo

nautobot / nautobot-lab Goto Github PK

View Code? Open in Web Editor NEW
39.0 15.0 12.0 2.46 MB

All-in-one Docker container that allows a user to explore Nautobot in a lab environment.

License: Apache License 2.0

Dockerfile 11.39% Python 86.11% Shell 2.51%
nautobot docker

nautobot-lab's Introduction

Nautobot Lab

This container is not for production use!

Nautobot Lab is an all-in-one Docker container that allows a user to quickly get an instance of Nautobot up and running with minimal effort.

This image is for the purposes of "kicking the tires" of Nautobot. Utilize nautobot-lab to quickly see if Nautobot is right for you and your organization.

It bears repeating, nautobot-lab is NOT a ready for production container. If you wish to use Nautobot in production, please refer to the Nautobot documentation.

Running from Docker Hub

Building the container yourself isn't needed to get up and running quickly. The image is hosted on Docker Hub for public consumption, and you can download and start it with a single command.

docker run -itd --name nautobot -p 8000:8000 networktocode/nautobot-lab

If you've previously run nautobot-lab in the past, you may wish to first invoke docker pull networktocode/nautobot-lab to ensure that you have the latest version of this image!

Because this image is an all-in-one container (with Nautobot, PostgreSQL, and Redis), it will take a few seconds to download the container, and then about 30 seconds more for all of the services to start and stabilize. Once the container has started and all services have stabilized, the web interface can be accessed via http://localhost:8000.

If you wish, you can also check the health status of the container by running the following command:

docker ps | grep nautobot

You are waiting for the container to be in a healthy state as shown below.

99c9312e0409   networktocode/nautobot-lab     "/usr/local/bin/supe…"   3 minutes ago   Up 3 minutes (healthy)   0.0.0.0:8000->8000/tcp, :::8000->8000/tcp

Once Nautobot Lab is up and running, you will need to create a Super User as shown in the section below.

Building the container

The container can be built locally, if preferred.

  1. Clone the repository.

    git clone https://github.com/nautobot/nautobot-lab.git
  2. Enter the nautobot-lab directory.

  3. Build the image.

    docker build -t nautobot-lab:latest .

Running the container from a local build

docker run -itd --name nautobot -p 8000:8000 nautobot-lab

Importing the demo dataset

The nautobot-lab container provides demo dataset similar to the Nautobot public sandbox (http://demo.nautobot.com). This dataset can be used to quickly populate your Nautobot instance with the real life data! You can use it to view data, experiment or perform experimental or development work.

Use following command to import the data into your lab container:

docker exec -itd nautobot load-mock-data

!!! warning Importing dataset will erase your existing data. Issuing the load-mock-data will result in destroying your existing dataset and importing new one. Dataset contains default credentials. If you decide to import provided dataset, the dataset credentials will be used: username: admin, password: admin.

The Default Account

The nautobot-lab container comes with a user pre-defined. The username is demo and its corresponding password is nautobot. If you choose to build your own container, you can define your own attributes for the default account by setting the following environment variables before executing the docker build command.

  • NAUTOBOT_USERNAME
  • NAUTOBOT_EMAIL
  • NAUTOBOT_PASSWORD
  • NAUTOBOT_TOKEN

Creating a Super User

Once the container has started and all the services have stabilized, you can create a Super User account to start exploring Nautobot. The nautobot-server createsuperuser command will prompt you for a username, email address, and password. The email address is unused in this particular workflow and can be left blank.

% docker exec -it nautobot nautobot-server createsuperuser
Username (leave blank to use 'root'): ntc
Email address: [email protected]
Password:
Password (again):
Superuser created successfully.

Installed Applications

The Nautobot Lab container comes with the following applications pre-installed:

These applications can give you a sense of what is possible with Nautobot as a network automation platform and can assist you with populating the lab environment with data that is unique to you. For the applications that require access to network devices, you can set the NAPALM_USERNAME AND NAPALM_PASSWORD environment variables when starting the container.

docker run -itd --name nautobot -p 8000:8000 --env NAPALM_USERNAME="demouser" --env NAPALM_PASSWORD="demopass" networktocode/nautobot-lab:latest

Kick the Tires

At this point, Nautobot can be accessed at http://localhost:8000 with the user credentials that were created.

Explore, test, create, destroy, do whatever you like in this lab instance of Nautobot.

If you have any questions, don't hesitate to reach out in the #Nautobot channel on the Network To Code Slack instance, we'll be happy to assist you!

If you're not a member, you can join the Slack instance here.

Nautobot

nautobot-lab's People

Contributors

bryanculver avatar dependabot[bot] avatar glennmatthews avatar jathanism avatar jedelman8 avatar jtdub avatar lykinsbd avatar mzbroch avatar nniehoff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nautobot-lab's Issues

recent commit (4af4518) deletes mock data, why?

Suddenly fixture/mock data disapparead with no reference to any issue or PR, so this issue serves to clarify it

I have seen it in this commit

4af4518

I wanted to test that if anyway some mock data is in the container (TL DR; the answer is no)

docker run -itd --name nautobot -p 8000:8000 networktocode/nautobot-labs:
docker exec -it nautobot nautobot-server createsuperuser

which is

$ docker images | grep nautobot
networktocode/nautobot-lab                   latest                    c38a5d2afafa   5 days ago     1.48GB

and I don't see any mock data, and If I follow for example this outdated official(?) written article guide, says:

$ docker exec -it nautobot load-mock-data

OCI runtime exec failed: exec failed: unable to start container process: exec: "load-mock-data": executable file not found in $PATH: unknown

it also deprecates this outdated official video guide

is there any other up-to-date way to load mock data, I see that it could be useful to quickly test APIs and exports on data (without having to import on my own)

Thanks

Run as nonroot

It seems like supervisord is running as root.

PermissionError: [Errno 1] Operation not permitted: '/var/tmp/supervisor.sock'

kubernetes doesn't seem to like that

Could it be this that should to be changed?
templates/supervisord.conf:
[unix_http_server]
file=/var/tmp/supervisor.sock
chmod=0700
chown=root:root

Predefined Superuser

I was looking to deploy Nautobot in GCP Cloud Run, but there is no "docker exec" equivalent to allow creation of the first superuser. Would it be possible to provide an iniial superuser, or some environment variables to allow creation of the first superuser at build time? Thanks :-)

Feature: Additional Plugins

Does it make since to include some default plugins here such as:

nautobot-capacity-metrics
nautobot-chatops
nautobot-device-onboarding
nautobot-golden-config

Nautobot-Lab Latest Programming Error When Get on DCIM/Device

Setup

  1. Pull latest images
  2. Run docker command
  3. Load demo data (to get the API key)

Error Execution

  1. Navigate to the API
  2. Navigate to dcim/devices/ GET method
  3. On name key search for ams-leaf-01
  4. Receive a programming error
{
  "error": "relation \"extras_configcontext_device_types\" does not exist\nLINE 1: ...V0.\"id\" = V13.\"configcontext_id\") LEFT OUTER JOIN \"extras_co...\n                                                             ^\n",
  "exception": "ProgrammingError",
  "nautobot_version": "1.0.2",
  "python_version": "3.8.5"
}

This is not present on demo.nautobot.com nor on a pip installed version of Nautobot.

Error on manual build of nautobot-lab

Running docker build -t nautobot-lab:latest . on a Digital Ocean Droplet running Ubuntu 18.04 (LTS) x64 encounters the following error:

TASK [RUN MAKEMIGRATIONS] ******************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["/opt/nautobot/bin/nautobot-server", "makemigrations"], "delta": "0:00:02.240716", "end": "2022-09-14 19:03:14.698676", "msg": "non-zero return code", "rc": 1, "start": "2022-09-14 19:03:12.457960", "stderr": "Traceback (most recent call last):\n  File \"/opt/nautobot/bin/nautobot-server\", line 8, in <module>\n    sys.exit(main())\n  File \"/opt/nautobot/lib/python3.8/site-packages/nautobot/core/cli.py\", line 54, in main\n    run_app(\n  File \"/opt/nautobot/lib/python3.8/site-packages/nautobot/core/runner/runner.py\", line 266, in run_app\n    management.execute_from_command_line([runner_name, command] + command_args)\n  File \"/opt/nautobot/lib/python3.8/site-packages/django/core/management/__init__.py\", line 401, in execute_from_command_line\n    utility.execute()\n  File \"/opt/nautobot/lib/python3.8/site-packages/django/core/management/__init__.py\", line 377, in execute\n    django.setup()\n  File \"/opt/nautobot/lib/python3.8/site-packages/django/__init__.py\", line 24, in setup\n    apps.populate(settings.INSTALLED_APPS)\n  File \"/opt/nautobot/lib/python3.8/site-packages/django/apps/registry.py\", line 114, in populate\n    app_config.import_models()\n  File \"/opt/nautobot/lib/python3.8/site-packages/django/apps/config.py\", line 211, in import_models\n    self.models_module = import_module(models_module_name)\n  File \"/usr/lib/python3.8/importlib/__init__.py\", line 127, in import_module\n    return _bootstrap._gcd_import(name[level:], package, level)\n  File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import\n  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\n  File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\n  File \"<frozen importlib._bootstrap>\", line 671, in _load_unlocked\n  File \"<frozen importlib._bootstrap_external>\", line 848, in exec_module\n  File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n  File \"/opt/nautobot/lib/python3.8/site-packages/django_celery_beat/models.py\", line 246, in <module>\n    class CrontabSchedule(models.Model):\n  File \"/opt/nautobot/lib/python3.8/site-packages/django_celery_beat/models.py\", line 301, in CrontabSchedule\n    timezone = timezone_field.TimeZoneField(\n  File \"/opt/nautobot/lib/python3.8/site-packages/timezone_field/fields.py\", line 88, in __init__\n    super(TimeZoneField, self).__init__(*args, **kwargs)\nTypeError: __init__() got an unexpected keyword argument 'use_pytz'", "stderr_lines": ["Traceback (most recent call last):", "  File \"/opt/nautobot/bin/nautobot-server\", line 8, in <module>", "    sys.exit(main())", "  File \"/opt/nautobot/lib/python3.8/site-packages/nautobot/core/cli.py\", line 54, in main", "    run_app(", "  File \"/opt/nautobot/lib/python3.8/site-packages/nautobot/core/runner/runner.py\", line 266, in run_app", "    management.execute_from_command_line([runner_name, command] + command_args)", "  File \"/opt/nautobot/lib/python3.8/site-packages/django/core/management/__init__.py\", line 401, in execute_from_command_line", "    utility.execute()", "  File \"/opt/nautobot/lib/python3.8/site-packages/django/core/management/__init__.py\", line 377, in execute", "    django.setup()", "  File \"/opt/nautobot/lib/python3.8/site-packages/django/__init__.py\", line 24, in setup", "    apps.populate(settings.INSTALLED_APPS)", "  File \"/opt/nautobot/lib/python3.8/site-packages/django/apps/registry.py\", line 114, in populate", "    app_config.import_models()", "  File \"/opt/nautobot/lib/python3.8/site-packages/django/apps/config.py\", line 211, in import_models", "    self.models_module = import_module(models_module_name)", "  File \"/usr/lib/python3.8/importlib/__init__.py\", line 127, in import_module", "    return _bootstrap._gcd_import(name[level:], package, level)", "  File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import", "  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load", "  File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked", "  File \"<frozen importlib._bootstrap>\", line 671, in _load_unlocked", "  File \"<frozen importlib._bootstrap_external>\", line 848, in exec_module", "  File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed", "  File \"/opt/nautobot/lib/python3.8/site-packages/django_celery_beat/models.py\", line 246, in <module>", "    class CrontabSchedule(models.Model):", "  File \"/opt/nautobot/lib/python3.8/site-packages/django_celery_beat/models.py\", line 301, in CrontabSchedule", "    timezone = timezone_field.TimeZoneField(", "  File \"/opt/nautobot/lib/python3.8/site-packages/timezone_field/fields.py\", line 88, in __init__", "    super(TimeZoneField, self).__init__(*args, **kwargs)", "TypeError: __init__() got an unexpected keyword argument 'use_pytz'"], "stdout": "", "stdout_lines": []}

PLAY RECAP *********************************************************************
localhost                  : ok=15   changed=14   unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

The command '/bin/sh -c apt-get update -y &&     apt-get install -y tzdata --no-install-recommends &&     ln -fs /usr/share/zoneinfo/UTC /etc/localtime &&     dpkg-reconfigure -f noninteractive tzdata &&     apt-get install -y python3 python3-psycopg2 python3-pip       python3-venv python3-dev python3-apt postgresql-12       libpq-dev redis-server systemctl git --no-install-recommends &&     pip3 install --no-cache-dir pip --upgrade &&     pip install --no-cache-dir --requirement ./templates/requirements.txt &&     ansible-galaxy collection install community.postgresql &&     ansible-playbook pb_nautobot_install.yml &&     pip uninstall -y ansible &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*' returned a non-zero code: 2

Unable to install nautobot_netbox_importer plugin

Hello, I'm trying to install nautobot_netbox_importer but, I'm not able to build image with plugin configured.

Environment

  • Python version: 3.8.5
  • Nautobot version: Nautobot-Lab 1.0.0b4
  • nautobot-netbox-importer version: Version 1.2.1

Expected Behavior

Nautobot-lab image built with nautobot_netbox_importer plugin

What happened instead?

Unable to find plugin nautobot_netbox_importer

#17 61.21 TASK [RUN MAKEMIGRATIONS] ******************************************************
#17 61.57 fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["/opt/nautobot/bin/nautobot-server", "makemigrations"], 
"delta": "0:00:00.184857", "end": "2021-04-22 07:25:17.981318", "msg": "non-zero return code", "rc": 1, "start": "2021-04-22 
07:25:17.796461", "stderr": "Traceback (most recent call last):\n  File \"/opt/nautobot/lib/python3.8/site-
packages/nautobot/extras/plugins/utils.py\", line 63, in load_plugin\n    plugin = importlib.import_module(plugin_name)\n  File
 \"/usr/lib/python3.8/importlib/__init__.py\", line 127, in import_module\n    return _bootstrap._gcd_import(name[level:], package, level)\n  File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import\n  File \"<frozen importlib._bootstrap>\", line 991, in 
_find_and_load\n  File \"<frozen importlib._bootstrap>\", line 973, in _find_and_load_unlocked\nModuleNotFoundError: No 
module named 'nautobot_netbox_importer'\n\nThe above exception was the direct cause of the following 
exception:\n\nTraceback (most recent call last):\n  File \"/opt/nautobot/lib/python3.8/site-
packages/nautobot/core/runner/runner.py\", line 118, in settings_callback\n    initializer(\n  File 
\"/opt/nautobot/lib/python3.8/site-packages/nautobot/core/cli.py\", line 178, in _configure_settings\n    load_plugins(settings)\n  File \"/opt/nautobot/lib/python3.8/site-packages/nautobot/extras/plugins/utils.py\", line 53, in load_plugins\n   
 load_plugin(plugin_name, settings)\n  File \"/opt/nautobot/lib/python3.8/site-packages/nautobot/extras/plugins/utils.py\", line 66, in load_plugin\n    raise PluginNotFound(\nnautobot.extras.plugins.exceptions.PluginNotFound: Unable to import plugin 
nautobot_netbox_importer: Module not found. Check that the plugin module has been installed within the correct Python 
environment.", "stderr_lines": ["Traceback (most recent call last):", "  File \"/opt/nautobot/lib/python3.8/site-
packages/nautobot/extras/plugins/utils.py\", line 63, in load_plugin", "    plugin = importlib.import_module(plugin_name)", "  File \"/usr/lib/python3.8/importlib/__init__.py\", line 127, in import_module", "    return _bootstrap._gcd_import(name[level:], package, level)", "  File \"<frozen importlib._bootstrap>\", line 1014, in _gcd_import", "  File \"<frozen importlib._bootstrap>\", line 991
, in _find_and_load", "  File \"<frozen importlib._bootstrap>\", line 973, in _find_and_load_unlocked", "ModuleNotFoundError: No module named 'nautobot_netbox_importer'", "", "The above exception was the direct cause of the following exception:", "", 
"Traceback (most recent call last):", "  File \"/opt/nautobot/lib/python3.8/site-packages/nautobot/core/runner/runner.py\", line
118, in settings_callback", "    initializer(", "  File \"/opt/nautobot/lib/python3.8/site-packages/nautobot/core/cli.py\", line 178, i
n _configure_settings", "    load_plugins(settings)", "  File \"/opt/nautobot/lib/python3.8/site-
packages/nautobot/extras/plugins/utils.py\", line 53, in load_plugins", "    load_plugin(plugin_name, settings)", "  File 
\"/opt/nautobot/lib/python3.8/site-packages/nautobot/extras/plugins/utils.py\", line 66, in load_plugin", "    raise 
PluginNotFound(", "nautobot.extras.plugins.exceptions.PluginNotFound: Unable to import plugin nautobot_netbox_importer:
 Module not found. Check that the plugin module has been installed within the correct Python environment."], "stdout": "", 
"stdout_lines": []}
PluginNotFound(", "nautobot.extras.plugins.exceptions.PluginNotFound: 
Unable to import plugin nautobot_netbox_importer: Module not found. 
Check that the plugin module has been installed within the correct Python environment."], "stdout": "", "stdout_lines": []}

Steps to Reproduce

  1. Edit templates/requirements.txt
    • Add line nautobot-netbox-importer
  2. Edit templates/nautobot_config.py
    • Edit variable PLUGINS = ["nautobot_netbox_importer"]
  3. Edit Dockerfile
    • trying to install nautobot-netbox-importer extra RUN pip3 install nautobot-netbox-importer
  4. Build nautobot-lab image
    • docker build -t nautobot-lab:latest .
      • Error occurs

Am I missing some other configuration?

Nautobot 2.2.0 Default User Setup Fails

Nautobot Version 2.2.0

When the Ansible script executes default_user.py to seed the default 'demo' user, it throws an exception as nautobot.setup() method no longer exists.

@glennmatthews suggested to remove the django.setup() and nautobot.setup() calls and instead of invoking default_user.py via python3 executable to invoke via 'nautobot-server runscript ./templates/default_user.py/templates/default_user.py', but this throws an error with not able to load the modules with relative paths.

Tried the same method with absolute paths but get an exception as well.

Update for Nautobot 2.1

Now that 2.X is available it would be great to update this repo to default to Nautobot 2.1+.

Nautobot 1.6.0 fails to build current containers

It appears that one or more apps are not compatible with Nautobot 1.6.0.

368.7 TASK [RUN NAUTOBOT-SERVER POST_UPGRADE] ****************************************
379.9 fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["/opt/nautobot/bin/nautobot-server", "post_upgrade"], "delta": "0:00:10.964650", "end": "2023-08-11 01:01:35.204913", "msg": "non-zero return code", "rc": 1, "start": "2023-08-11 01:01:24.240263", "stderr": "Traceback (most recent call last):\n  File \"/opt/nautobot/lib/python3.10/site-packages/django_redis/cache.py\", line 29, in _decorator\n    return method(self, *args, **kwargs)\n  File \"/opt/nautobot/lib/python3.10/site-packages/django_redis/cache.py\", line 99, in _get\n    return self.client.get(key, default=default, version=version, client=client)\n  File \"/opt/nautobot/lib/python3.10/site-packages/django_redis/client/default.py\", line 260, in get\n    raise ConnectionInterrupted(connection=client) from e\ndjango_redis.exceptions.ConnectionInterrupted: Redis ConnectionError: Error 99 connecting to localhost:6379. Cannot assign requested address.\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"/opt/nautobot/bin/nautobot-server\", line 8, in <module>\n    sys.exit(main())\n  File \"/opt/nautobot/lib/python3.10/site-packages/nautobot/core/cli.py\", line 54, in main\n    run_app(\n  File \"/opt/nautobot/lib/python3.10/site-packages/nautobot/core/runner/runner.py\", line 297, in run_app\n    management.execute_from_command_line([runner_name, command] + command_args)\n  File \"/opt/nautobot/lib/python3.10/site-packages/django/core/management/__init__.py\", line 419, in execute_from_command_line\n    utility.execute()\n  File \"/opt/nautobot/lib/python3.10/site-packages/django/core/management/__init__.py\", line 413, in execute\n    self.fetch_command(subcommand).run_from_argv(self.argv)\n  File \"/opt/nautobot/lib/python3.10/site-packages/django/core/management/base.py\", line 354, in run_from_argv\n    self.execute(*args, **cmd_options)\n  File \"/opt/nautobot/lib/python3.10/site-packages/django/core/management/base.py\", line 398, in execute\n    output = self.handle(*args, **options)\n  File \"/opt/nautobot/lib/python3.10/site-packages/nautobot/core/management/commands/post_upgrade.py\", line 141, in handle\n    call_command(\"send_installation_metrics\")\n  File \"/opt/nautobot/lib/python3.10/site-packages/django/core/management/__init__.py\", line 181, in call_command\n    return command.execute(*args, **defaults)\n  File \"/opt/nautobot/lib/python3.10/site-packages/django/core/management/base.py\", line 398, in execute\n    output = self.handle(*args, **options)\n  File \"/opt/nautobot/lib/python3.10/site-packages/nautobot/core/management/commands/send_installation_metrics.py\", line 45, in handle\n    deployment_id = get_settings_or_config(\"DEPLOYMENT_ID\")\n  File \"/opt/nautobot/lib/python3.10/site-packages/nautobot/utilities/config.py\", line 12, in get_settings_or_config\n    return getattr(config, variable_name)\n  File \"/opt/nautobot/lib/python3.10/site-packages/django/utils/functional.py\", line 246, in inner\n    self._setup()\n  File \"/opt/nautobot/lib/python3.10/site-packages/constance/__init__.py\", line 14, in _setup\n    self._wrapped = Config()\n  File \"/opt/nautobot/lib/python3.10/site-packages/constance/base.py\", line 10, in __init__\n    utils.import_module_attr(settings.BACKEND)())\n  File \"/opt/nautobot/lib/python3.10/site-packages/constance/backends/database/__init__.py\", line 39, in __init__\n    self.autofill()\n  File \"/opt/nautobot/lib/python3.10/site-packages/constance/backends/database/__init__.py\", line 50, in autofill\n    if self._cache.get(full_cachekey):\n  File \"/opt/nautobot/lib/python3.10/site-packages/django_redis/cache.py\", line 92, in get\n    value = self._get(key, default, version, client)\n  File \"/opt/nautobot/lib/python3.10/site-packages/django_redis/cache.py\", line 36, in _decorator\n    raise e.__cause__\n  File \"/opt/nautobot/lib/python3.10/site-packages/django_redis/client/default.py\", line 258, in get\n    value = client.get(key)\n  File \"/opt/nautobot/lib/python3.10/site-packages/redis/commands/core.py\", line 1816, in get\n    return self.execute_command(\"GET\", name)\n  File \"/opt/nautobot/lib/python3.10/site-packages/redis/client.py\", line 1266, in execute_command\n    conn = self.connection or pool.get_connection(command_name, **options)\n  File \"/opt/nautobot/lib/python3.10/site-packages/redis/connection.py\", line 1461, in get_connection\n    connection.connect()\n  File \"/opt/nautobot/lib/python3.10/site-packages/redis/connection.py\", line 713, in connect\n    raise ConnectionError(self._error_message(e))\nredis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Cannot assign requested address.", "stderr_lines": ["Traceback (most recent call last):", "  File \"/opt/nautobot/lib/python3.10/site-packages/django_redis/cache.py\", line 29, in _decorator", "    return method(self, *args, **kwargs)", "  File \"/opt/nautobot/lib/python3.10/site-packages/django_redis/cache.py\", line 99, in _get", "    return self.client.get(key, default=default, version=version, client=client)", "  File \"/opt/nautobot/lib/python3.10/site-packages/django_redis/client/default.py\", line 260, in get", "    raise ConnectionInterrupted(connection=client) from e", "django_redis.exceptions.ConnectionInterrupted: Redis ConnectionError: Error 99 connecting to localhost:6379. Cannot assign requested address.", "", "During handling of the above exception, another exception occurred:", "", "Traceback (most recent call last):", "  File \"/opt/nautobot/bin/nautobot-server\", line 8, in <module>", "    sys.exit(main())", "  File \"/opt/nautobot/lib/python3.10/site-packages/nautobot/core/cli.py\", line 54, in main", "    run_app(", "  File \"/opt/nautobot/lib/python3.10/site-packages/nautobot/core/runner/runner.py\", line 297, in run_app", "    management.execute_from_command_line([runner_name, command] + command_args)", "  File \"/opt/nautobot/lib/python3.10/site-packages/django/core/management/__init__.py\", line 419, in execute_from_command_line", "    utility.execute()", "  File \"/opt/nautobot/lib/python3.10/site-packages/django/core/management/__init__.py\", line 413, in execute", "    self.fetch_command(subcommand).run_from_argv(self.argv)", "  File \"/opt/nautobot/lib/python3.10/site-packages/django/core/management/base.py\", line 354, in run_from_argv", "    self.execute(*args, **cmd_options)", "  File \"/opt/nautobot/lib/python3.10/site-packages/django/core/management/base.py\", line 398, in execute", "    output = self.handle(*args, **options)", "  File \"/opt/nautobot/lib/python3.10/site-packages/nautobot/core/management/commands/post_upgrade.py\", line 141, in handle", "    call_command(\"send_installation_metrics\")", "  File \"/opt/nautobot/lib/python3.10/site-packages/django/core/management/__init__.py\", line 181, in call_command", "    return command.execute(*args, **defaults)", "  File \"/opt/nautobot/lib/python3.10/site-packages/django/core/management/base.py\", line 398, in execute", "    output = self.handle(*args, **options)", "  File \"/opt/nautobot/lib/python3.10/site-packages/nautobot/core/management/commands/send_installation_metrics.py\", line 45, in handle", "    deployment_id = get_settings_or_config(\"DEPLOYMENT_ID\")", "  File \"/opt/nautobot/lib/python3.10/site-packages/nautobot/utilities/config.py\", line 12, in get_settings_or_config", "    return getattr(config, variable_name)", "  File \"/opt/nautobot/lib/python3.10/site-packages/django/utils/functional.py\", line 246, in inner", "    self._setup()", "  File \"/opt/nautobot/lib/python3.10/site-packages/constance/__init__.py\", line 14, in _setup", "    self._wrapped = Config()", "  File \"/opt/nautobot/lib/python3.10/site-packages/constance/base.py\", line 10, in __init__", "    utils.import_module_attr(settings.BACKEND)())", "  File \"/opt/nautobot/lib/python3.10/site-packages/constance/backends/database/__init__.py\", line 39, in __init__", "    self.autofill()", "  File \"/opt/nautobot/lib/python3.10/site-packages/constance/backends/database/__init__.py\", line 50, in autofill", "    if self._cache.get(full_cachekey):", "  File \"/opt/nautobot/lib/python3.10/site-packages/django_redis/cache.py\", line 92, in get", "    value = self._get(key, default, version, client)", "  File \"/opt/nautobot/lib/python3.10/site-packages/django_redis/cache.py\", line 36, in _decorator", "    raise e.__cause__", "  File \"/opt/nautobot/lib/python3.10/site-packages/django_redis/client/default.py\", line 258, in get", "    value = client.get(key)", "  File \"/opt/nautobot/lib/python3.10/site-packages/redis/commands/core.py\", line 1816, in get", "    return self.execute_command(\"GET\", name)", "  File \"/opt/nautobot/lib/python3.10/site-packages/redis/client.py\", line 1266, in execute_command", "    conn = self.connection or pool.get_connection(command_name, **options)", "  File \"/opt/nautobot/lib/python3.10/site-packages/redis/connection.py\", line 1461, in get_connection", "    connection.connect()", "  File \"/opt/nautobot/lib/python3.10/site-packages/redis/connection.py\", line 713, in connect", "    raise ConnectionError(self._error_message(e))", "redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Cannot assign requested address."], "stdout": "Performing database migrations...\nOperations to perform:\n  Apply all migrations: admin, auth, circuits, contenttypes, database, dcim, django_celery_beat, django_rq, extras, ipam, nautobot_bgp_models, nautobot_circuit_maintenance, nautobot_data_validation_engine, nautobot_device_lifecycle_mgmt, nautobot_device_onboarding, nautobot_firewall_models, nautobot_floor_plan, nautobot_golden_config, nautobot_ssot, sessions, social_django, taggit, tenancy, users, virtualization, welcome_wizard\nRunning migrations:\n  No migrations to apply.\n\nGenerating cable paths...\nFound no missing circuit termination paths; skipping\nFound no missing console port paths; skipping\nFound no missing console server port paths; skipping\nFound no missing interface paths; skipping\nFound no missing power feed paths; skipping\nFound no missing power outlet paths; skipping\nFound no missing power port paths; skipping\nFinished.\n\nCollecting static files...\n\n0 static files copied to '/opt/nautobot/static', 834 unmodified.\n\nRemoving stale content types...\n\nRemoving expired sessions...\n\nInvalidating cache...\n\nSending installation metrics...", "stdout_lines": ["Performing database migrations...", "Operations to perform:", "  Apply all migrations: admin, auth, circuits, contenttypes, database, dcim, django_celery_beat, django_rq, extras, ipam, nautobot_bgp_models, nautobot_circuit_maintenance, nautobot_data_validation_engine, nautobot_device_lifecycle_mgmt, nautobot_device_onboarding, nautobot_firewall_models, nautobot_floor_plan, nautobot_golden_config, nautobot_ssot, sessions, social_django, taggit, tenancy, users, virtualization, welcome_wizard", "Running migrations:", "  No migrations to apply.", "", "Generating cable paths...", "Found no missing circuit termination paths; skipping", "Found no missing console port paths; skipping", "Found no missing console server port paths; skipping", "Found no missing interface paths; skipping", "Found no missing power feed paths; skipping", "Found no missing power outlet paths; skipping", "Found no missing power port paths; skipping", "Finished.", "", "Collecting static files...", "", "0 static files copied to '/opt/nautobot/static', 834 unmodified.", "", "Removing stale content types...", "", "Removing expired sessions...", "", "Invalidating cache...", "", "Sending installation metrics..."]}
379.9 
379.9 PLAY RECAP *********************************************************************
379.9 localhost                  : ok=15   changed=14   unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
379.9 

Error Running on Ubuntu 20.04 (WSL2)

2021-03-05 15:14:48,528 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2021-03-05 15:14:48,529 INFO supervisord started with pid 7
2021-03-05 15:14:49,535 INFO spawned: 'nautobot' with pid 9
2021-03-05 15:14:49,542 INFO spawned: 'nautobot-rq' with pid 10
2021-03-05 15:14:49,543 INFO spawned: 'postgresql-server' with pid 11
2021-03-05 15:14:49,544 INFO spawned: 'redis-server' with pid 12
2021-03-05 15:14:50,599 INFO success: postgresql-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-03-05 15:14:50,599 INFO exited: nautobot (exit status 1; not expected)
2021-03-05 15:14:50,608 INFO exited: nautobot-rq (exit status 1; not expected)
2021-03-05 15:14:51,610 INFO spawned: 'nautobot' with pid 23
2021-03-05 15:14:51,612 INFO spawned: 'nautobot-rq' with pid 24
2021-03-05 15:14:52,634 INFO success: redis-server entered RUNNING state, process has stayed up for > than 3 seconds (startsecs)
2021-03-05 15:14:52,634 INFO exited: nautobot (exit status 1; not expected)
2021-03-05 15:14:52,638 INFO exited: nautobot-rq (exit status 1; not expected)
2021-03-05 15:14:54,641 INFO spawned: 'nautobot' with pid 31
2021-03-05 15:14:54,642 INFO spawned: 'nautobot-rq' with pid 32
2021-03-05 15:14:55,663 INFO exited: nautobot-rq (exit status 1; not expected)
2021-03-05 15:14:55,665 INFO exited: nautobot (exit status 1; not expected)
2021-03-05 15:14:58,669 INFO spawned: 'nautobot' with pid 39
2021-03-05 15:14:58,671 INFO spawned: 'nautobot-rq' with pid 40
2021-03-05 15:14:59,628 INFO exited: nautobot-rq (exit status 1; not expected)
2021-03-05 15:14:59,631 INFO gave up: nautobot-rq entered FATAL state, too many start retries too quickly
2021-03-05 15:14:59,631 INFO exited: nautobot (exit status 1; not expected)
2021-03-05 15:14:59,948 INFO gave up: nautobot entered FATAL state, too many start retries too quickly
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/local/bin/nautobot-server", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/nautobot/core/cli.py", line 55, in main
    run_app(
  File "/usr/local/lib/python3.8/dist-packages/nautobot/core/runner/runner.py", line 268, in run_app
    management.execute_from_command_line([runner_name, command] + command_args)
  File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 377, in execute
    django.setup()
  File "/usr/local/lib/python3.8/dist-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.8/dist-packages/django/apps/registry.py", line 122, in populate
    app_config.ready()
  File "/usr/local/lib/python3.8/dist-packages/nautobot/extras/apps.py", line 19, in ready
    wrap_model_clean_methods()
  File "/usr/local/lib/python3.8/dist-packages/nautobot/extras/plugins/validators.py", line 43, in wrap_model_clean_methods
    for model in ContentType.objects.filter(FeatureQuery("custom_validators").get_query()):
  File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 287, in __iter__
    self._fetch_all()
  File "/usr/local/lib/python3.8/dist-packages/cacheops/query.py", line 273, in _fetch_all
    return self._no_monkey._fetch_all(self)
  File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 1308, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 53, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/usr/local/lib/python3.8/dist-packages/django/db/models/sql/compiler.py", line 1154, in execute_sql
    cursor = self.connection.cursor()
  File "/usr/local/lib/python3.8/dist-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 259, in cursor
    return self._cursor()
  File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 235, in _cursor
    self.ensure_connection()
  File "/usr/local/lib/python3.8/dist-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 219, in ensure_connection
    self.connect()
  File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 219, in ensure_connection
    self.connect()
  File "/usr/local/lib/python3.8/dist-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/django/db/backends/base/base.py", line 200, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/usr/local/lib/python3.8/dist-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/usr/local/lib/python3.8/dist-packages/psycopg2/__init__.py", line 127, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: FATAL:  the database system is starting up
FATAL:  the database system is starting up
root@dfb2d8cac4e8:/opt/nautobot# cat postgres-error.log
2021-03-05 15:17:28.086 CST [11] LOG:  starting PostgreSQL 12.6 (Ubuntu 12.6-0ubuntu0.20.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit
2021-03-05 15:17:28.087 CST [11] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2021-03-05 15:17:28.087 CST [11] LOG:  could not bind IPv6 address "::1": Cannot assign requested address
2021-03-05 15:17:28.087 CST [11] HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2021-03-05 15:17:28.098 CST [11] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-03-05 15:17:28.119 CST [16] LOG:  database system was interrupted; last known up at 2021-03-05 14:47:03 CST
2021-03-05 15:17:28.863 CST [19] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:28.864 CST [21] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:28.865 CST [20] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:28.865 CST [22] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:30.856 CST [27] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:30.856 CST [29] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:30.857 CST [28] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:30.857 CST [30] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:33.808 CST [35] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:33.808 CST [36] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:33.808 CST [37] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:33.808 CST [38] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:37.835 CST [43] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:37.835 CST [44] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:37.836 CST [45] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:37.836 CST [46] nautobot@nautobot FATAL:  the database system is starting up
2021-03-05 15:17:38.866 CST [16] LOG:  database system was not properly shut down; automatic recovery in progress
2021-03-05 15:17:38.872 CST [16] LOG:  redo starts at 0/16486C0
2021-03-05 15:17:38.902 CST [16] LOG:  invalid record length at 0/1A5DC68: wanted 24, got 0
2021-03-05 15:17:38.902 CST [16] LOG:  redo done at 0/1A5DC40
2021-03-05 15:17:39.804 CST [11] LOG:  database system is ready to accept connections

Essentially supervisord is giving up on nautobot before postgresql has completely started up.

Cant use the device onboarding plugin

I cannot figure out how to use the device onboarding plugin. It comes installed with the lab. I have checked the nautobot_config.py file. It enabled in the plugins section and is configured with no extra parameters. It should show up in the left under plugins, but instead all that is there is installed plugins. When I click on that I see the onboarding plugin but the home button is a different color and nothing happens when I click or hover on it. Most of the other plugins are like this as well.

I started the lab instance with docker run -itd --name nautobot -p 8000:8000 --env NAPALM_USERNAME="demouser" --env NAPALM_PASSWORD="demopass" networktocode/nautobot-lab:latest

image

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.