duckietown / duckietown-shell-commands

Commands for the Duckietown Shell
4 stars 4 forks source link

error during init_sd_card #144

Closed DELTAJoSch closed 5 years ago

DELTAJoSch commented 5 years ago

The Problem

When I try to initialize my sd card (16gb), dts starts the process correctly. Even the installation of HypriotOS is successful. Shortly after the successful installation of HypriotOS, the routine crashes. The following is the console output including my command:

Console Output

➜ ~ dts init_sd_card --hostname LitecDuck --linux-username Litec --linux-password LitecQuack --wifi "Duckietown NETWORK:DuckietownNetw0rk" --country AT --compress INFO:dts:duckietown-shell 5.0.3

dts : Problems with a command? :
: Report here: https://github.com/duckietown/duckietown-shell-commands/issues :
: Troubleshooting: :
: - If some commands update fail, delete ~/.dt-shell/commands :
: - To reset the shell to "factory settings", delete ~/.dt-shell :
: (Note: you will have to re-configure.) INFO:dts:looking at /home/johannes/.dt-shell/commands-multi/master19 INFO:dts:duckietown-shell-commands 4.0.44 INFO:duckietown-challenges:duckietown-challenges 5.0.7

Tips and tricks

Multiple networks

dts init_sd_card --wifi  network1:password1,network2:password2 --country US

Steps

Without arguments the script performs the steps:

flash
expand
mount
setup
unmount

You can use --steps to run only some of those:

dts init_sd_card --steps expand,mount

You did not specify a robot type. Default is "duckiebot". Do you confirm? [y]y INFO:dts:Configuration: master19 DEBUG:dts:Found 'wget' at /usr/bin/wget DEBUG:dts:Found 'tar' at /bin/tar DEBUG:dts:Found 'udisksctl' at /usr/bin/udisksctl DEBUG:dts:Found 'docker' at /usr/bin/docker DEBUG:dts:Found 'base64' at /usr/bin/base64 DEBUG:dts:Found 'gzip' at /bin/gzip DEBUG:dts:Found 'udevadm' at /sbin/udevadm DEBUG:dts:Found 'lsblk' at /bin/lsblk INFO:dts:Please type the device with your SD card. Please be careful to pick the right device and to include '/dev/'. Here's a list of the devices on your system: Running /bin/bash /home/johannes/.dt-shell/commands-multi/master19/init_sd_card/list_disks.sh NAME TYPE SIZE VENDOR /dev/sda disk 931,5G ATA
/dev/sdb disk 931,5G ATA
/dev/sdc disk 119,2G ATA
/dev/mmcblk0 disk 15G Done! Type the name of your device (include the '/dev' part): /dev/mmcblk0 Running /bin/bash /home/johannes/.dt-shell/commands-multi/master19/init_sd_card/init_sd_card.sh 64-bit OS detected... Prior etcher-cli install detected at /tmp/duckietown/etcher-cli, skipping... HypriotOS image was previously downloaded to /tmp/duckietown/hypriotos-rpi-v1.9.0.img.zip, skipping... Flashing Hypriot image /tmp/duckietown/hypriotos-rpi-v1.9.0.img.zip to disk /dev/mmcblk0 ? This will erase the selected drive. Are you sure? Yes Flashing: 4.93 MB/s [========================] 100% eta 0s
Validating: 0 B/s [========================] 100% eta 0s

Checksums:

dts : Traceback (most recent call last): : File "/home/johannes/.local/lib/python3.6/site-packages/dt_shell/main.py", line 37, in cli_main : climain() : File "/home/johannes/.local/lib/python3.6/site-packages/dt_shell/main.py", line 157, in climain : shell.onecmd(cmdline) : File "/usr/lib/python3.6/cmd.py", line 217, in onecmd : return func(arg) : File "/home/johannes/.local/lib/python3.6/site-packages/dt_shell/cli.py", line 287, in : do_command_lam = lambda s, w: do_command(klass, s, w) : File "/home/johannes/.local/lib/python3.6/site-packages/dt_shell/dt_command_abs.py", line 50, in do_command : cls.command(shell, args) : File "/home/johannes/.dt-shell/commands-multi/master19/init_sd_card/command.py", line 245, in command : step2function[step_name](shell, parsed) : File "/home/johannes/.dt-shell/commands-multi/master19/init_sd_card/command.py", line 386, in step_expand : uuid = m.group(1) : AttributeError: 'NoneType' object has no attribute 'group'

dts : If you think this is a bug, please report that you are using: :
: duckietown-shell-commands: 4.0.44 : duckietown-challenges: 5.0.7 : python: "3.6.8 (default, Oct 7 2019, 12:59:55) \n[GCC 8.3.0]" : duckietown-shell: 5.0.3 : encodings: : stdout: UTF-8 : stderr: UTF-8

My research

After reading the issues of other people with the init_sd_card command it seems that no one has had this specific issue until now (or at least I couldn't find anything). Somewhere in the script an obejct is not generated correctly, leading to the NoneType error. Any help in fixing this is appreciated.

Thank you!

grazder commented 5 years ago

I've got the same error

gibernas commented 5 years ago

Can you try executing without the --compress option?

@afdaniele are --compress and the device loader conflicting?

DELTAJoSch commented 5 years ago

I only have a 16GB sd-card on hand. Will it fit on there without compress?

grazder commented 5 years ago

I've tried both with --compress and without. But in both cases there is this error: AttrubuteError: 'NoneType' object has no attribute 'group'

UPD. I've got 16GB card with 14,9 available. Can it be a problem?

DELTAJoSch commented 5 years ago

I'll try it without compress anyway.

gibernas commented 5 years ago

I am not sure this is a problem, as the way the images are being loaded changed. Try and see if you have errors

DELTAJoSch commented 5 years ago

It appears to work now. I reinstalled dts and set my shell language to English before install. I also did not use the compress option. The shell I used is zsh with oh-my-zsh.