Skip to content

Cannot add new DNS or CNAME record due to error dns.hosts[0]: found no first element (" ") #1888

@SpherionOS

Description

@SpherionOS

Cannot add new DNS or CNAME record due to error

This is a: Run Issue

Details

When adding DNS or CNAME on fresh PiHole install it gives an error and does not allow a new record to be saved. Errors are as follows

dns.hosts[0]: found no first element (" ")
dns.cnameRecords[0]: contains an empty string at position 0

Related Issues

  • [x ] I have searched this repository/Pi-hole forums for existing issues and pull requests that look similar

pi-hole/web#3238

How to reproduce the issue

  1. Environment data
  • Operating System: Ubuntu
  • Hardware: PC
  • Kernel Architecture: x86/amd64
  • Docker Install Info and version:
    • Software source: official docker-ce
    • Supplimentary Software: portainer
  • Hardware architecture: x86
  1. docker-compose.yml contents, docker run shell command, or paste a screenshot of any UI based configuration of containers here
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      # DNS Ports
      - "53:53/tcp"
      - "53:53/udp"
      # Default HTTP Port
      - "8080:80/tcp"
      # Default HTTPs Port. FTL will generate a self-signed certificate
      - "3443:443/tcp"
      # Uncomment the line below if you are using Pi-hole as your DHCP server
      #- "67:67/udp"
      # Uncomment the line below if you are using Pi-hole as your NTP server
      #- "123:123/udp"
    environment:
      # Set the appropriate timezone for your location (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), e.g:
      TZ: 'Australia/Brisbane'
      # Set a password to access the web interface. Not setting one will result in a random password being assigned
      FTLCONF_webserver_api_password: 'realpassword'
      # If using Docker's default `bridge` network setting the dns listening mode should be set to 'all'
      FTLCONF_dns_listeningMode: 'all'
    # Volumes store your data between container upgrades
    volumes:
      # For persisting Pi-hole's databases and common configuration file
      - './etc-pihole:/etc/pihole'
      # Uncomment the below if you have custom dnsmasq config files that you want to persist. Not needed for most starting fresh with Pi-hole v6. If you're upgrading from v5 you and have used this directory before, you should keep it enabled for the first v6 container start to allow for a complete migration. It can be removed afterwards. Needs environment variable FTLCONF_misc_etc_dnsmasq_d: 'true'
      #- './etc-dnsmasq.d:/etc/dnsmasq.d'
    cap_add:
      # See https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
      # Required if you are using Pi-hole as your DHCP server, else not needed
      - NET_ADMIN
      # Required if you are using Pi-hole as your NTP client to be able to set the host's system time
      - SYS_TIME
      # Optional, if Pi-hole should get some more processing time
      - SYS_NICE
    restart: unless-stopped
  1. any additional info to help reproduce

These common fixes didn't work for my issue

  • [x ] I have tried removing/destroying my container, and re-creating a new container
  • [x ] I have tried fresh volume data by backing up and moving/removing the old volume data
  • [x ] I have tried running without my volume data mounts to eliminate volumes as the cause

If the above debugging / fixes revealed any new information note it here.
Add any other debugging steps you've taken or theories on root cause that may help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions