<commit_before># Troubleshooting

## Archvault Type Errors

If Archvault fails to compile, it will usually be due to Arch Linux system
upgrades rendering Archvault's types (`Keymap`, `Locale`, `Timezone`)
out of date. This is fairly easy to fix manually:

**`Keymap` type is out of date**

```
Type check failed in assignment to @keymap; expected Archvault::Types::Keymap:D but got Str ("amiga-de")
```

The solution is to edit the `%keymaps` constant in
`lib/Archvault/Types.pm6` to include `amiga-de`.

**`Locale` type is out of date**

```
Type check failed in assignment to @locale; expected Archvault::Types::Locale:D but got Str ("aa_DJ")
```

The solution is to edit the `%locales` constant in
`lib/Archvault/Types.pm6` to include `aa_DJ`.

**`Timezone` type is out of date**

```
Type check failed in assignment to @timezones; expected Archvault::Types::Locale:D but got Str ("Africa/Abidjan")
```

The solution is to edit the `@timezones` constant in
`lib/Archvault/Types.pm6` to include `Africa/Abidjan`.

## Archvault Wireless Errors

If Archvault fails to connect to a wireless access point, it could
mean anything.

In some cases, the problem is your system's factory wireless card. The
easiest way to find out if this is true is to buy a high gain USB adapter
from [SimpleWiFi][SimpleWiFi], and see if it works. If it does, you know
the factory wireless card is at fault.

If the USB adapter fails, however, it often means something lower
level has gone awry. Reboot with `acpi=off` appended to your kernel
command line:

```
# in vim, append acpi=off to GRUB_CMDLINE_LINUX
vim /etc/default/grub
# regenerate grub config
grub-mkconfig -o /boot/grub/grub.cfg
```

After this, if your wifi still fails to connect, it could indicate a
problem with your dhcpcd config. Alternatively, there could be an issue
with your router.

## Booting Archvault From Grub Rescue Shell

If upon booting the Archvault system, you initially enter the wrong
vault password, Grub will drop you into a rescue shell. [Here][here]
is how to recover the system from the Grub rescue shell without rebooting:

**Most systems**

```
grub rescue> ls
(hd0) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1) (proc)
grub rescue> cryptomount hd0,gpt3
Attempting to decrypt master key...
Enter passphrase for hd0,gpt3 (<PASSWORD>):
Slot 0 opened
grub rescue> insmod normal
grub rescue> normal
```

**VirtualBox UEFI systems**

```
grub rescue> ls
(proc) (hd0) (hd1) (hd1,gpt3) (hd1,gpt2) (hd1,gpt1)
grub rescue> cryptomount hd1,gpt3
Attempting to decrypt master key...
Enter passphrase for hd1,gpt3 (<PASSWORD>):
Slot 0 opened
grub rescue> insmod normal
grub rescue> normal
```

## Booting Archvault Takes a Really Long Time

It takes a really long time for [Grub][Grub] to decrypt the `/boot`
partition.

## Error While Booting: Kernel Panic

This might be due to an error completing the `mkinitcpio -p linux`
command. Re-run `mkinitcpio -p linux` from a LiveCD after mounting
the system:

```sh
cryptsetup luksOpen /dev/sda3 vault
# see: https://github.com/atweiden/scripts/blob/master/mnt-btrfs.sh
curl -o mnt-btrfs.sh http://ix.io/1iMQ
chmod +x mnt-btrfs.sh
./mnt-btrfs.sh
arch-chroot /mnt pacman -Syu
arch-chroot /mnt mkinitcpio -p linux
```

## Error While Loading Shared Libraries

If during Archvault installation, the system complains about missing
shared libraries, out of date packages are most likely to blame. For
example:

```
/usr/bin/systemd-sysusers: error while loading shared libraries: libjson-c.so.4: cannot open shared object file: No such file or directory
```

The package that provides `libjson-c.so.4` is out of date or missing. To
fix this, update or install pkg `json-c`:

```
pacman -S json-c
```

Or if all else fails, run `pacman -Syu`.

If you're using an outdated Arch Linux installation medium, retry with
the newest version. It's best practice to always use the newest version
of the official Arch Linux installation medium.

## Monitor Resolution Issues

One way to work around monitor resolution issues is to use Vim.

Open vim:

```
vim
```

