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

Debian builds entrypoint issues #777

Closed
tyler-8 opened this issue Jun 17, 2022 · 2 comments
Closed

Debian builds entrypoint issues #777

tyler-8 opened this issue Jun 17, 2022 · 2 comments

Comments

@tyler-8
Copy link

tyler-8 commented Jun 17, 2022

Current Behavior

When I attempt to run docker compose run --rm netbox ./manage.py nbshell I get the following output:

% docker compose run --rm netbox ./manage.py nbshell
WARN[0000] mount of type `volume` should not define `bind` option
Traceback (most recent call last):
  File "/opt/netbox/netbox/./manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

I'm using the develop-branch debian-build 61a3afb and docker-compose up -d runs all the services as expected.

Expected Behavior

In prior builds/versions, this command worked docker compose run --rm netbox ./manage.py nbshell without any changes on my end. It seems like the netbox Python environment isn't being activated or referenced as it was before.

Docker Compose Version

Docker Compose version v2.6.0

Docker Version

Client:
 Cloud integration: v1.0.25
 Version:           20.10.16
 API version:       1.41
 Go version:        go1.17.10
 Git commit:        aa7e414
 Built:             Thu May 12 09:20:34 2022
 OS/Arch:           darwin/arm64
 Context:           default
 Experimental:      true

Server: Docker Desktop 4.9.0 (80466)
 Engine:
  Version:          20.10.16
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.17.10
  Git commit:       f756502
  Built:            Thu May 12 09:14:19 2022
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.4
  GitCommit:        212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
 runc:
  Version:          1.1.1
  GitCommit:        v1.1.1-0-g52de29d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

The git Revision

f80cc70

The git Status

On branch develop
Your branch is up to date with 'origin/develop'.

Startup Command

docker-compose up -d

NetBox Logs

netbox-docker-netbox-1  | 🧬 loaded config '/etc/netbox/config/configuration.py'
netbox-docker-netbox-1  | 🧬 loaded config '/etc/netbox/config/extra.py'
netbox-docker-netbox-1  | 🧬 loaded config '/etc/netbox/config/logging.py'
netbox-docker-netbox-1  | 🧬 loaded config '/etc/netbox/config/plugins.py'
netbox-docker-netbox-1  | 💡 Superuser Username: admin, E-Mail: admin@example.com
netbox-docker-netbox-1  | 🧬 loaded config '/etc/netbox/config/configuration.py'
netbox-docker-netbox-1  | 🧬 loaded config '/etc/netbox/config/extra.py'
netbox-docker-netbox-1  | 🧬 loaded config '/etc/netbox/config/logging.py'
netbox-docker-netbox-1  | 🧬 loaded config '/etc/netbox/config/plugins.py'
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/000_users.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/005_wipe_changelog.py
netbox-docker-netbox-1  | Changes left 0
netbox-docker-netbox-1  | Users left: []
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/010_groups.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/020_object_permissions.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/030_custom_fields.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/040_custom_links.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/050_tags.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/060_webhooks.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/070_tenant_groups.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/080_tenants.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/090_regions.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/110_sites.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/120_locations.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/130_rack_roles.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/140_racks.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/150_power_panels.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/160_power_feeds.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/170_manufacturers.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/180_device_roles.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/190_device_types.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/200_devices.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/210_dcim_interfaces.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/220_platforms.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/230_route_targets.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/240_vrfs.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/250_rirs.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/260_asns.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/270_aggregates.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/280_prefix_vlan_roles.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/290_cluster_types.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/300_cluster_groups.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/310_clusters.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/320_vlan_groups.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/330_vlans.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/340_virtual_machines.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/350_virtualization_interfaces.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/360_prefixes.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/370_ip_addresses.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/380_primary_ips.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/400_services.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/420_providers.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/440_circuit_types.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/450_circuits.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/460_cables.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/470_contact_groups.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/480_contact_roles.py
netbox-docker-netbox-1  | ▶️  Running the startup script /opt/netbox/startup_scripts/490_contacts.py
netbox-docker-netbox-1  | ✅ Initialisation is done.
netbox-docker-netbox-1  | ⏳ Waiting for control socket to be created... (1/10)
netbox-docker-netbox-1  | 2022/06/17 13:38:26 [warn] 7#7 Unit is running unprivileged, then it cannot use arbitrary user and group.
netbox-docker-netbox-1  | 2022/06/17 13:38:26 [info] 7#7 unit 1.27.0 started
netbox-docker-netbox-1  | 2022/06/17 13:38:26 [info] 16#16 discovery started
netbox-docker-netbox-1  | 2022/06/17 13:38:26 [notice] 16#16 module: python 3.9.2 "/usr/lib/unit/modules/python3.9.unit.so"
netbox-docker-netbox-1  | 2022/06/17 13:38:26 [info] 7#7 controller started
netbox-docker-netbox-1  | 2022/06/17 13:38:26 [info] 18#18 router started
netbox-docker-netbox-1  | 2022/06/17 13:38:26 [notice] 7#7 process 16 exited with code 0
netbox-docker-netbox-1  | 2022/06/17 13:38:26 [info] 18#18 OpenSSL 1.1.1n  15 Mar 2022, 101010ef
netbox-docker-netbox-1  | ⚙️ Applying configuration from /etc/unit/nginx-unit.json
netbox-docker-netbox-1  | 2022/06/17 13:38:27 [info] 22#22 "netbox" prototype started
netbox-docker-netbox-1  | 2022/06/17 13:38:27 [info] 23#23 "netbox" application started
netbox-docker-netbox-1  | ✅ Unit configuration loaded successfully
netbox-docker-netbox-1  | 2022/06/17 13:38:28 [notice] 7#7 process 14 exited with code 0

Content of docker-compose.override.yml

version: "3.4"
services:
  netbox:
    ports:
      - "8081:8080"
  postgres:
    image: postgres:10-alpine
    ports:
      - "5433:5432"
  redis:
    ports:
      - "6379:6379"
  redis-cache:
    ports:
      - "6380:6379"
@tyler-8
Copy link
Author

tyler-8 commented Jun 17, 2022

I do see the entries in the wiki regarding this. But those seem like workarounds more than addressing the issue. As I said in the OP, I've always used docker compose run --rm netbox ./manage.py nbshell without manually sourcing the venv or pointing to a specific Python binary in the container.

@tobiasge
Copy link
Member

Closed with #778

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

2 participants