After changing hostname - UnicodeError: label empty or too long

  • Hey everyone :)
    I just finished installing OMV 5 on my Raspberry Pi 4 using this guide, and I began configuring it.
    I managed to change the administrator password and the auto logout timer without problems. The problems began when I wanted to change the hostname.
    I set the hostname to "nas" and applied changes. The hostname was indeed changed, but now the "Your configuration has been changed" prompt constantly shows up, and when I try to apply changes, I get:

    I used the latest Raspbian Buster Lite image from 2020-02-05. Rebooting the Pi does not affect the issue. Did I do something wrong? :(


    EDIT: I tried to revert the changes using the "Revert" button, the message disappeared, but I'm also getting the same error when trying to mount a file system.


    EDIT 2: I managed to recover from the issue by:
    - clicking the "Revert" button to revert changes
    - checking what's the default hostname set in "System > Network"
    - changing the hostname back to default, which in my case was "sudo hostname raspberrypi"


    The issue comes back every time I try to change the hostname either via the OMV panel, or with the "hostname" command.

    Server: Codename Oven (ASRock J5040-ITX with 4-core Pentium Silver J5040, 2x 8TB Seagate IronWolf HDD, inside Coolermaster Elite 110 case, powered by OMV 6)

    2 Mal editiert, zuletzt von kamild1996 ()

    • Offizieller Beitrag

    The problem seems to be the Python socket library. Searching Google let you find a number of bug reports related to the same issue. The problematic function seems to be called by SaltStack, but i do not see that the hostname of your system is longer than 64 chars nor it is empty.


    Code
    domain:
        fqdn:
            raspberrypi
        fqdn_ip4:
            - 127.0.1.1
        fqdn_ip6:
            - ::1
        fqdns:

    The locale doesn't look exotic which might cause decoding issues.



    Code
    locale_info:
            ----------
            defaultencoding:
                UTF-8
            defaultlanguage:
                en_US
            detectedencoding:
                UTF-8
            timezone:
                GMT
    • Offizieller Beitrag

    Probably won't make a difference but I would be curious to see if setting a domain name (like local) fixes it.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    I would add hostname --all-fqdns to the list.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I am the one from „the other thread“
    Setting a domain did not help.
    i tried to reconfigure a lot - all with the same error message
    Something must have happened before, to stop the config save mechanisms to work.


    Did a fresh install in my system today and only configured standard things and some shares - nothing fancy.
    So far, so good


    Tomorrow I will continue adding things like usbbackup, clamAV, rsync to my second NAS, etc

    Asrock J3160-ITX, 4GB RAM, 120GB SSD, 2x3TB Seagate Ironwolf as RAID1, Thermaltake Core1 Cube

    • Offizieller Beitrag

    I played a little bit with the SaltStack code and your system information.

    Python
    root@omv5box:/home/vagrant# python3
    Python 3.7.3 (default, Apr  3 2019, 05:39:12) 
    [GCC 8.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> grains = {}
    >>> grains['fqdn'] = "raspberrypi"
    >>> (grains['host'], grains['domain']) = grains['fqdn'].partition('.')[::2]
    >>> grains
    {'fqdn': 'raspberrypi', 'host': 'raspberrypi', 'domain': ''}

    I can not see any problems here which might result in the idna error.

  • What is the output of


    Code
    # hostname
    # hostname --fqdn
    # hostnamectl

    First two return "raspberrypi", but hostnamectl returns something interesting:


    Code
    Static hostname: magazyn
    Transient hostname: raspberrypi
             Icon name: computer
            Machine ID: 81a6c17ba0354666a09e33b6b8c45285
               Boot ID: 6b9811258d7b47b39314a28fd7dbf45d
      Operating System: Raspbian GNU/Linux 10 (buster)
                Kernel: Linux 4.19.97-v7l+
          Architecture: arm

    "magazyn" is what I tried to set my hostname to earlier instead of "nas", which I was afraid would be too short.
    The "transient hostname" seems to be the one actually being used (since I can ping my device with it from another computer, and I can use it to access the web panel).

    Server: Codename Oven (ASRock J5040-ITX with 4-core Pentium Silver J5040, 2x 8TB Seagate IronWolf HDD, inside Coolermaster Elite 110 case, powered by OMV 6)

  • I would add hostname --all-fqdns to the list.

    And that's perhaps even more interesting, because it returns:


    Code
    root@raspberrypi:/home/pi# hostname --all-fqdns
    . .

    Bingo?

    Server: Codename Oven (ASRock J5040-ITX with 4-core Pentium Silver J5040, 2x 8TB Seagate IronWolf HDD, inside Coolermaster Elite 110 case, powered by OMV 6)

    • Offizieller Beitrag

    What is the output of the following interactive python code:


    Python
    root@omv5box:/home/vagrant# python3
    Python 3.7.3 (default, Apr  3 2019, 05:39:12) 
    [GCC 8.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more in
    >>> import salt.utils.network
    >>> salt.utils.network.get_fqhostname()
    'omv5box'

    This is the origin of the problem.
    1. https://github.com/saltstack/s…salt/grains/core.py#L2177
    2. https://github.com/saltstack/s…salt/grains/core.py#L2251
    3. https://github.com/saltstack/s…salt/grains/core.py#L2259
    4. Boom

  • @votdev

    Python
    Python 3.7.3 (default, Apr  3 2019, 05:39:12)
    [GCC 8.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import salt.utils.network
    >>> salt.utils.network.get_fqhostname()
    'raspberrypi'

    Server: Codename Oven (ASRock J5040-ITX with 4-core Pentium Silver J5040, 2x 8TB Seagate IronWolf HDD, inside Coolermaster Elite 110 case, powered by OMV 6)

  • I just realized all my command output might have been useless because these commands weren't run in a state when OMV shows this error. So I recreated the error by changing the hostname to "testtesttest" in OMV and rerun all those commands again.
    Now your python code returns:

    Code
    >>> salt.utils.network.get_fqhostname()
    '.'


    Also, hostnamectl no longer returns a "transient hostname":


    Code
    root@raspberrypi:/home/pi# hostnamectl
       Static hostname: testtesttest
             Icon name: computer
            Machine ID: 81a6c17ba0354666a09e33b6b8c45285
               Boot ID: 6b9811258d7b47b39314a28fd7dbf45d
      Operating System: Raspbian GNU/Linux 10 (buster)
                Kernel: Linux 4.19.97-v7l+
          Architecture: arm

    Server: Codename Oven (ASRock J5040-ITX with 4-core Pentium Silver J5040, 2x 8TB Seagate IronWolf HDD, inside Coolermaster Elite 110 case, powered by OMV 6)

    • Offizieller Beitrag

    hostname --all-fqdns will return the fqdn for each network adapter including loopback (which can be different). This is why I was curious if setting a domain would help.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    I just realized all my command output might have been useless because these commands weren't run in a state when OMV shows this error. So I recreated the error by changing the hostname to "testtesttest" in OMV and rerun all those commands again.
    Now your python code returns:

    Code
    >>> salt.utils.network.get_fqhostname()
    '.'

    Also, hostnamectl no longer returns a "transient hostname":


    Code
    root@raspberrypi:/home/pi# hostnamectl
       Static hostname: testtesttest
             Icon name: computer
            Machine ID: 81a6c17ba0354666a09e33b6b8c45285
               Boot ID: 6b9811258d7b47b39314a28fd7dbf45d
      Operating System: Raspbian GNU/Linux 10 (buster)
                Kernel: Linux 4.19.97-v7l+
          Architecture: arm

    That's the output that will cause the exception. Hmmm, and why the hell is the hostname . in this state?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!