"label empty or too long" error #125

Closed
opened 2021-11-20 13:24:19 +00:00 by ungleich-gitea · 10 comments

Created by: telmich

When running

[13:48] manager:~% cdist config -c ~/vcs/ungleich-dot-cdist/ -vvp10 -bj6 black{1..3}.place6.ungleich.ch server{1..4,6}.place6.ungleich.ch

I get

VERBOSE: [24289]: server6.place6.ungleich.ch: Running object __dcl_ceph/
INFO: [24289]: server6.place6.ungleich.ch: Finished successful run in 14.26 seconds
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/lib/python3.6/encodings/idna.py", line 165, in encode
raise UnicodeError("label empty or too long")
UnicodeError: label empty or too long

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/home/nico/vcs/cdist/cdist/config.py", line 356, in onehost
target_host = ipaddr.resolve_target_addresses(host, family)
File "/home/nico/vcs/cdist/cdist/util/ipaddr.py", line 27, in resolve_target_addresses
host_name = resolve_target_host_name(host, family)
File "/home/nico/vcs/cdist/cdist/util/ipaddr.py", line 41, in resolve_target_host_name
host, None, family=family, type=socket.SOCK_STREAM)[0][4][0]
File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/nico/vcs/cdist/bin/../scripts/cdist", line 79, in
commandline()
File "/home/nico/vcs/cdist/bin/../scripts/cdist", line 56, in commandline
args.func(args)
File "/home/nico/vcs/cdist/cdist/config.py", line 273, in commandline
jobs=args.parallel)
File "/home/nico/vcs/cdist/cdist/mputil.py", line 61, in mp_pool_run
retval.append(f.result())
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)
[13:48] manager:~% cdist -V
cdist 4.8.0-37-g54ca7b40
[13:48] manager:~%

*Created by: telmich* When running [13:48] manager:~% cdist config -c ~/vcs/ungleich-dot-cdist/ -vvp10 -bj6 black{1..3}.place6.ungleich.ch server{1..4,6}.place6.ungleich.ch I get VERBOSE: [24289]: server6.place6.ungleich.ch: Running object __dcl_ceph/ INFO: [24289]: server6.place6.ungleich.ch: Finished successful run in 14.26 seconds concurrent.futures.process._RemoteTraceback: """ Traceback (most recent call last): File "/usr/lib/python3.6/encodings/idna.py", line 165, in encode raise UnicodeError("label empty or too long") UnicodeError: label empty or too long The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker r = call_item.fn(*call_item.args, **call_item.kwargs) File "/home/nico/vcs/cdist/cdist/config.py", line 356, in onehost target_host = ipaddr.resolve_target_addresses(host, family) File "/home/nico/vcs/cdist/cdist/util/ipaddr.py", line 27, in resolve_target_addresses host_name = resolve_target_host_name(host, family) File "/home/nico/vcs/cdist/cdist/util/ipaddr.py", line 41, in resolve_target_host_name host, None, family=family, type=socket.SOCK_STREAM)[0][4][0] File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long) """ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/nico/vcs/cdist/bin/../scripts/cdist", line 79, in <module> commandline() File "/home/nico/vcs/cdist/bin/../scripts/cdist", line 56, in commandline args.func(args) File "/home/nico/vcs/cdist/cdist/config.py", line 273, in commandline jobs=args.parallel) File "/home/nico/vcs/cdist/cdist/mputil.py", line 61, in mp_pool_run retval.append(f.result()) File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result return self.__get_result() File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result raise self._exception UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long) [13:48] manager:~% cdist -V cdist 4.8.0-37-g54ca7b40 [13:48] manager:~%
Author
Owner

Created by: telmich

+5 points for you! You are absolutely right and the proposed solution is right as well! Please merge!

*Created by: telmich* +5 points for you! You are absolutely right and the proposed solution is right as well! Please merge!
Author
Owner

Created by: darko-poljak

@telmich But you were running:
[13:48] manager:~% cdist config -c ~/vcs/ungleich-dot-cdist/ -vvp10 -bj6 black{1..3}.place6.ungleich.ch server{1..4,6}.place6.ungleich.ch where you have server{1..4,6}.place6.ungleich.ch.

And echo server{1..4,6}.place6.ungleich.ch in bash gives:

server1..4.place6.ungleich.ch server6.place6.ungleich.ch

*Created by: darko-poljak* @telmich But you were running: `[13:48] manager:~% cdist config -c ~/vcs/ungleich-dot-cdist/ -vvp10 -bj6 black{1..3}.place6.ungleich.ch server{1..4,6}.place6.ungleich.ch` where you have `server{1..4,6}.place6.ungleich.ch`. And `echo server{1..4,6}.place6.ungleich.ch` in bash gives: `server1..4.place6.ungleich.ch server6.place6.ungleich.ch`
Author
Owner

