After changing hostname - UnicodeError: label empty or too long

    • OMV 5.x (beta)

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • After changing hostname: Failed to execute command 'export [...]

      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:

      Source Code

      1. Error #0:
      2. OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; omv-salt deploy run avahi 2>&1' with exit code '1': Traceback (most recent call last):
      3. File "/usr/lib/python3.7/encodings/idna.py", line 165, in encode
      4. raise UnicodeError("label empty or too long")
      5. UnicodeError: label empty or too long
      6. The above exception was the direct cause of the following exception:
      7. Traceback (most recent call last):
      8. File "/usr/sbin/omv-salt", line 136, in <module>
      9. sys.exit(main())
      10. File "/usr/sbin/omv-salt", line 132, in main
      11. cli()
      12. File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
      13. return self.main(*args, **kwargs)
      14. File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
      15. rv = self.invoke(ctx)
      16. File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
      17. return _process_result(sub_ctx.command.invoke(sub_ctx))
      18. File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
      19. return _process_result(sub_ctx.command.invoke(sub_ctx))
      20. File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
      21. return ctx.invoke(self.callback, **ctx.params)
      22. File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
      23. return callback(*args, **kwargs)
      24. File "/usr/sbin/omv-salt", line 120, in deploy_run
      25. caller = salt.client.Caller(mopts=mopts)
      26. File "/usr/lib/python3/dist-packages/salt/client/__init__.py", line 1995, in __init__
      27. self.sminion = salt.minion.SMinion(self.opts)
      28. File "/usr/lib/python3/dist-packages/salt/minion.py", line 842, in __init__
      29. opts['grains'] = salt.loader.grains(opts)
      30. File "/usr/lib/python3/dist-packages/salt/loader.py", line 784, in grains
      31. ret = funcs[key]()
      32. File "/usr/lib/python3/dist-packages/salt/grains/core.py", line 2259, in ip_fqdn
      33. info = socket.getaddrinfo(_fqdn, None, socket_type)
      34. File "/usr/lib/python3.7/socket.py", line 748, in getaddrinfo
      35. for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
      36. UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long) in /usr/share/php/openmediavault/system/process.inc:182
      37. Stack trace:
      38. #0 /usr/share/php/openmediavault/engine/module/serviceabstract.inc(60): OMV\System\Process->execute()
      39. #1 /usr/share/openmediavault/engined/rpc/config.inc(167): OMV\Engine\Module\ServiceAbstract->deploy()
      40. #2 [internal function]: Engined\Rpc\Config->applyChanges(Array, Array)
      41. #3 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
      42. #4 /usr/share/php/openmediavault/rpc/serviceabstract.inc(149): OMV\Rpc\ServiceAbstract->callMethod('applyChanges', Array, Array)
      43. #5 /usr/share/php/openmediavault/rpc/serviceabstract.inc(588): OMV\Rpc\ServiceAbstract->OMV\Rpc\{closure}('/tmp/bgstatusa4...', '/tmp/bgoutputRh...')
      44. #6 /usr/share/php/openmediavault/rpc/serviceabstract.inc(159): OMV\Rpc\ServiceAbstract->execBgProc(Object(Closure))
      45. #7 /usr/share/openmediavault/engined/rpc/config.inc(189): OMV\Rpc\ServiceAbstract->callMethodBg('applyChanges', Array, Array)
      46. #8 [internal function]: Engined\Rpc\Config->applyChangesBg(Array, Array)
      47. #9 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
      48. #10 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('applyChangesBg', Array, Array)
      49. #11 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('Config', 'applyChangesBg', Array, Array, 1)
      50. #12 {main}
      Display All
      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.

      The post was edited 2 times, last by kamild1996 ().

    • This is the second time I saw this. It seems the Debian Python package has a serious bug in the latest version.
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • Can you please post the output of salt-call grains.items?
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • 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.

      Source Code

      1. domain:
      2. fqdn:
      3. raspberrypi
      4. fqdn_ip4:
      5. - 127.0.1.1
      6. fqdn_ip6:
      7. - ::1
      8. fqdns:
      The locale doesn't look exotic which might cause decoding issues.


      Brainfuck Source Code

      1. locale_info:
      2. ----------
      3. defaultencoding:
      4. UTF-8
      5. defaultlanguage:
      6. en_US
      7. detectedencoding:
      8. UTF-8
      9. timezone:
      10. GMT
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • Probably won't make a difference but I would be curious to see if setting a domain name (like local) fixes it.
      omv 5.3.4 usul | 64 bit | 5.3 proxmox kernel | omvextrasorg 5.2.5
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • What is the output of

      Source Code

      1. # hostname
      2. # hostname --fqdn
      3. # hostnamectl
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • Maybe an interesting bug: bugs.python.org/issue32958#msg313323. This comment points to the code which raises the exception.

      Problem here is that the hostname of your system seems to be valid.
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • 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
    • I played a little bit with the SaltStack code and your system information.

      Python Source Code

      1. root@omv5box:/home/vagrant# python3
      2. Python 3.7.3 (default, Apr 3 2019, 05:39:12)
      3. [GCC 8.3.0] on linux
      4. Type "help", "copyright", "credits" or "license" for more information.
      5. >>> grains = {}
      6. >>> grains['fqdn'] = "raspberrypi"
      7. >>> (grains['host'], grains['domain']) = grains['fqdn'].partition('.')[::2]
      8. >>> grains
      9. {'fqdn': 'raspberrypi', 'host': 'raspberrypi', 'domain': ''}
      I can not see any problems here which might result in the idna error.
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • votdev wrote:

      What is the output of

      Source Code

      1. # hostname
      2. # hostname --fqdn
      3. # hostnamectl
      First two return "raspberrypi", but hostnamectl returns something interesting:

      Source Code

      1. Static hostname: magazyn
      2. Transient hostname: raspberrypi
      3. Icon name: computer
      4. Machine ID: 81a6c17ba0354666a09e33b6b8c45285
      5. Boot ID: 6b9811258d7b47b39314a28fd7dbf45d
      6. Operating System: Raspbian GNU/Linux 10 (buster)
      7. Kernel: Linux 4.19.97-v7l+
      8. 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).
    • What is the output of the following interactive python code:

      Python Source Code

      1. root@omv5box:/home/vagrant# python3
      2. Python 3.7.3 (default, Apr 3 2019, 05:39:12)
      3. [GCC 8.3.0] on linux
      4. Type "help", "copyright", "credits" or "license" for more in
      5. >>> import salt.utils.network
      6. >>> salt.utils.network.get_fqhostname()
      7. 'omv5box'
      This is the origin of the problem.
      1. github.com/saltstack/salt/blob…salt/grains/core.py#L2177
      2. github.com/saltstack/salt/blob…salt/grains/core.py#L2251
      3. github.com/saltstack/salt/blob…salt/grains/core.py#L2259
      4. Boom
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • 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:

      Source Code

      1. >>> salt.utils.network.get_fqhostname()
      2. '.'

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

      Source Code

      1. root@raspberrypi:/home/pi# hostnamectl
      2. Static hostname: testtesttest
      3. Icon name: computer
      4. Machine ID: 81a6c17ba0354666a09e33b6b8c45285
      5. Boot ID: 6b9811258d7b47b39314a28fd7dbf45d
      6. Operating System: Raspbian GNU/Linux 10 (buster)
      7. Kernel: Linux 4.19.97-v7l+
      8. Architecture: arm
    • 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 5.3.4 usul | 64 bit | 5.3 proxmox kernel | omvextrasorg 5.2.5
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • kamild1996 wrote:

      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:

      Source Code

      1. >>> salt.utils.network.get_fqhostname()
      2. '.'
      Also, hostnamectl no longer returns a "transient hostname":

      Source Code

      1. root@raspberrypi:/home/pi# hostnamectl
      2. Static hostname: testtesttest
      3. Icon name: computer
      4. Machine ID: 81a6c17ba0354666a09e33b6b8c45285
      5. Boot ID: 6b9811258d7b47b39314a28fd7dbf45d
      6. Operating System: Raspbian GNU/Linux 10 (buster)
      7. Kernel: Linux 4.19.97-v7l+
      8. Architecture: arm
      That's the output that will cause the exception. Hmmm, and why the hell is the hostname . in this state?
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • How did you set the hostname to testtesttest?
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit