(Fixed) Build From Source Error: special device /dev/mapper/to does not exist

I have replicated this error on both a Debian 11 Qube and a Debian 11 bare-metal install. I’m unable to find this specific error being discussed here on the forums. Any idea how to resolve the issue?

Note: Read edit section(s) below…

Initial Command

~/derivative-maker/derivative-maker --flavor whonix-gateway-xfce --target qcow2 --arch amd64 --repo true --build

Error Output

mount: /home/user/derivative-binary/Whonix-Gateway-XFCE_image: special device /dev/mapper/to does not exist.
++ error_handler_mount-raw
+++ caller
++ : echo '
   BASH_COMMAND: $SUDO_TO_ROOT mount "$dev_mapper_device" "$CHROOT_FOLDER"
   ERROR /home/user/derivative-maker/help-steps/mount-raw: | caller: 91 /home/user/derivative-maker/help-steps/mount-raw
   '

Error Output Extended

INFO: Variable dist_build_version was already set to: 16.0.9.8
sudo: unable to resolve host host: No address associated with hostname
INFO: Environment variables that will be passed...
INFO: SUDO_TO_ROOT:
sudo --non-interactive --preserve-env=tbb_version,tb_onion,tpo_downloader_debug,tb_disable_anon_ws_dnf_conf,anon_shared_inst_tb,SKIP_SCRIPTS,SOURCE_DATE_EPOCH,dist_aptgetopt_file,dist_build_sources_list_primary,dist_mmdebstrap_build_sources_list_primary,dist_build_sources_list_primary_contents,dist_build_apt_sources_mirror,dist_build_apt_stable_release,dist_build_target_arch,dist_grml_mount_point,dist_source_help_steps_folder,dist_build_multiarch_package_item,dist_build_unsafe_io,dist_build_version,user_name,LD_PRELOAD,LANG,LC_ALL,TZ,DEBDEBUG,XZ_OPT,REPO_PROXY,APTGETOPT,apt_unattended_opts,DERIVATIVE_APT_REPOSITORY_OPTS,DEBOOTSTRAP,http_proxy
/home/user/derivative-maker/help-steps/variables INFO: set -x
++ true '/home/user/derivative-maker/help-steps/variables INFO: End of script, ok.'
+ '[' false = false ']'
+ main
+ '[' '' = true ']'
+ '[' '' = true ']'
+ mount_raw
+ '[' false = false ']'
+ trap error_handler_mount-raw ERR INT TERM
+ '[' '' = '' ']'
+ true
+ sync
+ '[' '' = '' ']'
+ local img=/home/user/derivative-binary/16.0.9.8/Whonix-Gateway-XFCE-16.0.9.8.Intel_AMD64.raw
+ sudo --non-interactive --preserve-env=tbb_version,tb_onion,tpo_downloader_debug,tb_disable_anon_ws_dnf_conf,anon_shared_inst_tb,SKIP_SCRIPTS,SOURCE_DATE_EPOCH,dist_aptgetopt_file,dist_build_sources_list_primary,dist_mmdebstrap_build_sources_list_primary,dist_build_sources_list_primary_contents,dist_build_apt_sources_mirror,dist_build_apt_stable_release,dist_build_target_arch,dist_grml_mount_point,dist_source_help_steps_folder,dist_build_multiarch_package_item,dist_build_unsafe_io,dist_build_version,user_name,LD_PRELOAD,LANG,LC_ALL,TZ,DEBDEBUG,XZ_OPT,REPO_PROXY,APTGETOPT,apt_unattended_opts,DERIVATIVE_APT_REPOSITORY_OPTS,DEBOOTSTRAP,http_proxy losetup --all
sudo: unable to resolve host host: No address associated with hostname
+ sync
+ wait 224341
+ sleep 2
+ local kpartx_output a b device
++ sudo --non-interactive --preserve-env=tbb_version,tb_onion,tpo_downloader_debug,tb_disable_anon_ws_dnf_conf,anon_shared_inst_tb,SKIP_SCRIPTS,SOURCE_DATE_EPOCH,dist_aptgetopt_file,dist_build_sources_list_primary,dist_mmdebstrap_build_sources_list_primary,dist_build_sources_list_primary_contents,dist_build_apt_sources_mirror,dist_build_apt_stable_release,dist_build_target_arch,dist_grml_mount_point,dist_source_help_steps_folder,dist_build_multiarch_package_item,dist_build_unsafe_io,dist_build_version,user_name,LD_PRELOAD,LANG,LC_ALL,TZ,DEBDEBUG,XZ_OPT,REPO_PROXY,APTGETOPT,apt_unattended_opts,DERIVATIVE_APT_REPOSITORY_OPTS,DEBOOTSTRAP,http_proxy kpartx -a -s -v /home/user/derivative-binary/16.0.9.8/Whonix-Gateway-XFCE-16.0.9.8.Intel_AMD64.raw
+ kpartx_output='sudo: unable to resolve host host: No address associated with hostname
add map loop0p1 (254:0): 0 209709056 linear 7:0 4096'
+ sync
+ '[' 'sudo: unable to resolve host host: No address associated with hostname
add map loop0p1 (254:0): 0 209709056 linear 7:0 4096' = '' ']'
+ sudo --non-interactive --preserve-env=tbb_version,tb_onion,tpo_downloader_debug,tb_disable_anon_ws_dnf_conf,anon_shared_inst_tb,SKIP_SCRIPTS,SOURCE_DATE_EPOCH,dist_aptgetopt_file,dist_build_sources_list_primary,dist_mmdebstrap_build_sources_list_primary,dist_build_sources_list_primary_contents,dist_build_apt_sources_mirror,dist_build_apt_stable_release,dist_build_target_arch,dist_grml_mount_point,dist_source_help_steps_folder,dist_build_multiarch_package_item,dist_build_unsafe_io,dist_build_version,user_name,LD_PRELOAD,LANG,LC_ALL,TZ,DEBDEBUG,XZ_OPT,REPO_PROXY,APTGETOPT,apt_unattended_opts,DERIVATIVE_APT_REPOSITORY_OPTS,DEBOOTSTRAP,http_proxy losetup --all
sudo: unable to resolve host host: No address associated with hostname
/dev/loop0: [2050]:13380528 (/home/user/derivative-binary/16.0.9.8/Whonix-Gateway-XFCE-16.0.9.8.Intel_AMD64.raw)
+ sync
+ read a b device _
+ dev_mapper_device=/dev/mapper/to
+ '[' '' = true ']'
+ mkdir --parents /home/user/derivative-binary/Whonix-Gateway-XFCE_image
+ sync
+ sudo --non-interactive --preserve-env=tbb_version,tb_onion,tpo_downloader_debug,tb_disable_anon_ws_dnf_conf,anon_shared_inst_tb,SKIP_SCRIPTS,SOURCE_DATE_EPOCH,dist_aptgetopt_file,dist_build_sources_list_primary,dist_mmdebstrap_build_sources_list_primary,dist_build_sources_list_primary_contents,dist_build_apt_sources_mirror,dist_build_apt_stable_release,dist_build_target_arch,dist_grml_mount_point,dist_source_help_steps_folder,dist_build_multiarch_package_item,dist_build_unsafe_io,dist_build_version,user_name,LD_PRELOAD,LANG,LC_ALL,TZ,DEBDEBUG,XZ_OPT,REPO_PROXY,APTGETOPT,apt_unattended_opts,DERIVATIVE_APT_REPOSITORY_OPTS,DEBOOTSTRAP,http_proxy mount /dev/mapper/to /home/user/derivative-binary/Whonix-Gateway-XFCE_image
sudo: unable to resolve host host: No address associated with hostname
mount: /home/user/derivative-binary/Whonix-Gateway-XFCE_image: special device /dev/mapper/to does not exist.
++ error_handler_mount-raw
+++ caller
++ : echo '
   BASH_COMMAND: $SUDO_TO_ROOT mount "$dev_mapper_device" "$CHROOT_FOLDER"
   ERROR /home/user/derivative-maker/help-steps/mount-raw: | caller: 91 /home/user/derivative-maker/help-steps/mount-raw
   '