Created by: telmich

@darko-poljak no - you are missing shell expansion here: server{1..4} is in curly brackets and is being expanded by shell

*Created by: telmich* @darko-poljak no - you are missing shell expansion here: server{1..4} is in curly brackets and is being expanded by shell
Author
Owner

Created by: darko-poljak

@telmich Is this wanted behavior?

ERROR: server1..4.place6.ungleich.ch: Error resolving target addresses for host 'server1..4.place6.ungleich.ch': encoding with 'idna' codec failed (UnicodeError: label empty or too long)
ERROR: cdist: Failed to configure the following hosts: server1..4.place6.ungleich.ch
*Created by: darko-poljak* @telmich Is this wanted behavior? ``` ERROR: server1..4.place6.ungleich.ch: Error resolving target addresses for host 'server1..4.place6.ungleich.ch': encoding with 'idna' codec failed (UnicodeError: label empty or too long) ERROR: cdist: Failed to configure the following hosts: server1..4.place6.ungleich.ch ```
Author
Owner

Created by: darko-poljak

@telmich

$ echo '' | ./bin/cdist config -i - -v server1..4.place6.ungleich.ch
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/encodings/idna.py", line 165, in encode
    raise UnicodeError("label empty or too long")
UnicodeError: label empty or too long

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./bin/../scripts/cdist", line 79, in <module>
    commandline()
  File "./bin/../scripts/cdist", line 56, in commandline
    args.func(args)
  File "/usr/home/darko/ungleich/upstream/cdist/cdist/config.py", line 255, in commandline
    configuration=configuration)
  File "/usr/home/darko/ungleich/upstream/cdist/cdist/config.py", line 356, in onehost
    target_host = ipaddr.resolve_target_addresses(host, family)
  File "/usr/home/darko/ungleich/upstream/cdist/cdist/util/ipaddr.py", line 27, in resolve_target_addresses
    host_name = resolve_target_host_name(host, family)
  File "/usr/home/darko/ungleich/upstream/cdist/cdist/util/ipaddr.py", line 41, in resolve_target_host_name
    host, None, family=family, type=socket.SOCK_STREAM)[0][4][0]
  File "/usr/local/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)
$ bash
[darko@icosahedron ~/ungleich/upstream/cdist]$ echo black{1..3}.place6.ungleich.ch server{1..4,6}.place6.ungleich.ch
black1.place6.ungleich.ch black2.place6.ungleich.ch black3.place6.ungleich.ch server1..4.place6.ungleich.ch server6.place6.ungleich.ch

Notice server1..4.place6.ungleich.ch. IDNA splits host parts by dot, and .. results in empty label.
It seems, in bash, you cannot mix .. and , inside {}.

So we should catch errors in cdist/util/ipaddr.py and output user friendly error.

*Created by: darko-poljak* @telmich ``` $ echo '' | ./bin/cdist config -i - -v server1..4.place6.ungleich.ch Traceback (most recent call last): File "/usr/local/lib/python3.6/encodings/idna.py", line 165, in encode raise UnicodeError("label empty or too long") UnicodeError: label empty or too long The above exception was the direct cause of the following exception: Traceback (most recent call last): File "./bin/../scripts/cdist", line 79, in <module> commandline() File "./bin/../scripts/cdist", line 56, in commandline args.func(args) File "/usr/home/darko/ungleich/upstream/cdist/cdist/config.py", line 255, in commandline configuration=configuration) File "/usr/home/darko/ungleich/upstream/cdist/cdist/config.py", line 356, in onehost target_host = ipaddr.resolve_target_addresses(host, family) File "/usr/home/darko/ungleich/upstream/cdist/cdist/util/ipaddr.py", line 27, in resolve_target_addresses host_name = resolve_target_host_name(host, family) File "/usr/home/darko/ungleich/upstream/cdist/cdist/util/ipaddr.py", line 41, in resolve_target_host_name host, None, family=family, type=socket.SOCK_STREAM)[0][4][0] File "/usr/local/lib/python3.6/socket.py", line 745, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long) $ bash [darko@icosahedron ~/ungleich/upstream/cdist]$ echo black{1..3}.place6.ungleich.ch server{1..4,6}.place6.ungleich.ch black1.place6.ungleich.ch black2.place6.ungleich.ch black3.place6.ungleich.ch server1..4.place6.ungleich.ch server6.place6.ungleich.ch ``` Notice `server1..4.place6.ungleich.ch`. IDNA splits host parts by dot, and `..` results in empty label. It seems, in bash, you cannot mix `..` and `,` inside `{}`. So we should catch errors in `cdist/util/ipaddr.py` and output user friendly error.
Author
Owner

Created by: darko-poljak

@telmich And with multiple hosts but not jobs nor parallel mode? (without -p and without -j).

*Created by: darko-poljak* @telmich And with multiple hosts but not jobs nor parallel mode? (without -p and without -j).
Author
Owner

Created by: telmich

Not reproducible with one host only.

*Created by: telmich* Not reproducible with one host only.
Author
Owner

Created by: darko-poljak

@telmich And can you post whole output when running with -S (disable saving output stream)?
Does this happend if you specify only one host?

*Created by: darko-poljak* @telmich And can you post whole output when running with -S (disable saving output stream)? Does this happend if you specify only one host?
Author
Owner

Created by: darko-poljak

@telmich And without -p ?

*Created by: darko-poljak* @telmich And without -p ?
Author
Owner

Created by: telmich

This also happens without -j:

[13:49] manager:~% cdist config -c ~/vcs/ungleich-dot-cdist/ -vvp10 black{1..3}.place6.ungleich.ch server{1..4,6}.place6.ungleich.ch

causes
VERBOSE: [27410]: server6.place6.ungleich.ch: Running object __ungleich_monit/ungleich
VERBOSE: [27410]: server6.place6.ungleich.ch: Running object __dcl_ceph/
INFO: [27410]: server6.place6.ungleich.ch: Finished successful run in 27.89 seconds
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/lib/python3.6/encodings/idna.py", line 165, in encode
raise UnicodeError("label empty or too long")
UnicodeError: label empty or too long

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/home/nico/vcs/cdist/cdist/config.py", line 356, in onehost
target_host = ipaddr.resolve_target_addresses(host, family)
File "/home/nico/vcs/cdist/cdist/util/ipaddr.py", line 27, in resolve_target_addresses
host_name = resolve_target_host_name(host, family)
File "/home/nico/vcs/cdist/cdist/util/ipaddr.py", line 41, in resolve_target_host_name
host, None, family=family, type=socket.SOCK_STREAM)[0][4][0]
File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/nico/vcs/cdist/bin/../scripts/cdist", line 79, in
commandline()
File "/home/nico/vcs/cdist/bin/../scripts/cdist", line 56, in commandline
args.func(args)
File "/home/nico/vcs/cdist/cdist/config.py", line 273, in commandline
jobs=args.parallel)
File "/home/nico/vcs/cdist/cdist/mputil.py", line 61, in mp_pool_run
retval.append(f.result())
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)

*Created by: telmich* This also happens without -j: [13:49] manager:~% cdist config -c ~/vcs/ungleich-dot-cdist/ -vvp10 black{1..3}.place6.ungleich.ch server{1..4,6}.place6.ungleich.ch causes VERBOSE: [27410]: server6.place6.ungleich.ch: Running object __ungleich_monit/ungleich VERBOSE: [27410]: server6.place6.ungleich.ch: Running object __dcl_ceph/ INFO: [27410]: server6.place6.ungleich.ch: Finished successful run in 27.89 seconds concurrent.futures.process._RemoteTraceback: """ Traceback (most recent call last): File "/usr/lib/python3.6/encodings/idna.py", line 165, in encode raise UnicodeError("label empty or too long") UnicodeError: label empty or too long The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker r = call_item.fn(*call_item.args, **call_item.kwargs) File "/home/nico/vcs/cdist/cdist/config.py", line 356, in onehost target_host = ipaddr.resolve_target_addresses(host, family) File "/home/nico/vcs/cdist/cdist/util/ipaddr.py", line 27, in resolve_target_addresses host_name = resolve_target_host_name(host, family) File "/home/nico/vcs/cdist/cdist/util/ipaddr.py", line 41, in resolve_target_host_name host, None, family=family, type=socket.SOCK_STREAM)[0][4][0] File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long) """ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/nico/vcs/cdist/bin/../scripts/cdist", line 79, in <module> commandline() File "/home/nico/vcs/cdist/bin/../scripts/cdist", line 56, in commandline args.func(args) File "/home/nico/vcs/cdist/cdist/config.py", line 273, in commandline jobs=args.parallel) File "/home/nico/vcs/cdist/cdist/mputil.py", line 61, in mp_pool_run retval.append(f.result()) File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result return self.__get_result() File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result raise self._exception UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#125
No description provided.