Create a horizontal split:

```vim
:sp
```

Switch to the bottom split:

- <kbd>Ctrl-w</kbd> <kbd>j</kbd>

Create a vertical split:

```vim
:vsp
```

Switch to the bottom right split, which we'll use as our *main split*:

- <kbd>Ctrl-w</kbd> <kbd>l</kbd>

Create a vertical split within the *main split*:

```vim
:vsp
```

Maximize the *main split* vertically and horizontally:

- <kbd>Ctrl-w</kbd> <kbd>_</kbd>
- <kbd>Ctrl-w</kbd> <kbd>|</kbd>

Center the *main split*:

- <kbd>Ctrl-w</kbd> <kbd>h</kbd>
- <kbd>Ctrl-w</kbd> <kbd>l</kbd>
- <kbd>Ctrl-w</kbd> <kbd>l</kbd>

Navigate back to the *main split*:

- <kbd>Ctrl-w</kbd> <kbd>h</kbd>

Open a terminal:

```vim
:terminal
```

Re-maximize the *main split* vertically:

- <kbd>Ctrl-w</kbd> <kbd>_</kbd>


[Grub]: https://www.reddit.com/r/archlinux/comments/6ahvnk/grub_decryption_really_slow/dhew32m/
[here]: https://unix.stackexchange.com/questions/318745/grub2-encryption-reprompt/321825#321825
[SimpleWiFi]: https://www.simplewifi.com/collections/usb-adapters/products/usb-adapter<commit_msg>expand troubleshooting documentation<commit_after># Troubleshooting

## Archvault Type Errors

If Archvault fails to compile, it will usually be due to Arch Linux system
upgrades rendering Archvault's types (`Keymap`, `Locale`, `Timezone`)
out of date. This is fairly easy to fix manually:

**`Keymap` type is out of date**

```
Type check failed in assignment to @keymap; expected Archvault::Types::Keymap:D but got Str ("amiga-de")
```

The solution is to edit the `%keymaps` constant in
`lib/Archvault/Types.pm6` to include `amiga-de`.

**`Locale` type is out of date**

```
Type check failed in assignment to @locale; expected Archvault::Types::Locale:D but got Str ("aa_DJ")
```

The solution is to edit the `%locales` constant in
`lib/Archvault/Types.pm6` to include `aa_DJ`.

**`Timezone` type is out of date**

```
Type check failed in assignment to @timezones; expected Archvault::Types::Locale:D but got Str ("Africa/Abidjan")
```

The solution is to edit the `@timezones` constant in
`lib/Archvault/Types.pm6` to include `Africa/Abidjan`.

## Archvault Wireless Errors

If Archvault fails to connect to a wireless access point, it could
mean anything.

In some cases, the problem is your system's factory wireless card. The
easiest way to find out if this is true is to buy a high gain USB adapter
from [SimpleWiFi][SimpleWiFi], and see if it works. If it does, you know
the factory wireless card is at fault.

If the USB adapter fails, however, it often means something lower level
has gone awry. Reboot with [acpi=off][acpi=off] [appended][appended]
to your kernel command line:

```
# in vim, append acpi=off to GRUB_CMDLINE_LINUX
vim /etc/default/grub
# regenerate grub config
grub-mkconfig -o /boot/grub/grub.cfg
```

You may only have to boot with `acpi=off` once to get wifi
working. Disabling the [GPE.L6F][GPE.L6F] function also seems to help:

```
echo "disable" > /sys/firmware/acpi/interrupts/gpe6F
```

After this, if your wifi still fails to connect, it could indicate a
problem with your dhcpcd config. Alternatively, there could be an issue
with your router.

## Assorted Errors

Modern computers often have problems running Linux smoothly. Be sure to
scour the web for resources like these:

- https://wiki.archlinux.org/index.php/Laptop/Lenovo
- https://github.com/mikolajb/skylake-on-linux
- https://gist.github.com/StefanoBelli/0aab46b858a797c4eedb90e8799dffa2

Maybe try looking for BIOS updates.

## Booting Archvault From Grub Rescue Shell

If upon booting the Archvault system, you initially enter the wrong
vault password, Grub will drop you into a rescue shell. [Here][here]
is how to recover the system from the Grub rescue shell without rebooting:

**Most systems**

```
grub rescue> ls
(hd0) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1) (proc)
grub rescue> cryptomount hd0,gpt3
Attempting to decrypt master key...
Enter passphrase for hd0,gpt3 (<PASSWORD>):
Slot 0 opened
grub rescue> insmod normal
grub rescue> normal
```

**VirtualBox UEFI systems**

```
grub rescue> ls
(proc) (hd0) (hd1) (hd1,gpt3) (hd1,gpt2) (hd1,gpt1)
grub rescue> cryptomount hd1,gpt3
Attempting to decrypt master key...
Enter passphrase for hd1,gpt3 (<PASSWORD>):
Slot 0 opened
grub rescue> insmod normal
grub rescue> normal
```

## Booting Archvault Takes a Really Long Time

It takes a really long time for [Grub][Grub] to decrypt the `/boot`
partition.

## Error While Booting: Kernel Panic

This might be due to an error completing the `mkinitcpio -p linux`
command. Re-run `mkinitcpio -p linux` from a LiveCD after mounting
the system:

```sh
cryptsetup luksOpen /dev/sda3 vault
# see: https://github.com/atweiden/scripts/blob/master/mnt-btrfs.sh
curl -o mnt-btrfs.sh http://ix.io/1iMQ
chmod +x mnt-btrfs.sh
./mnt-btrfs.sh
arch-chroot /mnt pacman -Syu
arch-chroot /mnt mkinitcpio -p linux
```

## Error While Loading Shared Libraries

If during Archvault installation, the system complains about missing
shared libraries, out of date packages are most likely to blame. For
example:

```
/usr/bin/systemd-sysusers: error while loading shared libraries: libjson-c.so.4: cannot open shared object file: No such file or directory
```

The package that provides `libjson-c.so.4` is out of date or missing. To
fix this, update or install pkg `json-c`:

```
pacman -S json-c
```

Or if all else fails, run `pacman -Syu`.

If you're using an outdated Arch Linux installation medium, retry with
the newest version. It's best practice to always use the newest version
of the official Arch Linux installation medium.

## Monitor Resolution Issues

One way to work around monitor resolution issues is to use Vim.

Open vim:

```
vim
```

Create a horizontal split:

```vim
:sp
```

Switch to the bottom split:

- <kbd>Ctrl-w</kbd> <kbd>j</kbd>

Create a vertical split:

```vim
:vsp
```

Switch to the bottom right split, which we'll use as our *main split*:

- <kbd>Ctrl-w</kbd> <kbd>l</kbd>

Create a vertical split within the *main split*:

```vim
:vsp
```

Maximize the *main split* vertically and horizontally:

- <kbd>Ctrl-w</kbd> <kbd>_</kbd>
- <kbd>Ctrl-w</kbd> <kbd>|</kbd>

Center the *main split*:

- <kbd>Ctrl-w</kbd> <kbd>h</kbd>
- <kbd>Ctrl-w</kbd> <kbd>l</kbd>
- <kbd>Ctrl-w</kbd> <kbd>l</kbd>

Navigate back to the *main split*:

- <kbd>Ctrl-w</kbd> <kbd>h</kbd>

Open a terminal:

```vim
:terminal
```

Re-maximize the *main split* vertically:

- <kbd>Ctrl-w</kbd> <kbd>_</kbd>


[acpi=off]: https://askubuntu.com/questions/139157/booting-ubuntu-with-acpi-off-grub-parameter
[appended]: https://askubuntu.com/questions/127989/no-acpi-support-for-my-pc-what-can-i-do
[GPE.L6F]: http://jhshi.me/2015/11/14/acpi-error-method-parseexecution-failed-_gpe_l6f/index.html#.W19wDdhKjdQ
[Grub]: https://www.reddit.com/r/archlinux/comments/6ahvnk/grub_decryption_really_slow/dhew32m/
[here]: https://unix.stackexchange.com/questions/318745/grub2-encryption-reprompt/321825#321825
[SimpleWiFi]: https://www.simplewifi.com/collections/usb-adapters/products/usb-adapter
{'fraction_non_alphanumeric': 0.11765237836860191, 'fraction_numerical': 0.013745704467353952, 'mean_word_length': 4.5184630738522955, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 96, 'https://': 13, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1964784', 'n_tokens_mistral': 4090, 'n_tokens_neox': 3861, 'n_words': 1380}