++ exit 1
+ exithandler
+ local exit_code=1
+ '[' '!' 1 = 0 ']'
+ exit 1
++ exception_handler_unchroot_unmount ERR
++ last_failed_exit_code=1
++ last_failed_bash_command='"$dist_source_help_steps_folder"/mount-raw'
++ output_cmd_set
++ '[' -o xtrace ']'
++ output_cmd=true
++ exception_handler_process_shared ERR
++ last_script=././build-steps.d/2300_run-chroot-scripts-post-d
++ trap_signal_type_previous=
++ '[' '' = '' ']'
++ trap_signal_type_previous=unset
++ trap_signal_type_last=ERR
++ dist_build_error_counter=1
+++ benchmarktimeend 1681460587
++++ date +%s
+++ benchmarktimeend=1681460590
+++ benchmark_took_seconds=3
++++ convertsecs 3
++++ local h m s
++++ (( h=3/3600 ))
++++ true
++++ (( m=(3%3600)/60 ))
++++ true
++++ (( s=3%60 ))
++++ printf '%02d:%02d:%02d\n' 0 0 3
+++ echo 00:00:03
++ benchmark_took_time=00:00:03
++ local first
++ read -r first _
++ process_backtrace_function
++ true 'INFO: BEGIN: process_backtrace_function'
++ '[' -o xtrace ']'
++ set +x
++ true 'INFO: END  : process_backtrace_function'
++ function_trace_function
++ true 'INFO: BEGIN: function_trace_function'
++ '[' -o xtrace ']'
++ set +x
++ true 'INFO: END  : function_trace_function'
++ output_cmd_set
++ '[' -o xtrace ']'
++ output_cmd=true
++ true '
############################################################
ERROR: in ././build-steps.d/2300_run-chroot-scripts-post-d detected!

dist_build_version: 16.0.9.8
dist_build_error_counter: 1
benchmark: 00:00:03
last_failed_exit_code: 1
trap_signal_type_previous: unset
trap_signal_type_last    : ERR

process_backtrace_result:
1: : init
2: : xfce4-terminal 
3: : bash 
4: : /bin/bash /home/user/derivative-maker/derivative-maker --flavor whonix-gateway-xfce --target qcow2 --arch amd64 --repo true --build 
5: : /bin/bash ././build-steps.d/2300_run-chroot-scripts-post-d 

function_trace_result:
main (line number: 88)
main (line number: 74)
run-chroot-scripts-post-d (line number: 26)
exception_handler_unchroot_unmount (line number: 392)
exception_handler_process_shared (line number: 211)


last_failed_bash_command: "$dist_source_help_steps_folder"/mount-raw
############################################################
'
++ unset error_reason
++ '[' ERR = INT ']'
++ '[' ERR = TERM ']'
++ '[' ERR = ERR ']'
++ '[' '!' 0 = 0 ']'
++ true 'INFO: dist_build_auto_retry set to 0 (--retry-max). No auto retry.'
++ unset dist_build_auto_retry_counter
++ true
++ ignore_error=false
++ answer=
++ '[' ERR = ERR ']'
++ '[' '' = true ']'
++ '[' -t 0 ']'
++ true 'INFO: stdin connected to terminal, using interactive error handler.'
++ true 'ERROR: in ././build-steps.d/2300_run-chroot-scripts-post-d detected!

Please have a look above (the block within ###...).

 - Please enter c and press enter to ignore the error and continue building. (Recommended against!)
 - Please press r and enter to retry.
 - Please press s and enter to open an chroot interactive shell.
 - Please press a and enter to abort.'
++ read -p 'Answer? ' answer
Answer? 

EDIT 1
It appears $kpartx_output is storing the hostname error sudo: unable to resolve host host: No address associated with hostname which is then read and storing the word to in variable $device. Thus $dev_mapper_device contains /dev/mapper/to

I created a manual step in mount-raw to look at variables. Here’s the terminal output from that:

+ local kpartx_output a b device
++ sudo --non-interactive --preserve-env=tbb_version,tb_onion,tpo_downloader_debug,tb_disable_anon_ws_dnf_conf,anon_shared_inst_tb,SKIP_SCRIPTS,SOURCE_DATE_EPOCH,dist_aptgetopt_file,dist_build_sources_list_primary,dist_mmdebstrap_build_sources_list_primary,dist_build_sources_list_primary_contents,dist_build_apt_sources_mirror,dist_build_apt_stable_release,dist_build_target_arch,dist_grml_mount_point,dist_source_help_steps_folder,dist_build_multiarch_package_item,dist_build_unsafe_io,dist_build_version,user_name,LD_PRELOAD,LANG,LC_ALL,TZ,DEBDEBUG,XZ_OPT,REPO_PROXY,APTGETOPT,apt_unattended_opts,DERIVATIVE_APT_REPOSITORY_OPTS,DEBOOTSTRAP,http_proxy kpartx -a -s -v /home/user/derivative-binary/16.0.9.8/Whonix-Gateway-XFCE-16.0.9.8.Intel_AMD64.raw
+ kpartx_output='sudo: unable to resolve host host: No address associated with hostname
add map loop0p1 (254:0): 0 209709056 linear 7:0 4096'
+ echo 'kpartx_output = sudo: unable to resolve host host: No address associated with hostname
add map loop0p1 (254:0): 0 209709056 linear 7:0 4096'
kpartx_output = sudo: unable to resolve host host: No address associated with hostname
add map loop0p1 (254:0): 0 209709056 linear 7:0 4096
+ sync
+ '[' 'sudo: unable to resolve host host: No address associated with hostname
add map loop0p1 (254:0): 0 209709056 linear 7:0 4096' = '' ']'
+ sudo --non-interactive --preserve-env=tbb_version,tb_onion,tpo_downloader_debug,tb_disable_anon_ws_dnf_conf,anon_shared_inst_tb,SKIP_SCRIPTS,SOURCE_DATE_EPOCH,dist_aptgetopt_file,dist_build_sources_list_primary,dist_mmdebstrap_build_sources_list_primary,dist_build_sources_list_primary_contents,dist_build_apt_sources_mirror,dist_build_apt_stable_release,dist_build_target_arch,dist_grml_mount_point,dist_source_help_steps_folder,dist_build_multiarch_package_item,dist_build_unsafe_io,dist_build_version,user_name,LD_PRELOAD,LANG,LC_ALL,TZ,DEBDEBUG,XZ_OPT,REPO_PROXY,APTGETOPT,apt_unattended_opts,DERIVATIVE_APT_REPOSITORY_OPTS,DEBOOTSTRAP,http_proxy losetup --all
sudo: unable to resolve host host: No address associated with hostname
/dev/loop0: [2050]:13382713 (/home/user/derivative-binary/16.0.9.8/Whonix-Gateway-XFCE-16.0.9.8.Intel_AMD64.raw)
+ sync
+ read a b device _
+ dev_mapper_device=/dev/mapper/to
+ echo -e '\n\na = sudo:\nb = unable\ndevice = to\ndev_mapper_device = /dev/mapper/to\n\n\n'


a = sudo:
b = unable
device = to
dev_mapper_device = /dev/mapper/to



+ read -p 'Press ENTER to continue... '
Press ENTER to continue... 

I think I saw a post regarding this hostname error somewhere, so I’ll keep digging. Unless someone can provide some clarification or a quick fix. I do not want to create a step to manually enter the device name.

(I think this is just a host file issue…)

EDIT 2
Adding 127.0.0.1 host to /etc/hosts has fixed this specific issue. Variables are correct now.

a = add
b = map
device = loop0p1
dev_mapper_device = /dev/mapper/loop0p1
1 Like

Thanks for the report!

Error handling will be improved in the next point release.

1 Like