Troubleshooting
When a connection fails, the app shows Connection Failed with one of the messages below; when a connection that was up ends, the connection log has the message in a line that starts with AmneziaWG: closing with reason:.
Each message below was produced by a case of Test results, on both phones, and the server's side of each comes from the server's log in the same run. The import's messages are the editor's: the apps' unit tests check that it refuses such files.
First checks
- Open the connection log: tap the status under the power button. Its first lines name the obfuscation settings the profile has (
AmneziaWG: obfuscation S1 S2 S3 S4 H1 …) and the tunnel's MTU. Set Log Level to Expert to see, every 30 seconds, how long ago the last handshake was and how much came and went. - On the server,
awg show awg0lists the server's obfuscation values and each phone with itslatest handshake. A phone without one has never reached the server with the right keys and values. Compare the values with the phone's file: S1 to S4, H1 to H4 and the header protection key must be the same.
Why AmneziaWG says so little
An AmneziaWG server answers nothing to a handshake it cannot take: one from a key it does not know, with the wrong preshared key, for another server key, with other S1, S2, H1, H2, header protection key or random trailers, or on a port where nothing listens. To the app all of these look the same, a server that does not answer, so its message names every cause; the server's peer list, its values and the keys in the files show which one it is.
The configuration
| Message | What it means and what to do |
|---|---|
| The file does not look like a WireGuard config (no [Interface]/[Peer] sections). | The imported file is not an awg-quick configuration. Import the .conf file the server made for this phone. |
| This file has AmneziaWG settings (… and others). Choose AmneziaWG VPN as the protocol to use it.; This configuration has AmneziaWG settings (…): use the AmneziaWG VPN protocol for it. | An AmneziaWG file in a WireGuard profile: the editor refuses it at import, and a WireGuard profile that has one ends with the second message. Make the profile with the protocol AmneziaWG VPN. |
| Invalid AmneziaWG config: The config has no [Interface] PrivateKey., … no [Interface] Address. | A line the app needs is missing from the file. Make the phone's file again (add-phone.sh), or enter the value under Manual Configuration. |
| Invalid AmneziaWG config: a key is not valid base64 (32 bytes)., … the PresharedKey is not valid base64 (32 bytes)., … the HeaderProtectionKey is not valid base64 (32 bytes). | A key is damaged: a key is 44 characters of base64 ending in =. Copy it again, without spaces or line breaks. |
| Invalid AmneziaWG config: H1 must be a number or a range such as 1000000-1999999., … S1 must be a whole number from 0 to 65535., … RandomTrailers must be on or off. | An obfuscation value is not one AmneziaWG takes. Copy the server's value again (awg show awg0 prints them). |
| AmneziaWG refused the configuration: failed to parse I1: unknown tag <x> | AmneziaWG could not read an I1 to I5 pattern; the rest of the message is its own reason. The tags are <b 0x…>, <r N>, <rc N>, <rd N> and <t> (Configuration Reference). |
| The AmneziaWG endpoint … could not be resolved. | The server's name in Server (or in the file's Endpoint) does not resolve. Check the name, or enter the server's address. |
Connecting
| Message | What it means and what to do |
|---|---|
| The server did not answer the AmneziaWG handshake: the server's public key or the preshared key may not match, the server may not have this profile's public key as a peer, its obfuscation settings (S1-S4, H1-H4, HeaderProtectionKey, RandomTrailers) may differ from this profile's, or UDP port … may be closed. | No answer within 10 seconds. Compare the profile's Server Public Key with the server's server.pub, its preshared key with the server's for this phone, and its obfuscation values with awg show awg0; check that awg show awg0 lists this phone's public key (a removed phone is no longer there); check that the port is the server's ListenPort and open to the phone on every network it uses. A plain WireGuard file gets this message from an AmneziaWG server too. |
| Could not connect after 3 attempts. (The server did not answer the AmneziaWG handshake.) | The same, after the attempts that Retry Times adds before the first connection. |
A connection that was up
| Message | What it means and what to do |
|---|---|
| The server answers the AmneziaWG handshake but none of the traffic: S3, S4 or H4 may differ from the server's. | The server took the handshake (S1, S2, H1 and H2 match) but drops every data packet: the phone's S3, S4 or H4 is not the server's. The status showed Connected for a moment; the app ends the VPN once two handshakes in 40 seconds were answered and nothing else came back while the phone sent. Copy S3, S4 and H4 from awg show awg0, or make the phone's file again. |
| The server stopped answering: nothing came back for 30 seconds (auto reconnect is off). | The server, or the path to it, stopped answering while the phone was sending. With Auto Reconnect on, the app tries new handshakes instead. |
| Could not reconnect after 2 attempts. (The server did not answer the AmneziaWG handshake.) | The server stopped answering and did not answer the attempts that Retry Times allows. Leave Retry Times empty to keep trying while the server is away. |
| The connection was closed while the device slept. | On Sleep is Off and Auto Reconnect is off: the app closed AmneziaWG when the device slept and does not connect again at wake. Choose Stay or Pause, or turn Auto Reconnect on. |
Slow despite a connection
Uploads are slow and downloads are not, and the connection log starts with AmneziaWG: note: with RandomTrailers on, ranges in H1-H3 and no HeaderProtectionKey …: the server is AmneziaWG as Amnezia releases it, which takes some of the phone's data packets for handshake messages and drops them (Configuration Reference); against the kernel module in our test, the iPhone uploaded at 31 Mbit/s, and Android took 36.7 s for its uploads instead of 8.3 s. Give the server and the phones' files a HeaderProtectionKey, or single values in H1 to H4, or turn RandomTrailers off on both. A server set up as AmneziaWG server shows, with our amneziawg-go fork, does not drop them.