linuxserver / docker-netbox

GNU General Public License v3.0
79 stars 17 forks source link

Bad Request (400) #11

Closed tonydm closed 1 year ago

tonydm commented 3 years ago

linuxserver.io

Error: Bad Request (400)

Expected Behavior

Netbox container comes up and is accessible

Current Behavior

Bad Request (400)

Steps to Reproduce

  1. Create Docker Compose File
  2. Run docker-compose up

Environment

OS: Ubuntu 18.04.5 LTS Arch: x86_64 Official Docker Install script curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh && rm get-docker.sh Docker Version: 20.10.2 build 2291f61

Command used to create docker container (run/create/compose/screenshot)

version: "3.5"

x-env-global: &env-global
   - &POSTGRES_DATABASE "netbox"
   - &POSTGRES_USER "<obfuscated>"
   - &POSTGRES_PASSWORD "<obfuscated>"
   - &TZ "America/Phoenix"
   - &PUID "1001"
   - &PGID "999"

services:
  netbox:
    image: ghcr.io/linuxserver/netbox
    container_name: netbox
    environment:
      PUID: *PUID
      PGID: *PGID
      SUPERUSER_EMAIL: <obfuscated>
      SUPERUSER_PASSWORD: <obfuscated>
      ALLOWED_HOST: 172.20.0.5
      DB_NAME: netbox
      DB_USER: *POSTGRES_USER
      DB_PASSWORD: *POSTGRES_PASSWORD
      DB_HOST: db
      REDIS_HOST: redis
      TZ: *TZ
    volumes:
      - ${USERDIR}/netbox/config:/config
    ports:
      - 8000:8000
    depends_on:
      - redis
      - db
    restart: unless-stopped

  redis:
    image: redis:5.0-alpine
    environment:
      TZ: *TZ
    restart: always

  db:
    image: postgres
    volumes:
      - ${USERDIR}/netbox/db:/var/lib/postgresql/data
    environment:
      TZ: *TZ
      POSTGRES_USER: *POSTGRES_USER
      POSTGRES_PASSWORD: *POSTGRES_PASSWORD
    restart: always

Docker logs

services-admin@datastore:(172.20.0.9)~/DockerServices/netebox$ docker-compose logs -f 
Attaching to netbox, netbox_pgadmin_1, netbox_redis_1, netbox_db_1
netbox     | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
netbox     | [s6-init] ensuring user provided files have correct perms...exited 0.
netbox     | [fix-attrs.d] applying ownership & permissions fixes...
netbox     | [fix-attrs.d] done.
netbox     | [cont-init.d] executing container initialization scripts...
netbox     | [cont-init.d] 01-envfile: executing... 
netbox     | [cont-init.d] 01-envfile: exited 0.
netbox     | [cont-init.d] 10-adduser: executing... 
netbox     | 
netbox     | -------------------------------------
netbox     |           _         ()
netbox     |          | |  ___   _    __
netbox     |          | | / __| | |  /  \ 
netbox     |          | | \__ \ | | | () |
netbox     |          |_| |___/ |_|  \__/
netbox     | 
netbox     | 
netbox     | Brought to you by linuxserver.io
netbox     | -------------------------------------
netbox     | 
netbox     | To support LSIO projects visit:
netbox     | https://www.linuxserver.io/donate/
netbox     | -------------------------------------
netbox     | GID/UID
netbox     | -------------------------------------
netbox     | 
netbox     | User uid:    1001
netbox     | User gid:    999
netbox     | -------------------------------------
netbox     | 
netbox     | [cont-init.d] 10-adduser: exited 0.
netbox     | [cont-init.d] 50-config: executing... 
netbox     | Operations to perform:
netbox     |   Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, secrets, sessions, taggit, tenancy, users, virtualization
netbox     | Running migrations:
netbox     |   Applying contenttypes.0001_initial... OK
netbox     |   Applying auth.0001_initial... OK
netbox     |   Applying admin.0001_initial... OK
netbox     |   Applying admin.0002_logentry_remove_auto_add... OK
netbox     |   Applying admin.0003_logentry_add_action_flag_choices... OK
netbox     |   Applying contenttypes.0002_remove_content_type_name... OK
netbox     |   Applying auth.0002_alter_permission_name_max_length... OK
netbox     |   Applying auth.0003_alter_user_email_max_length... OK
netbox     |   Applying auth.0004_alter_user_username_opts... OK
netbox     |   Applying auth.0005_alter_user_last_login_null... OK
netbox     |   Applying auth.0006_require_contenttypes_0002... OK
netbox     |   Applying auth.0007_alter_validators_add_error_messages... OK
netbox     |   Applying auth.0008_alter_user_username_max_length... OK
netbox     |   Applying auth.0009_alter_user_last_name_max_length... OK
netbox     |   Applying auth.0010_alter_group_name_max_length... OK
netbox     |   Applying auth.0011_update_proxy_permissions... OK
netbox     |   Applying auth.0012_alter_user_first_name_max_length... OK
netbox     |   Applying tenancy.0001_initial... OK
netbox     |   Applying tenancy.0002_tenant_group_optional... OK
netbox     |   Applying tenancy.0003_unicode_literals... OK
netbox     |   Applying dcim.0001_initial... OK
netbox     |   Applying ipam.0001_initial... OK
netbox     |   Applying ipam.0002_vrf_add_enforce_unique... OK
netbox     |   Applying dcim.0002_auto_20160622_1821... OK
netbox     |   Applying dcim.0003_auto_20160628_1721... OK
netbox     |   Applying dcim.0004_auto_20160701_2049... OK
netbox     |   Applying dcim.0005_auto_20160706_1722... OK
netbox     |   Applying dcim.0006_add_device_primary_ip4_ip6... OK
netbox     |   Applying dcim.0007_device_copy_primary_ip... OK
netbox     |   Applying dcim.0008_device_remove_primary_ip... OK
netbox     |   Applying dcim.0009_site_32bit_asn_support... OK
netbox     |   Applying dcim.0010_devicebay_installed_device_set_null... OK
netbox     |   Applying ipam.0003_ipam_add_vlangroups... OK
netbox     |   Applying ipam.0004_ipam_vlangroup_uniqueness... OK
netbox     |   Applying ipam.0005_auto_20160725_1842... OK
netbox     |   Applying ipam.0006_vrf_vlan_add_tenant... OK
netbox     |   Applying ipam.0007_prefix_ipaddress_add_tenant... OK
netbox     |   Applying ipam.0008_prefix_change_order... OK
netbox     |   Applying ipam.0009_ipaddress_add_status... OK
netbox     |   Applying ipam.0010_ipaddress_help_texts... OK
netbox     |   Applying ipam.0011_rir_add_is_private... OK
netbox     |   Applying dcim.0011_devicetype_part_number... OK
netbox     |   Applying dcim.0012_site_rack_device_add_tenant... OK
netbox     |   Applying dcim.0013_add_interface_form_factors... OK
netbox     |   Applying dcim.0014_rack_add_type_width... OK
netbox     |   Applying dcim.0015_rack_add_u_height_validator... OK
netbox     |   Applying dcim.0016_module_add_manufacturer... OK
netbox     |   Applying dcim.0017_rack_add_role... OK
netbox     |   Applying dcim.0018_device_add_asset_tag... OK
netbox     |   Applying dcim.0019_new_iface_form_factors... OK
netbox     |   Applying dcim.0020_rack_desc_units... OK
netbox     |   Applying dcim.0021_add_ff_flexstack... OK
netbox     |   Applying dcim.0022_color_names_to_rgb... OK
netbox     |   Applying ipam.0012_services... OK
netbox     |   Applying ipam.0013_prefix_add_is_pool... OK
netbox     |   Applying ipam.0014_ipaddress_status_add_deprecated... OK
netbox     |   Applying ipam.0015_global_vlans... OK
netbox     |   Applying ipam.0016_unicode_literals... OK
netbox     |   Applying ipam.0017_ipaddress_roles... OK
netbox     |   Applying ipam.0018_remove_service_uniqueness_constraint... OK
netbox     |   Applying dcim.0023_devicetype_comments... OK
netbox     |   Applying dcim.0024_site_add_contact_fields... OK
netbox     |   Applying dcim.0025_devicetype_add_interface_ordering... OK
netbox     |   Applying dcim.0026_add_rack_reservations... OK
netbox     |   Applying dcim.0027_device_add_site... OK
netbox     |   Applying dcim.0028_device_copy_rack_to_site... OK
netbox     |   Applying dcim.0029_allow_rackless_devices... OK
netbox     |   Applying dcim.0030_interface_add_lag... OK
netbox     |   Applying dcim.0031_regions... OK
netbox     |   Applying dcim.0032_device_increase_name_length... OK
netbox     |   Applying dcim.0033_rackreservation_rack_editable... OK
netbox     |   Applying dcim.0034_rename_module_to_inventoryitem... OK
netbox     |   Applying dcim.0035_device_expand_status_choices... OK
netbox     |   Applying dcim.0036_add_ff_juniper_vcp... OK
netbox     |   Applying dcim.0037_unicode_literals... OK
netbox     |   Applying dcim.0038_wireless_interfaces... OK
netbox     |   Applying dcim.0039_interface_add_enabled_mtu... OK
netbox     |   Applying dcim.0040_inventoryitem_add_asset_tag_description... OK
netbox     |   Applying dcim.0041_napalm_integration... OK
netbox     |   Applying dcim.0042_interface_ff_10ge_cx4... OK
netbox     |   Applying dcim.0043_device_component_name_lengths... OK
netbox     |   Applying virtualization.0001_virtualization... OK
netbox     |   Applying virtualization.0002_virtualmachine_add_status... OK
netbox     |   Applying dcim.0044_virtualization... OK
netbox     |   Applying virtualization.0003_cluster_add_site... OK
netbox     |   Applying virtualization.0004_virtualmachine_add_role... OK
netbox     |   Applying virtualization.0005_django2... OK
netbox     |   Applying taggit.0001_initial... OK
netbox     |   Applying taggit.0002_auto_20150616_2121... OK
netbox     |   Applying virtualization.0006_tags... OK
netbox     |   Applying virtualization.0007_change_logging... OK
netbox     |   Applying virtualization.0008_virtualmachine_local_context_data... OK
netbox     |   Applying tenancy.0004_tags... OK
netbox     |   Applying tenancy.0005_change_logging... OK
netbox     |   Applying extras.0001_initial... OK
netbox     |   Applying extras.0002_custom_fields... OK
netbox     |   Applying extras.0003_exporttemplate_add_description... OK
netbox     |   Applying extras.0004_topologymap_change_comma_to_semicolon... OK
netbox     |   Applying extras.0005_useraction_add_bulk_create... OK
netbox     |   Applying extras.0006_add_imageattachments... OK
netbox     |   Applying extras.0007_unicode_literals... OK
netbox     |   Applying extras.0008_reports... OK
netbox     |   Applying extras.0009_topologymap_type... OK
netbox     |   Applying extras.0010_customfield_filter_logic... OK
netbox     |   Applying extras.0011_django2... OK
netbox     |   Applying extras.0012_webhooks... OK
netbox     |   Applying extras.0013_objectchange... OK
netbox     |   Applying ipam.0019_virtualization... OK
netbox     |   Applying ipam.0020_ipaddress_add_role_carp... OK
netbox     |   Applying dcim.0045_devicerole_vm_role... OK
netbox     |   Applying dcim.0046_rack_lengthen_facility_id... OK
netbox     |   Applying dcim.0047_more_100ge_form_factors... OK
netbox     |   Applying dcim.0048_rack_serial... OK
netbox     |   Applying dcim.0049_rackreservation_change_user... OK
netbox     |   Applying dcim.0050_interface_vlan_tagging... OK
netbox     |   Applying dcim.0051_rackreservation_tenant... OK
netbox     |   Applying dcim.0052_virtual_chassis... OK
netbox     |   Applying dcim.0053_platform_manufacturer... OK
netbox     |   Applying dcim.0054_site_status_timezone_description... OK
netbox     |   Applying dcim.0055_virtualchassis_ordering... OK
netbox     |   Applying dcim.0056_django2... OK
netbox     |   Applying dcim.0057_tags... OK
netbox     |   Applying dcim.0058_relax_rack_naming_constraints... OK
netbox     |   Applying dcim.0059_site_latitude_longitude... OK
netbox     |   Applying dcim.0060_change_logging... OK
netbox     |   Applying dcim.0061_platform_napalm_args... OK
netbox     |   Applying extras.0014_configcontexts... OK
netbox     |   Applying extras.0015_remove_useraction... OK
netbox     |   Applying extras.0016_exporttemplate_add_cable... OK
netbox     |   Applying extras.0017_exporttemplate_mime_type_length... OK
netbox     |   Applying extras.0018_exporttemplate_add_jinja2... OK
netbox     |   Applying extras.0019_tag_taggeditem... OK
netbox     |   Applying virtualization.0009_custom_tag_models... OK
netbox     |   Applying virtualization.0010_cluster_add_tenant... OK
netbox     |   Applying virtualization.0011_3569_virtualmachine_fields... OK
netbox     |   Applying tenancy.0006_custom_tag_models... OK
netbox     |   Applying virtualization.0012_vm_name_nonunique... OK
netbox     |   Applying virtualization.0013_deterministic_ordering... OK
netbox     |   Applying virtualization.0014_standardize_description... OK
netbox     |   Applying ipam.0021_vrf_ordering... OK
netbox     |   Applying ipam.0022_tags... OK
netbox     |   Applying ipam.0023_change_logging... OK
netbox     |   Applying ipam.0024_vrf_allow_null_rd... OK
netbox     |   Applying ipam.0025_custom_tag_models... OK
pgadmin_1  | NOTE: Configuring authentication for DESKTOP mode.
pgadmin_1  | pgAdmin 4 - Application Initialisation
pgadmin_1  | ======================================
pgadmin_1  | 
pgadmin_1  | Starting pgAdmin 4. Please navigate to http://0.0.0.0:5050 in your browser.
pgadmin_1  | Traceback (most recent call last):
pgadmin_1  |   File "/usr/local/lib/python2.7/SocketServer.py", line 596, in process_request_thread
pgadmin_1  |     self.finish_request(request, client_address)
pgadmin_1  |   File "/usr/local/lib/python2.7/SocketServer.py", line 331, in finish_request
pgadmin_1  |     self.RequestHandlerClass(request, client_address, self)
pgadmin_1  |   File "/usr/local/lib/python2.7/SocketServer.py", line 654, in __init__
pgadmin_1  |     self.finish()
pgadmin_1  |   File "/usr/local/lib/python2.7/SocketServer.py", line 713, in finish
pgadmin_1  |     self.wfile.close()
pgadmin_1  |   File "/usr/local/lib/python2.7/socket.py", line 283, in close
pgadmin_1  |     self.flush()
pgadmin_1  |   File "/usr/local/lib/python2.7/socket.py", line 307, in flush
pgadmin_1  |     self._sock.sendall(view[write_offset:write_offset+buffer_size])
pgadmin_1  | error: [Errno 32] Broken pipe
netbox     |   Applying ipam.0026_prefix_ordering_vrf_nulls_first... OK
netbox     |   Applying ipam.0027_ipaddress_add_dns_name... OK
netbox     |   Applying ipam.0028_3569_prefix_fields... OK
netbox     |   Applying ipam.0029_3569_ipaddress_fields... OK
netbox     |   Applying ipam.0030_3569_vlan_fields... OK
netbox     |   Applying ipam.0031_3569_service_fields... OK
netbox     |   Applying ipam.0032_role_description... OK
netbox     |   Applying ipam.0033_deterministic_ordering... OK
netbox     |   Applying ipam.0034_fix_ipaddress_status_dhcp... OK
netbox     |   Applying ipam.0035_drop_ip_family... OK
netbox     |   Applying ipam.0036_standardize_description... OK
netbox     |   Applying secrets.0001_initial... OK
netbox     |   Applying secrets.0002_userkey_add_session_key... OK
netbox     |   Applying secrets.0003_unicode_literals... OK
netbox     |   Applying secrets.0004_tags... OK
netbox     |   Applying secrets.0005_change_logging... OK
netbox     |   Applying secrets.0006_custom_tag_models... OK
netbox     |   Applying dcim.0062_interface_mtu... OK
netbox     |   Applying dcim.0063_device_local_context_data... OK
netbox     |   Applying dcim.0064_remove_platform_rpc_client... OK
netbox     |   Applying dcim.0065_front_rear_ports... OK
netbox     |   Applying circuits.0001_initial... OK
netbox     |   Applying circuits.0002_auto_20160622_1821... OK
netbox     |   Applying circuits.0003_provider_32bit_asn_support... OK
netbox     |   Applying circuits.0004_circuit_add_tenant... OK
netbox     |   Applying circuits.0005_circuit_add_upstream_speed... OK
netbox     |   Applying circuits.0006_terminations... OK
netbox     |   Applying dcim.0066_cables...
netbox     |     Adding console connections... 0 cables created
netbox     |     Adding power connections... 0 cables created
netbox     |     Adding interface connections... 0 cables created
netbox     |  OK
netbox     |   Applying dcim.0067_device_type_remove_qualifiers... OK
netbox     |   Applying dcim.0068_rack_new_fields... OK
netbox     |   Applying dcim.0069_deprecate_nullablecharfield... OK
netbox     |   Applying dcim.0070_custom_tag_models... OK
netbox     |   Applying circuits.0007_circuit_add_description... OK
netbox     |   Applying circuits.0008_circuittermination_interface_protect_on_delete... OK
netbox     |   Applying circuits.0009_unicode_literals... OK
netbox     |   Applying circuits.0010_circuit_status... OK
netbox     |   Applying circuits.0011_tags... OK
netbox     |   Applying circuits.0012_change_logging... OK
netbox     |   Applying circuits.0013_cables...
netbox     |     Adding circuit terminations... 0 cables created
netbox     |  OK
netbox     |   Applying circuits.0014_circuittermination_description... OK
netbox     |   Applying circuits.0015_custom_tag_models... OK
netbox     |   Applying extras.0020_tag_data... OK
netbox     |   Applying extras.0021_add_color_comments_changelog_to_tag... OK
netbox     |   Applying extras.0022_custom_links... OK
netbox     |   Applying extras.0023_fix_tag_sequences... OK
netbox     |   Applying extras.0024_scripts... OK
netbox     |   Applying extras.0025_objectchange_time_index... OK
netbox     |   Applying extras.0026_webhook_ca_file_path... OK
netbox     |   Applying extras.0027_webhook_additional_headers... OK
netbox     |   Applying extras.0028_remove_topology_maps... OK
netbox     |   Applying extras.0029_3569_customfield_fields... OK
netbox     |   Applying extras.0030_3569_objectchange_fields... OK
netbox     |   Applying extras.0031_3569_exporttemplate_fields... OK
netbox     |   Applying extras.0032_3569_webhook_fields... OK
netbox     |   Applying extras.0033_graph_type_template_language... OK
netbox     |   Applying extras.0034_configcontext_tags... OK
netbox     |   Applying extras.0035_deterministic_ordering... OK
netbox     |   Applying extras.0036_contenttype_filters_to_q_objects... OK
netbox     |   Applying extras.0037_configcontexts_clusters... OK
netbox     |   Applying extras.0038_webhook_template_support... OK
netbox     |   Applying extras.0039_update_features_content_types... OK
netbox     |   Applying extras.0040_standardize_description... OK
netbox     |   Applying extras.0041_tag_description... OK
netbox     |   Applying extras.0042_customfield_manager... OK
netbox     |   Applying virtualization.0015_vminterface... OK
netbox     |   Applying ipam.0037_ipaddress_assignment... OK
netbox     |   Applying dcim.0071_device_components_add_description... OK
netbox     |   Applying dcim.0072_powerfeeds... OK
netbox     |   Applying dcim.0073_interface_form_factor_to_type... OK
netbox     |   Applying dcim.0074_increase_field_length_platform_name_slug... OK
netbox     |   Applying dcim.0075_cable_devices...
netbox     | Updating cable device terminations...
netbox     |  OK
netbox     |   Applying dcim.0076_console_port_types... OK
netbox     |   Applying dcim.0077_power_types... OK
netbox     |   Applying dcim.0078_3569_site_fields... OK
netbox     |   Applying dcim.0079_3569_rack_fields... OK
netbox     |   Applying dcim.0080_3569_devicetype_fields... OK
netbox     |   Applying dcim.0081_3569_device_fields... OK
netbox     |   Applying dcim.0082_3569_interface_fields... OK
netbox     |   Applying virtualization.0016_replicate_interfaces...
netbox     |     Replicating 0 VM interfaces...
netbox     |     Replicating assigned objects...
netbox     |  OK
netbox     |   Applying dcim.0082_3569_port_fields... OK
netbox     |   Applying dcim.0083_3569_cable_fields... OK
netbox     |   Applying dcim.0084_3569_powerfeed_fields... OK
netbox     |   Applying dcim.0085_3569_poweroutlet_fields... OK
netbox     |   Applying dcim.0086_device_name_nonunique... OK
netbox     |   Applying dcim.0087_role_descriptions... OK
netbox     |   Applying dcim.0088_powerfeed_available_power... OK
netbox     |   Applying dcim.0089_deterministic_ordering... OK
netbox     |   Applying dcim.0090_cable_termination_models... OK
netbox     |   Applying dcim.0091_interface_type_other... OK
netbox     |   Applying dcim.0092_fix_rack_outer_unit... OK
netbox     |   Applying dcim.0093_device_component_ordering... OK
netbox     |   Applying dcim.0094_device_component_template_ordering... OK
netbox     |   Applying dcim.0095_primary_model_ordering... OK
netbox     |   Applying dcim.0096_interface_ordering... OK
netbox     |   Applying dcim.0097_interfacetemplate_type_other... OK
netbox     |   Applying dcim.0098_devicetype_images... OK
netbox     |   Applying dcim.0099_powerfeed_negative_voltage... OK
netbox     |   Applying dcim.0100_mptt_remove_indexes... OK
netbox     |   Applying dcim.0101_nested_rackgroups... OK
netbox     |   Applying dcim.0102_nested_rackgroups_rebuild... OK
netbox     |   Applying dcim.0103_standardize_description... OK
netbox     |   Applying dcim.0104_correct_infiniband_types... OK
netbox     |   Applying dcim.0105_interface_name_collation... OK
netbox     |   Applying dcim.0106_role_default_color... OK
netbox     |   Applying dcim.0107_component_labels... OK
netbox     |   Applying dcim.0108_add_tags... OK
netbox     |   Applying dcim.0109_interface_remove_vm... OK
netbox     |   Applying dcim.0110_virtualchassis_name... OK
netbox     |   Applying dcim.0111_component_template_description... OK
netbox     |   Applying dcim.0112_standardize_components... OK
netbox     |   Applying dcim.0113_nullbooleanfield_to_booleanfield... OK
netbox     |   Applying dcim.0114_update_jsonfield... OK
netbox     |   Applying dcim.0115_rackreservation_order... OK
netbox     |   Applying dcim.0116_rearport_max_positions... OK
netbox     |   Applying dcim.0117_custom_field_data... OK
netbox     |   Applying dcim.0118_inventoryitem_mptt... OK
netbox     |   Applying dcim.0119_inventoryitem_mptt_rebuild... OK
netbox     |   Applying dcim.0120_cache_cable_peer...
netbox     |     Updating console port cable peers...
netbox     |     Updating console server port cable peers...
netbox     |     Updating power port cable peers...
netbox     |     Updating power outlet cable peers...
netbox     |     Updating interface cable peers...
redis_1    | 1:C 31 Jan 2021 14:18:41.140 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
netbox     |     Updating front port cable peers...
db_1       | The files belonging to this database system will be owned by user "postgres".
netbox     |     Updating rear port cable peers...
redis_1    | 1:C 31 Jan 2021 14:18:41.140 # Redis version=5.0.10, bits=64, commit=00000000, modified=0, pid=1, just started
db_1       | This user must also own the server process.
redis_1    | 1:C 31 Jan 2021 14:18:41.140 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
db_1       | 
netbox     |     Updating power feed cable peers...
redis_1    | 1:M 31 Jan 2021 14:18:41.151 * Running mode=standalone, port=6379.
netbox     |  OK
db_1       | The database cluster will be initialized with locale "en_US.utf8".
netbox     |   Applying dcim.0121_cablepath... OK
redis_1    | 1:M 31 Jan 2021 14:18:41.151 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis_1    | 1:M 31 Jan 2021 14:18:41.151 # Server initialized
netbox     |   Applying circuits.0016_3569_circuit_fields... OK
redis_1    | 1:M 31 Jan 2021 14:18:41.151 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
db_1       | The default database encoding has accordingly been set to "UTF8".
netbox     |   Applying circuits.0017_circuittype_description... OK
redis_1    | 1:M 31 Jan 2021 14:18:41.151 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
db_1       | The default text search configuration will be set to "english".
redis_1    | 1:M 31 Jan 2021 14:18:41.151 * Ready to accept connections
db_1       | 
netbox     |   Applying circuits.0018_standardize_description... OK
db_1       | Data page checksums are disabled.
netbox     |   Applying circuits.0019_nullbooleanfield_to_booleanfield... OK
db_1       | 
netbox     |   Applying circuits.0020_custom_field_data... OK
db_1       | fixing permissions on existing directory /var/lib/postgresql/data ... ok
netbox     |   Applying circuits.0021_cache_cable_peer...
db_1       | creating subdirectories ... ok
netbox     |     Updating circuit termination cable peers...
db_1       | selecting dynamic shared memory implementation ... posix
netbox     |  OK
db_1       | selecting default max_connections ... 100
netbox     |   Applying circuits.0022_cablepath... OK
db_1       | selecting default shared_buffers ... 128MB
db_1       | selecting default time zone ... America/Phoenix
db_1       | creating configuration files ... ok
db_1       | running bootstrap script ... ok
db_1       | performing post-bootstrap initialization ... ok
db_1       | syncing data to disk ... ok
db_1       | 
db_1       | 
db_1       | Success. You can now start the database server using:
db_1       | 
db_1       |     pg_ctl -D /var/lib/postgresql/data -l logfile start
db_1       | 
db_1       | initdb: warning: enabling "trust" authentication for local connections
db_1       | You can change this by editing pg_hba.conf or using the option -A, or
db_1       | --auth-local and --auth-host, the next time you run initdb.
db_1       | waiting for server to start....2021-01-31 14:18:51.357 MST [48] LOG:  starting PostgreSQL 13.1 (Debian 13.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
db_1       | 2021-01-31 14:18:51.364 MST [48] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1       | 2021-01-31 14:18:51.549 MST [49] LOG:  database system was shut down at 2021-01-31 14:18:49 MST
db_1       | 2021-01-31 14:18:51.573 MST [48] LOG:  database system is ready to accept connections
db_1       |  done
db_1       | server started
db_1       | CREATE DATABASE
db_1       | 
db_1       | 
db_1       | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
db_1       | 
db_1       | waiting for server to shut down....2021-01-31 14:18:54.189 MST [48] LOG:  received fast shutdown request
db_1       | 2021-01-31 14:18:54.276 MST [48] LOG:  aborting any active transactions
db_1       | 2021-01-31 14:18:54.278 MST [48] LOG:  background worker "logical replication launcher" (PID 55) exited with exit code 1
db_1       | 2021-01-31 14:18:54.278 MST [50] LOG:  shutting down
db_1       | 2021-01-31 14:18:54.667 MST [48] LOG:  database system is shut down
db_1       |  done
db_1       | server stopped
db_1       | 
db_1       | PostgreSQL init process complete; ready for start up.
netbox     |   Applying circuits.0023_circuittermination_port_speed_optional... OK
netbox     |   Applying circuits.0024_standardize_name_length... OK
netbox     |   Applying dcim.0122_standardize_name_length... OK
netbox     |   Applying virtualization.0017_update_jsonfield... OK
netbox     |   Applying virtualization.0018_custom_field_data... OK
netbox     |   Applying tenancy.0007_nested_tenantgroups... OK
netbox     |   Applying tenancy.0008_nested_tenantgroups_rebuild... OK
netbox     |   Applying tenancy.0009_standardize_description... OK
netbox     |   Applying tenancy.0010_custom_field_data... OK
netbox     |   Applying users.0001_api_tokens... OK
netbox     |   Applying users.0002_unicode_literals... OK
netbox     |   Applying users.0003_token_permissions... OK
netbox     |   Applying users.0004_standardize_description... OK
netbox     |   Applying users.0005_userconfig... OK
netbox     |   Applying users.0006_create_userconfigs... OK
netbox     |   Applying users.0007_proxy_group_user... OK
netbox     |   Applying users.0008_objectpermission... OK
netbox     |   Applying users.0009_replicate_permissions... OK
netbox     |   Applying secrets.0007_secretrole_description... OK
netbox     |   Applying secrets.0008_standardize_description... OK
netbox     |   Applying secrets.0009_secretrole_drop_users_groups... OK
netbox     |   Applying secrets.0010_custom_field_data... OK
netbox     |   Applying ipam.0038_custom_field_data... OK
netbox     |   Applying extras.0043_report... OK
netbox     |   Applying extras.0044_jobresult... OK
netbox     |   Applying extras.0045_configcontext_changelog... OK
netbox     |   Applying extras.0046_update_jsonfield... OK
netbox     |   Applying extras.0047_tag_ordering... OK
netbox     |   Applying extras.0048_exporttemplate_remove_template_language... OK
netbox     |   Applying extras.0049_remove_graph... OK
netbox     |   Applying extras.0050_customfield_changes... OK
netbox     |   Applying extras.0051_migrate_customfields... OK
netbox     |   Applying extras.0052_customfield_cleanup... OK
netbox     |   Applying extras.0053_rename_webhook_obj_type... OK
netbox     |   Applying tenancy.0011_standardize_name_length... OK
netbox     |   Applying ipam.0039_service_ports_array... OK
netbox     |   Applying ipam.0040_service_drop_port... OK
netbox     |   Applying ipam.0041_routetarget... OK
netbox     |   Applying ipam.0042_standardize_name_length... OK
netbox     |   Applying ipam.0043_add_tenancy_to_aggregates... OK
netbox     |   Applying secrets.0011_secret_generic_assignments... OK
netbox     |   Applying secrets.0012_standardize_name_length... OK
netbox     |   Applying sessions.0001_initial... OK
netbox     |   Applying taggit.0003_taggeditem_add_unique_index... OK
netbox     |   Applying users.0010_update_jsonfield... OK
netbox     |   Applying virtualization.0019_standardize_name_length... OK
netbox     | Superuser created.
netbox     | [cont-init.d] 50-config: exited 0.
netbox     | [cont-init.d] 99-custom-files: executing... 
netbox     | [custom-init] no custom files found exiting...
netbox     | [cont-init.d] 99-custom-files: exited 0.
netbox     | [cont-init.d] done.
netbox     | [services.d] starting services
netbox     | [services.d] done.
netbox     | [uWSGI] getting INI configuration from uwsgi.ini
netbox     | [uwsgi-static] added mapping for /static => static
netbox     | *** Starting uWSGI 2.0.18 (64bit) on [Sun Jan 31 14:21:38 2021] ***
netbox     | compiled with version: 9.3.0 on 17 April 2020 16:07:02
netbox     | os: Linux-4.15.0-128-generic #131-Ubuntu SMP Wed Dec 9 06:57:35 UTC 2020
netbox     | nodename: 9135ed131dd5
netbox     | machine: x86_64
netbox     | clock source: unix
netbox     | pcre jit disabled
netbox     | detected number of CPU cores: 4
netbox     | current working directory: /app/netbox/netbox
netbox     | detected binary path: /usr/sbin/uwsgi
netbox     | your memory page size is 4096 bytes
netbox     | detected max file descriptor number: 1048576
netbox     | building mime-types dictionary from file /etc/mime.types...1293 entry found
netbox     | lock engine: pthread robust mutexes
netbox     | thunder lock: disabled (you can enable it with --thunder-lock)
netbox     | uwsgi socket 0 bound to TCP address :8000 fd 3
netbox     | Python version: 3.8.5 (default, Jul 20 2020, 23:11:29)  [GCC 9.3.0]
netbox     | Python main interpreter initialized at 0x55ec66c94ae0
netbox     | python threads support enabled
netbox     | your server socket listen backlog is limited to 100 connections
netbox     | your mercy for graceful operations on workers is 60 seconds
netbox     | mapped 145840 bytes (142 KB) for 1 cores
netbox     | *** Operational MODE: single process ***
db_1       | 
db_1       | 2021-01-31 14:18:54.881 MST [1] LOG:  starting PostgreSQL 13.1 (Debian 13.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
db_1       | 2021-01-31 14:18:54.882 MST [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1       | 2021-01-31 14:18:54.882 MST [1] LOG:  listening on IPv6 address "::", port 5432
db_1       | 2021-01-31 14:18:54.984 MST [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1       | 2021-01-31 14:18:55.084 MST [76] LOG:  database system was shut down at 2021-01-31 14:18:54 MST
db_1       | 2021-01-31 14:18:55.105 MST [1] LOG:  database system is ready to accept connections
netbox     | running "exec:/usr/bin/python3 ./manage.py collectstatic --noinput" (pre app)...
netbox     | 
netbox     | 961 static files copied to '/app/netbox/netbox/static'.
netbox     | running "exec:/usr/bin/python3 ./manage.py remove_stale_contenttypes --no-input" (pre app)...
netbox     | running "exec:/usr/bin/python3 ./manage.py clearsessions" (pre app)...
netbox     | running "exec:/usr/bin/python3 ./manage.py invalidate all" (pre app)...
netbox     | WSGI app 0 (mountpoint='') ready in 2 seconds on interpreter 0x55ec66c94ae0 pid: 276 (default app)
netbox     | *** uWSGI is running in multiple interpreter mode ***
netbox     | spawned uWSGI master process (pid: 276)
netbox     | spawned uWSGI worker 1 (pid: 305, cores: 1)
netbox     | [uwsgi-daemons] spawning "/usr/bin/python3 ./manage.py rqworker" (uid: 1001 gid: 999)
netbox     | [pid: 305|app: 0|req: 1/1] 172.20.0.5 () {38 vars in 3000 bytes} [Sun Jan 31 21:22:00 2021] GET / => generated 143 bytes in 901 msecs (HTTP/1.1 400) 2 headers in 67 bytes (1 switches on core 0)
netbox     | [pid: 305|app: 0|req: 2/2] 172.20.0.5 () {36 vars in 2931 bytes} [Sun Jan 31 21:22:01 2021] GET /favicon.ico => generated 143 bytes in 32 msecs (HTTP/1.1 400) 2 headers in 67 bytes (1 switches on core 0)
redis_1    | 1:M 31 Jan 2021 15:18:42.083 * 1 changes in 3600 seconds. Saving...
redis_1    | 1:M 31 Jan 2021 15:18:42.083 * Background saving started by pid 12
redis_1    | 12:C 31 Jan 2021 15:18:42.093 * DB saved on disk
redis_1    | 12:C 31 Jan 2021 15:18:42.094 * RDB: 0 MB of memory used by copy-on-write
redis_1    | 1:M 31 Jan 2021 15:18:42.183 * Background saving terminated with success
redis_1    | 1:M 31 Jan 2021 16:18:43.068 * 1 changes in 3600 seconds. Saving...
redis_1    | 1:M 31 Jan 2021 16:18:43.068 * Background saving started by pid 13
redis_1    | 13:C 31 Jan 2021 16:18:43.070 * DB saved on disk
redis_1    | 13:C 31 Jan 2021 16:18:43.071 * RDB: 0 MB of memory used by copy-on-write
redis_1    | 1:M 31 Jan 2021 16:18:43.168 * Background saving terminated with success
netbox     | [pid: 305|app: 0|req: 3/3] 172.20.0.5 () {38 vars in 3007 bytes} [Sun Jan 31 23:21:02 2021] GET / => generated 143 bytes in 33 msecs (HTTP/1.1 400) 2 headers in 67 bytes (1 switches on core 0)
netbox     | [pid: 305|app: 0|req: 4/4] 172.20.0.5 () {36 vars in 2931 bytes} [Sun Jan 31 23:21:02 2021] GET /favicon.ico => generated 143 bytes in 32 msecs (HTTP/1.1 400) 2 headers in 67 bytes (1 switches on core 0)
netbox     | [pid: 305|app: 0|req: 5/5] 172.20.0.5 () {38 vars in 3007 bytes} [Sun Jan 31 23:21:07 2021] GET / => generated 143 bytes in 34 msecs (HTTP/1.1 400) 2 headers in 67 bytes (1 switches on core 0)
netbox     | [pid: 305|app: 0|req: 6/6] 172.20.0.5 () {36 vars in 2931 bytes} [Sun Jan 31 23:21:07 2021] GET /favicon.ico => generated 143 bytes in 32 msecs (HTTP/1.1 400) 2 headers in 67 bytes (1 switches on core 0)
github-actions[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

jhueppauff commented 3 years ago

@tonydm did you fixed this by any chance by yourself? I am facing the same issue.

tonydm commented 3 years ago

Sorry, I didn't. I posted here 21 days ago w/ no response. I spent way too much time on this one from linuxserver.io so I moved on. I could not find an issue with the deployment. I did get it working after I built it myself. After I got it running and played around with it, I didn't like working with it at all and wished I hadn't spent so much time trying to get it up and running. It's just my preference of course. I'm not knocking the project and the hard work that has been put into it by the folks at linuxserver.io. They do some great work!!! Same is true of the originators of Netbox. In the end, it just wasn't for me, so I deleted the directory I had all my test Dockerfile and docker-compose.yml files. I'm sorry, I simply can't recall the details or I would pass along something to point you in the right direction.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jhueppauff commented 3 years ago

How to bring activity to this issue? 😅🤷‍♂️

Any useful information I can share for someone to pick this up?

alex-phillips commented 3 years ago

It looks like I didn't create an environment variable for the app URL. You can resolve this by adding the URL you are accessing the app to the configuration.py file in /config in ALLOWED_HOSTS.

alex-phillips commented 3 years ago

Correction: it IS in the docs / container and you do have it. Please be sure this is this matches the URL you are attempting to hit the app with.

stsch83 commented 2 years ago

i have this issue too

thespad commented 2 years ago

As @alex-phillips said this is most typically caused by the ALLOWED_HOST (not ALLOWED_HOSTS) env being incorrect. It needs to match the hostname or IP address that you are using to connect to the web service. If you are using multiple you can remove the ALLOWED_HOST env and set it directly in the configuration.py in the /config mount, in the form ALLOWED_HOSTS = ['netbox.example.com', 'netbox.internal.local'] as documented therein.

stsch83 commented 2 years ago

As @alex-phillips said this is most typically caused by the ALLOWED_HOST (not ALLOWED_HOSTS) env being incorrect. It needs to match the hostname or IP address that you are using to connect to the web service. If you are using multiple you can remove the ALLOWED_HOST env and set it directly in the configuration.py in the /config mount, in the form ALLOWED_HOSTS = ['netbox.example.com', 'netbox.internal.local'] as documented therein.

that did not work for me. i add my ip address of my local imac 192.168.65.40 (- ALLOWED_HOST=192.168.65.40) but i still get bad request (400)

thespad commented 2 years ago

To remove any ambiguity you can do this:

If you are not yet sure what the domain name and/or IP address of the NetBox installation will be, and are comfortable accepting the risks in doing so, you can set this to a wildcard (asterisk) to allow all host values:

ALLOWED_HOSTS = ['*']
stsch83 commented 2 years ago

ALLOWED_HOSTS = ['*'] does not work. Also bad request. My log:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0., [s6-init] ensuring user provided files have correct perms...exited 0., [fix-attrs.d] applying ownership & permissions fixes..., [fix-attrs.d] done., [cont-init.d] executing container initialization scripts..., [cont-init.d] 01-envfile: executing... , [cont-init.d] 01-envfile: exited 0., [cont-init.d] 10-adduser: executing... , -------------------------------------, _ (), | | , | | / | | | / \ , | | _ \ | | | () |, || |__/ || \/, Brought to you by linuxserver.io, -------------------------------------, To support LSIO projects visit:, https://www.linuxserver.io/donate/, -------------------------------------, GID/UID, -------------------------------------, User uid: 1000, User gid: 1000, -------------------------------------, [cont-init.d] 10-adduser: exited 0., [cont-init.d] 50-config: executing... , Operations to perform:, Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, secrets, sessions, taggit, tenancy, users, virtualization, Running migrations:, No migrations to apply., Superuser creation skipped. Already exists., [cont-init.d] 50-config: exited 0., [cont-init.d] 90-custom-folders: executing... , [cont-init.d] 90-custom-folders: exited 0., [cont-init.d] 99-custom-files: executing... , [custom-init] no custom files found exiting..., [cont-init.d] 99-custom-files: exited 0., [cont-init.d] done., [services.d] starting services, [services.d] done., [uWSGI] getting INI configuration from uwsgi.ini, [uwsgi-static] added mapping for /static => static, Starting uWSGI 2.0.18 (64bit) on [Thu Jul 29 05:47:14 2021] , compiled with version: 9.3.0 on 17 April 2020 16:07:02, os: Linux-5.10.17-v8+ #1421 SMP PREEMPT Thu May 27 14:01:37 BST 2021, nodename: 4252d07bfcbf, machine: aarch64, clock source: unix, pcre jit disabled, detected number of CPU cores: 4, current working directory: /app/netbox/netbox, detected binary path: /usr/sbin/uwsgi, your memory page size is 4096 bytes, detected max file descriptor number: 1048576, building mime-types dictionary from file /etc/mime.types...1293 entry found, lock engine: pthread robust mutexes, thunder lock: disabled (you can enable it with --thunder-lock), uwsgi socket 0 bound to TCP address :8000 fd 3, Python version: 3.8.10 (default, May 6 2021, 06:30:44) [GCC 9.3.0], Python main interpreter initialized at 0x558875c1e0, python threads support enabled, your server socket listen backlog is limited to 100 connections, your mercy for graceful operations on workers is 60 seconds, mapped 145840 bytes (142 KB) for 1 cores, Operational MODE: single process , running "exec:/usr/bin/python3 ./manage.py collectstatic --noinput" (pre app)..., 957 static files copied to '/app/netbox/netbox/static'., running "exec:/usr/bin/python3 ./manage.py remove_stale_contenttypes --no-input" (pre app)..., running "exec:/usr/bin/python3 ./manage.py clearsessions" (pre app)..., running "exec:/usr/bin/python3 ./manage.py invalidate all" (pre app)..., WSGI app 0 (mountpoint='') ready in 5 seconds on interpreter 0x558875c1e0 pid: 306 (default app), uWSGI is running in multiple interpreter mode , spawned uWSGI master process (pid: 306), spawned uWSGI worker 1 (pid: 334, cores: 1), [uwsgi-daemons] spawning "/usr/bin/python3 ./manage.py rqworker" (uid: 1000 gid: 1000), [pid: 334|app: 0|req: 1/1] 10.0.0.2 () {34 vars in 1170 bytes} [Thu Jul 29 03:49:15 2021] GET / => generated 143 bytes in 1574 msecs (HTTP/1.1 400) 2 headers in 67 bytes (1 switches on core 0), [pid: 334|app: 0|req: 2/2] 10.0.0.2 () {34 vars in 1170 bytes} [Thu Jul 29 03:49:18 2021] GET / => generated 143 bytes in 74 msecs (HTTP/1.1 400) 2 headers in 67 bytes (1 switches on core 0)

Can you see anything what could make this error?

thespad commented 2 years ago

The only thing I can see that's different to my setup is that you're running on ARM.

stsch83 commented 2 years ago

The only thing I can see that's different to my setup is that you're running on ARM.

When i installed it outside of docker it will work. But i want to use it in docker!!!!

I find this on a website:

The error message “HTTP 400 Bad Request” does not make it immediately clear where the communication problem actually lies. If the targeted web server uses IIS 7.0, IIS 7.5 or IIS 8.0, more detailed information can be read from the status code:

 400.1: Invalid destination header
 400.2: Invalid depth header
 400.3: Invalid If header
 400.4: Invalid overwrite header
 400.5: Invalid Translate header
 400.6: Invalid request body
 400.7: Invalid content length
 400.8: Invalid timeout
 400.9: Invalid lock token 

Can i figure out which sub-error i get ?

thespad commented 2 years ago

Let me spin mine up on an ARM host and see if it behaves the same as on my x64 host.

I don't believe nginx does sub-status codes.

thespad commented 2 years ago

Just spun up on my arm64 host and it works fine. This is my exact compose, completely clean install - no other changes made. Ubuntu 20.04.2, Docker 20.10.7.

services:
  netbox:
    image: ghcr.io/linuxserver/netbox:latest
    container_name: netbox
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - SUPERUSER_EMAIL=${SUPERUSER_EMAIL}
      - SUPERUSER_PASSWORD=${SUPERUSER_PASSWORD}
      - ALLOWED_HOST=${ALLOWED_HOST}
      - DB_NAME=netbox
      - DB_USER=netbox
      - DB_PASSWORD=${DBPASS}
      - DB_HOST=netbox-db
      - DB_PORT=5432
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - REDIS_DB_TASK=8
      - REDIS_DB_CACHE=9
    volumes:
      - web:/config:rw
    ports:
      - 8000:8000
    networks:
      - public
      - private
    depends_on:
      - netbox-db
      - redis
    restart: unless-stopped

  netbox-db:
    image: postgres:12-alpine
    container_name: netbox-db
    environment:
      - POSTGRES_PASSWORD=${DBPASS}
      - POSTGRES_USER=netbox
    volumes:
      - db:/var/lib/postgresql/data
    restart: unless-stopped
    networks:
      - private

  redis:
    image: redis:alpine
    container_name: redis
    restart: unless-stopped
    volumes:
      - redis:/data
    networks:
      - private

networks:
  private:
    driver: bridge
    ipam:
      config:
        - subnet: 172.20.3.0/24
    internal: true
  public:
    external: true

volumes:
  web:
  db:
  redis:
stsch83 commented 2 years ago

can you fast try it with docker-swarm? because i have a swrm cluster

thespad commented 2 years ago

It's not something I have setup at the moment to be able to test.

stsch83 commented 2 years ago

It's not something I have setup at the moment to be able to test.

ok, thx. i will try in the afternoon at home.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

mikkel1156 commented 2 years ago

I had this problem today and using 0.0.0.0 helped.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.