Hopwire Hopwire

Docs

Troubleshooting

Every error message of the Hopwire CLI, the edge and the inspector, with its cause and its fix.

Every message Hopwire can show you, grouped by where you see it: in the terminal, in the answer of an HTTP request, on a WebSocket, or in the inspector. Search this page for the text you got. Parts in angle brackets (<port>, <file>, <code>) stand for the value of your run.

How the CLI reports a failure

  • One sentence on stderr: what happened and what to do.
  • Exit code 2: the command line was wrong. The sentence is followed by Run "hopwire --help" for usage.
  • Exit code 1: everything else, also a public tunnel that ended by itself (subdomain taken over, token no longer accepted).
  • Exit code 0: you stopped it with Ctrl-C or SIGTERM. Hopwire closes everything in order first. A second Ctrl-C exits at once (code 130, or 143 for SIGTERM).

Codes in brackets such as (ECONNREFUSED), (ENOTFOUND) or (TIMEOUT) are the error code of the operating system or of Node. (UNKNOWN) means the failure carried no code.

Command line (exit code 2)

Commands and options

Message Cause Fix
Unknown command "<name>" The first argument is not http, up, id, connect, watch, login or logout. Run hopwire --help.
--<option> is not an option of hopwire <command> The option exists, but for another command, for example --share with hopwire watch. Use it with the command the help lists it under.
<option> is not an option of hopwire No command has this option. Check the spelling.
<option> does not take a value A switch such as --share, --public or --no-inspect was written as --share=yes. Write the switch alone.
<option> needs a value An option such as --listen or --port came last or without a value. Add the value: --listen 4051.
<option> needs a value; write <option>=<value> when the value starts with a hyphen The value after the option starts with -, so it reads like another option. Write --name=-odd-name.
The arguments could not be read The command line could not be parsed and no option could be named. Check the command against hopwire --help.
Too many arguments; the command is <usage> More positional arguments than the command takes, for example hopwire http 3000 4000. Remove the extra argument.
--data-dir needs the path of a directory --data-dir was given an empty value. Give a path, or leave the option out (default $HOPWIRE_HOME or ~/.hopwire).

hopwire http

Message Cause Fix
port must be a port number between 1 and 65535 The port of the local service is missing or not a number: hopwire http or hopwire http web. hopwire http 3000
--listen must be a port number between 0 and 65535 Bad value for the entry point port. Use a port, or 0 for a free one. The default is 4041.
--inspect must be a port number between 0 and 65535 Bad value for the inspector port. Use a port, or 0 for a free one. The default is 4040.
--inspect and --no-inspect cannot be combined Both were given. Keep one.
--allow must be a public key: 64 hexadecimal characters, as hopwire prints them The value of --allow is not a key. Ask your teammate for the output of hopwire id.
--allow only works together with --share An allowlist without sharing. Add --share.
--subdomain only works together with --public A subdomain without a public URL. Add --public.
--subdomain must be 3 to 63 lowercase letters, digits or hyphens, must not start or end with a hyphen, must not start with t- and must not be a reserved name such as www or api The name breaks the rule. Reserved names are www, api, app, edge, admin, mail, status, docs and hopwire; names that start with t- are the fixed URLs of organisations and the random names of a local edge. Pick another name.
--name must be a service name of 1 to 255 bytes without control characters Empty name, too long, or with control characters. Use a plain name: --name api.

hopwire connect and hopwire watch

Message Cause Fix
hopwire connect needs --port <port>, the loopback port that reaches the peer --port is required. hopwire connect <peer-key> --port 5000 (0 picks a free port).
The peer key must be a public key: 64 hexadecimal characters, as hopwire prints them The key is missing, cut off or not hex. Copy the whole Peer key line of your teammate's tunnel.
The log key must be a public key: 64 hexadecimal characters, as hopwire prints them Same, for hopwire watch. Copy the whole key of the Traffic log line.
--port must be a port number between 0 and 65535 Bad value. Use a port, or 0.
--service must name a service (at most 255 bytes) Empty or too long. Use the name your teammate started the service with.
--replay-target must be an http URL on this machine without a path, for example http://127.0.0.1:3000 The target is not http:// on 127.x.x.x, localhost or [::1], or it has a path, a query or credentials. --replay-target http://127.0.0.1:3000

hopwire up

Message Cause Fix
--config needs the path of a config file --config was given an empty value. Give the path, or leave it out to read hopwire.yaml in the working directory.

hopwire login

Message Cause Fix
--api must be an http:// or https:// URL without a path, for example https://hopwire.to Not a URL, another scheme, or with a path. Give the origin only.
--api must use https:// unless the control plane runs on this machine; over http:// the API token would travel unencrypted http:// to a host that is not loopback. Use https://.

Starting a tunnel (exit code 1)

Ports, data directory and files

Message Cause Fix
Port <port> for the entry point is already in use; choose another one with --listen <port>. Another program, often a second hopwire http, holds the entry port (default 4041). hopwire http 3000 --listen 4051, or --listen 0.
Port <port> for the inspector is already in use; choose another one with --inspect <port> or run with --no-inspect. The inspector port (default 4040) is taken. --inspect 4050, --inspect 0 or --no-inspect.
Port <port> for the inspector is already in use; choose another one with --inspect <port>. Same, from hopwire watch. hopwire watch <log-key> --inspect 4050
Port <port> for the inspector is already in use; choose another one with inspector.port in hopwire.yaml. Same, from hopwire up. Change inspector.port in the file (0 picks a free one).
Port <port> for the local end of the tunnel is already in use; choose another one with --port <port>. The port you gave hopwire connect is taken. Another port, or --port 0.
Port <port> for the <what> needs privileges this user does not have; choose a port above 1023 with <option>. A port below 1024 without the rights for it. Use a port above 1023.
The data directory <dir> is in use by another tunnel; stop that one or choose another directory with --data-dir <path>. One data directory holds one traffic log, and a running hopwire http, up or watch has it open. Stop the other one, or give this one its own: hopwire http 3001 --data-dir ~/.hopwire-b --listen 4051 --inspect 4050.
The identity file <dir>/identity.json is damaged; move it away and run the command again to create a new identity (the peer key of this machine changes). The file is not what Hopwire wrote. Move it away. Teammates who have your key in --allow or p2p.allow need the new key from hopwire id.
The file <dir>/config.json is damaged; run hopwire login again to replace it, or hopwire logout to remove it. The stored account cannot be read. hopwire login --api <url>
Hopwire cannot use <path> (<code>); check that it exists and that this user may write to it, or choose another data directory with --data-dir <path>. A file or directory of the data directory cannot be read, written or created (EACCES, EROFS, ENOSPC, ENOTDIR and the like). Fix the permissions or the disk, or use --data-dir.
Hopwire stopped on an unexpected error (<code>); run the command again and report the problem if it happens again. A failure Hopwire has no sentence for. Run it again. If it repeats, report it with the code.
Shutdown took too long; exiting without waiting for the rest. Closing took longer than 4 seconds after Ctrl-C. Nothing to do. The process has exited.

With hopwire up a taken entry port is not an error: the service gets a free port instead, and the Forwarding line says which.

Lines printed while a tunnel runs

Message Cause Fix
Could not write to the traffic log; the request was still forwarded The exchange was answered but could not be appended to the log (disk full, directory gone). Check the disk and the data directory. The request itself went through.
Could not write to the traffic log; the replay was still sent Same, for a replay from hopwire watch. Same.

Public mode: --public and public services of hopwire up

Before the tunnel connects

Message Cause Fix
--public needs the URL of the edge: set HOPWIRE_EDGE_URL, for example ws://127.0.0.1:8787 for wrangler dev. HOPWIRE_EDGE_URL is not set or empty. HOPWIRE_EDGE_URL=ws://127.0.0.1:8787 hopwire http 3000 --public
HOPWIRE_EDGE_URL must be a ws:// or wss:// URL without a path, for example wss://edge.hwr.sh. Not a WebSocket URL, or with a path. https:// is not accepted. Use ws:// or wss:// and the origin only.
HOPWIRE_EDGE_URL must use wss:// unless the edge runs on this machine; over ws:// the token would travel unencrypted. ws:// to a host that is not loopback. Use wss://.
--public needs an account: run hopwire login first. For a local edge without a control plane, set HOPWIRE_DEV_TOKEN to its dev token instead. No stored login and no HOPWIRE_DEV_TOKEN. Log in, or for a local edge: HOPWIRE_DEV_TOKEN=<its dev token> HOPWIRE_EDGE_URL=ws://127.0.0.1:8787 hopwire http 3000 --public.
A service in <file> is public and needs a token: set controlPlane.url in the file to use your account (hopwire login), or set HOPWIRE_DEV_TOKEN to the dev token of a local edge (HOPWIRE_DEV_TOKEN in its .dev.vars). hopwire up with a public service, no controlPlane.url in the file and no dev token in the environment. Add controlPlane.url, or set HOPWIRE_DEV_TOKEN.
<file>: controlPlane.url is set, so the public services use your account there, but this machine is not logged in; run hopwire login --api <url> first. The file names a control plane and no token is stored. Run the command the message gives.
<file>: controlPlane.url is <url>, but this machine is logged in at <other url>; run hopwire login --api <url>, or change the URL in the file. The stored token belongs to another control plane. It is not sent to this one. Log in there, or correct the file.
HOPWIRE_EDGE_URL is <url>, but the connect tokens of the account on this machine go to the edge <other url>; run hopwire login again to use the account with another edge. The first public start after hopwire login binds the account's connect tokens to its edge; this start names another one. No token is fetched. Use the edge of the message, or run hopwire login again to bind the account to the new edge.
<file>: edge.url is <url>, but the connect tokens of the account on this machine go to the edge <other url>; run hopwire login again to use the account with another edge, or change the URL in the file. The same for edge.url in hopwire.yaml, for example in a project file you did not write. Check the file. If the new edge is right, run hopwire login again.

When HOPWIRE_DEV_TOKEN is set, hopwire http --public uses it and does not look at your login.

The edge refuses or cannot be reached

Message Cause Fix
The edge at <url> cannot be reached (<code>); check the edge URL and that the edge is running. The first connection failed: nothing listens there (ECONNREFUSED), the name does not resolve (ENOTFOUND), or the upgrade was not answered within 15 seconds (TIMEOUT). Check the URL and that the edge runs.
The edge at <url> refused the token (401); check the token and that it belongs to this edge. The dev token does not match the one of the edge, or the edge does not run in dev mode. Compare HOPWIRE_DEV_TOKEN with the edge's .dev.vars.
The edge at <url> refused the token (401), and a new one from the control plane as well; check that this edge belongs to the control plane you are logged in to. The edge does not verify tokens of your control plane (wrong edge URL, or a signing key that does not match). Check HOPWIRE_EDGE_URL or edge.url against the control plane you logged in to.
The token does not allow the subdomain <name> (403); use the subdomain the token was issued for. The token is genuine but names another subdomain. Start the tunnel again. If it stays, report it.
The edge at <url> refused the connect request for the subdomain <name> as malformed (400); check the subdomain and that CLI and edge are the same version. The edge did not accept the subdomain or the Basic Auth header of the request. Check the name and auth.basic, and update the CLI.
The edge at <url> answered <status> instead of accepting the tunnel; check the edge URL. Something that is not a Hopwire edge answered. Correct the URL.

The control plane (login and connect tokens)

Message Cause Fix
The control plane at <url> cannot be reached (<code>); check its URL, your connection and that it is running. No answer within 15 seconds (TIMEOUT) or a network error. Check the URL and your connection.
The control plane at <url> does not accept the API token (401): it is unknown or was revoked; create a new one there and run hopwire login again. The token was revoked or belongs to another control plane. Create a token on the API tokens page, then hopwire login.
The control plane at <url> limits how often <what> can be asked for (429); wait a minute and try again. Too many requests with this API token. Wait a minute.
The control plane at <url> cannot answer right now (503); try again later, and tell its operator when it stays that way. The control plane cannot sign tokens at the moment. Try later.
The control plane at <url> failed with status <status>; try again later. A server error. Try later.
The control plane at <url> answered <status> instead of <what>; check that the URL is the one of a Hopwire control plane. Something else answers at this URL (a redirect counts: it is not followed). Correct --api or controlPlane.url.
The control plane at <url> did not answer with <what>; check that the URL is the one of a Hopwire control plane and that it matches this version of the CLI. The answer was not what the CLI expects. Check the URL, update the CLI.
Your organisation at <url> has not reserved the subdomain <name> (403); reserve it on the Subdomains page there, or leave the subdomain out to use the fixed URL of your organisation. --subdomain or subdomain: names one that is not your organisation's, or one that was released. Reserve it (owner or admin), or drop it for the fixed t- URL.
The control plane at <url> no longer issues connect tokens for <name> (403); it is not the fixed URL of your organisation any more, so start the tunnel again. A renewal for the fixed URL was refused. Start the tunnel again.
This name is still your organisation's, but its current plan has no room for it, so it is offline. Use the fixed URL, release one of the names that are online (the oldest offline name then comes back) or move to a plan with more names. (name_not_in_plan) The organisation holds more reserved names than its plan allows, for example after a downgrade. Only the oldest names the plan has room for are served. Do one of the three things the sentence names.
Your organisation is suspended, so it cannot open public tunnels. Its owner has been told why by email. (organisation_suspended) The organisation gets no connect tokens while it is suspended. The owner finds the reason in that email.
The control plane at <url> refused the subdomain <name> as malformed (422); use 3 to 63 lowercase letters, digits or hyphens. The name breaks the rule of the control plane. Pick another name.

In these sentences <what> is the account of the token during hopwire login and a connect token when a tunnel starts or renews.

hopwire login and hopwire logout

Message Cause Fix
That is not an API token: one starts with hw_ and has 43 characters; copy it from the API tokens page of the control plane right after creating it. The value of HOPWIRE_TOKEN or of the prompt is not a token (cut off, with quotes, or something else). Copy the token again. It is shown once, right after you create it.
hopwire login has no terminal to ask for the API token on; pass it in the environment variable HOPWIRE_TOKEN. Login in a script or a pipe, without HOPWIRE_TOKEN. HOPWIRE_TOKEN=hw_... hopwire login
Cancelled; nothing was stored. Ctrl-C or Ctrl-D at the prompt. Run hopwire login again.
Logged out no token was stored in <file> Not an error: there was nothing to remove. None.

Nothing is stored unless the control plane accepted the token. hopwire logout removes the token from this machine only; it stays valid until you revoke it on the API tokens page.

While a public tunnel runs

Message Cause Fix
Edge connection lost; the public URL is offline, next attempt in <n> s The socket to the edge was lost. Hopwire reconnects by itself, without end, waiting from 0.5 s up to 30 s between attempts. With several services the line ends with (service <name>). Wait, or check your connection and the edge.
Edge connected again; the public URL is served The tunnel is back under the same URL. None.
Another tunnel connected for the subdomain <name> and replaced this one; stop one of the two or use another subdomain. A second tunnel started for the same subdomain. The newest connection wins; this one exits with code 1. Stop one of them, or give each its own subdomain.
The edge at <url> closed the tunnel because its token expired or was revoked; start the tunnel again with a valid token. The edge ended the tunnel and there is no account to fetch a new token from. Start it again.
No new token could be fetched for the subdomain <name>, so the edge at <url> no longer serves it; start the tunnel again. The renewal of the connect token failed for good with a failure that has no sentence of its own. A revoked API token or a released name ends the tunnel with the control plane's sentence instead (see below). Start it again.
Public URL subdomain <name> (the edge did not report its URL) The edge accepted the tunnel but did not send the URL. Update the edge. The tunnel itself works.
Limit Daily request limit of the plan reached; public requests are answered 429 until 00:00 UTC (or Daily data limit, Daily in-flight time) Not an error of the CLI: the organisation used up a daily limit of its plan. The tunnel keeps running. See Plan limits at the edge.
Your organisation already has <n> of <limit> tunnels online, the most its plan allows at once; stop one of them and start this one again. The edge refused the tunnel (429): all tunnels the plan allows are online, on this or another machine of the organisation. The CLI does not retry and exits with code 1. Stop another public tunnel of the organisation, or move to a plan with more tunnels.
The edge closed the tunnel for <name> after 24 hours without a request, as the plan of your organisation does; start Hopwire again to reconnect it. Free plan: no public request for 24 hours. Exits with code 1. Start it again. The URL stays the same.

A connect token lasts 5 minutes and is renewed while the tunnel runs. When the control plane refuses a renewal for good, you see its sentence from the table above (for example the 401 after you revoked the API token), and the tunnel exits with code 1.

Private mode: --share, hopwire connect, hopwire watch

No account, no servers of ours, end-to-end encrypted between you and the teammates you choose. That also means there is no relay: both machines have to reach each other directly.

hopwire connect

Message Cause Fix
No peer with the key <key> was found; check the key, your network connection and that your teammate's tunnel is running and shared (--share, or p2p.share in hopwire.yaml). Nobody announces this key. The teammate's tunnel is stopped, runs without sharing, or the key is wrong. Your teammate runs hopwire http 3000 --share and sends you the Peer key line.
The peer <key> was found but did not accept the connection; if your teammate uses --allow, it has to list this machine's key <your key>. You are not on the allowlist. Send your teammate the key in the message (also hopwire id). They restart with --allow <your key> or add it to p2p.allow.
The peer runs several services; choose one with --service <name>. The teammate runs hopwire up with more than one service. hopwire connect <peer-key> --port 5000 --service api
The peer has no service named "<name>"; ask your teammate for the name it was started with (--name, or the service name in hopwire.yaml). Wrong --service. A single hopwire http service is named default unless --name was given. Use the right name, or leave --service out when the peer shares one service.
The peer did not understand this connect request; make sure both sides run the same version of Hopwire. Version mismatch between the two CLIs. Update both.
The peer <key> did not answer in time; check your connection and try again. The peer accepted the stream and did not answer within 30 seconds. Try again.
The peer <key> has as many connections open as it accepts; close some of yours or try again later. A shared tunnel holds at most 64 connections at once, 16 per teammate. Close idle clients of hopwire connect, then try again.
No direct connection to the peer <key> was possible (<code>); Hopwire has no relay, so try again from another network. Hole punching failed, typically with strict NAT on both sides. Try from another network (a phone hotspot is a quick test).

The same sentences are printed while hopwire connect runs, when a later connection to the peer fails. Your client then only sees a closed connection on 127.0.0.1:<port>; the reason is in the terminal of hopwire connect.

A connection whose data makes no progress for 60 seconds (one side stopped reading while the other has data waiting) is closed on both ends. A client that pauses a download for longer than a minute then connects again.

hopwire watch

Message Cause Fix
Nobody is sharing the log <key> right now; check the key, your network connection and that your teammate's tunnel is running and shared (--share, or p2p.share in hopwire.yaml). No sharer was found within 30 seconds. Check the key (the Traffic log line, not the Peer key line) and that the tunnel runs with --share.
The sharer of the log <key> was found but no connection came about: either no direct connection was possible (Hopwire has no relay) or it runs with --allow, which then has to list this machine's key <your key>. Allowlist or failed hole punch. Send your key to the sharer, or try another network.
That is the key of the traffic log on this machine; hopwire watch takes the log key a teammate shared. You gave your own log key. Your own traffic is in the inspector of your tunnel. watch is for a teammate's log.
Replay off; start hopwire watch with --replay-target <url> to replay to a local service Not an error: this watch was started without a target. hopwire watch <log-key> --replay-target http://127.0.0.1:3000
Watching stopped: this run has downloaded 1024 MB of the log; new exchanges are no longer fetched until hopwire watch is started again One run of hopwire watch downloads at most 1 GiB of a teammate's log. What is on your disk stays readable in the inspector. Start hopwire watch again.

hopwire watch opens the traffic log of its data directory. Next to a running hopwire http on the same machine, give it its own: hopwire watch <log-key> --data-dir ~/.hopwire-watch --inspect 4050.

Development switch

Message Cause Fix
HOPWIRE_DHT_BOOTSTRAP must be a comma-separated list of host:port, for example 127.0.0.1:49737. The variable is set and malformed. It points the CLI at a local test DHT and is not a product setting. Unset it, or correct it.

hopwire.yaml

Nothing is started from a file that is not exactly what the format allows. The sentence names the file and the field by its path, for example hopwire.yaml: services.api.local must be .... A name that is not a plain word is quoted: services["my app"].local.

The file

Message Cause Fix
There is no hopwire.yaml in this directory; create one (hopwire.example.yaml shows every field) or name a file with --config <path>. hopwire up found no file in the working directory. Create it, change directory, or use --config.
The config file <file> does not exist; check the path given to --config. Wrong path. Correct it.
The config file <file> cannot be read (<code>); check that it is a readable file. A directory, or no read permission. Fix the path or the permissions.
<file> is not valid YAML: <what> at line <n>, column <n>; correct the file and start again. A syntax error, also a key given twice. Lines of the file are never repeated in the message, because they may hold a password. Fix the line the message points to. Indent with spaces.
<file> is not valid YAML: an alias (*name) has no anchor, or aliases are nested too deep; correct the file and start again. A broken YAML alias. Remove or define the anchor.
<file> is empty; it needs "version: 1" and at least one service. Nothing in the file but comments or whitespace. See the minimal file below.
<file> must be a mapping with the keys version, inspector, edge, controlPlane, p2p and services. The top level is a list or a plain value. Start with version: 1.

Fields

Message (after <file>: <path>) Cause Fix
version is missing; add "version: 1" to the file. No version. Add it.
version must be 1, the only version of the format this tunnel reads. Another value, also "1" in quotes. version: 1
<key> is not a key Hopwire knows; <section> takes <keys>. A misspelt or unknown key. The top level takes version, inspector, edge, controlPlane, p2p and services; a service takes local, public, subdomain and auth. Correct or remove the key.
<path> must be a mapping with the key <key>. / ... with the keys <keys>. A section holds a plain value or a list, for example edge: ws://127.0.0.1:8787 instead of edge: with url: under it. Nest the keys as the message lists them.
inspector.port must be a port number between 0 and 65535 (0 picks a free one). Not a whole number in range, or a number in quotes. port: 4040
edge.url must be a ws:// or wss:// URL without a path, for example wss://edge.hwr.sh or ws://127.0.0.1:8787 for wrangler dev. Not a WebSocket URL, or with a path. Use the origin only.
edge.url must use wss:// unless the edge runs on this machine; over ws:// the token would travel unencrypted. ws:// to a host that is not loopback. Use wss://.
edge.url is missing, and a service is public; add the URL of the edge, for example ws://127.0.0.1:8787 for wrangler dev. public: true without edge.url. hopwire up does not read HOPWIRE_EDGE_URL. Add edge: with url:.
controlPlane.url must be an http:// or https:// URL without a path, for example https://hopwire.to. Not a URL, or with a path. Use the origin only.
controlPlane.url must use https:// unless the control plane runs on this machine; over http:// the API token would travel unencrypted. http:// to a host that is not loopback. Use https://.
p2p.share must be true or false. / services.<name>.public must be true or false. yes, on, 1 or a quoted value. Only true and false are booleans. Write true or false.
p2p.allow must be a list of public keys, as "hopwire id" prints them. A single value instead of a list. Write each key on a - line.
p2p.allow must list at least one public key; remove the key to let every teammate with the keys in. An empty list. List a key, or remove allow.
p2p.allow[<n>] must be a public key: 64 hexadecimal characters, as "hopwire id" prints them. Entry <n> (counted from 0) is not a key. Correct it.
services is missing; add at least one service with its local URL. No services. Add one.
services must be a mapping of service names to their settings. services is a list or a plain value. Use name: with the settings indented under it.
services must name at least one service with its local URL. services: {}. Add one.
services has a key that is a list or a mapping; name each service with one plain word or number. A complex YAML key. Use a plain name.
services.<name> is given twice; a number and the same number in quotes are one service name, so give each service its own. For example 8080: and "8080":. Rename one.
services.<name> is not a usable service name; use 1 to 255 bytes without control characters. Empty name, too long, or with control characters. Rename it.
services.<name>.local is missing; it must be an http URL on this machine without a path, for example http://127.0.0.1:3000; Hopwire only forwards to loopback addresses. A service without local. Add it.
services.<name>.local must be an http URL on this machine without a path, for example http://127.0.0.1:3000; Hopwire only forwards to loopback addresses. A bare port (3000), https://, a host that is not 127.x.x.x, localhost or [::1], or a URL with a path. local: http://127.0.0.1:3000
services.<name>.subdomain must be 3 to 63 lowercase letters, digits or hyphens, must not start or end with a hyphen, must not start with t- and must not be a reserved name such as www or api. The name breaks the rule. Pick another, or remove it to use the fixed URL of your organisation (a random t- name with the dev token).
services.<name>.subdomain is also the subdomain of the service <other>; a subdomain serves one service, so give each its own. Two public services with the same subdomain. Change one.
services.<name>.auth.basic must be user:password with a user that contains no colon, a password, no control characters and at most 512 bytes. No colon, an empty user or password, or too long. The value is never repeated in the message. basic: demo:change-me

A minimal file that starts:

yaml
version: 1
services:
    web:
        local: http://127.0.0.1:3000

HTTP answers written by Hopwire

When a request cannot be answered by your service, Hopwire answers in its place. These bodies are text/plain. Everything else you receive comes from your own service, unchanged.

From the CLI: status 502

You get these on the entry point (http://127.0.0.1:4041), through hopwire connect and through the public URL. The first three are recorded in the traffic log like any other exchange.

Body Cause Fix
Hopwire: the local service did not answer (<code>) The service could not be reached or broke the connection. ECONNREFUSED: nothing listens on the port. ECONNRESET: it closed the connection without an answer. Start the service and check the port you gave hopwire http or local:. Test it directly: curl -i http://127.0.0.1:3000/.
Hopwire: the local service closed the connection while the request body was being sent (<code>); if it answered before that, the answer was lost The service stopped reading an upload (EPIPE or ECONNRESET), often because it refuses large bodies. Check the body size limit of your service.
Hopwire: the WebSocket handshake with the local service failed (<reason>) The service was reached but did not complete the WebSocket upgrade. Check that this path of your service accepts WebSockets.
Hopwire: the request could not be forwarded The request could not be passed on at all, for example a path or header that cannot be sent. Check the request. If it is a normal one, report it.

From the edge: public requests

Status Body Cause Fix
502 Hopwire: tunnel offline No CLI is connected for this subdomain: the tunnel is stopped, still reconnecting, or the name is wrong. Start the tunnel and compare the URL with its Public URL line.
502 Hopwire: tunnel connection lost The CLI disconnected, or was replaced by a newer tunnel, while this request waited. Send it again once the tunnel is back.
502 Hopwire: the local side sent a malformed response The CLI sent something the edge cannot turn into a response. Make sure CLI and edge are the same version.
504 Hopwire: timeout, the local side did not answer in time Your service did not start its answer within 30 seconds. The time a client takes to upload does not count while data keeps flowing. Answer faster: acknowledge the webhook first and do the work afterwards.
504 Hopwire: the response took longer than the plan of this tunnel allows The response did not finish within the longest response of the plan (5 minutes on Free, 30 on Pro and Team), counted from the arrival of the request. One that had started is broken off instead. Make the response shorter, or move to a plan with a longer limit.
429 This tunnel's organisation has used the daily request limit of its plan; requests are answered again from 00:00 UTC. (or daily data limit, daily in-flight time) A daily limit of the organisation's plan is used up. Retry-After gives the seconds until 00:00 UTC. See Plan limits at the edge.
401 Authentication required The service has auth.basic and the request has no or wrong credentials. The answer carries WWW-Authenticate: Basic realm="Hopwire". curl -u user:password <public URL>. The credentials stay at the edge; your service does not see them.
429 This tunnel already has 10 WebSocket connections open, which is the most it carries at once A public tunnel carries at most 10 client WebSocket connections at a time. The open ones keep working. Close a connection, then connect again.
429 This tunnel already has 100 requests in flight, which is the most it carries at once A public tunnel carries at most 100 requests at a time (WebSocket upgrades still waiting for their answer included). The answer carries Retry-After: 1. It does not count against the daily limits of the plan. Send it again in a moment. If it stays, look for clients that keep requests open.
429 Too many wrong credentials, try again later The service has auth.basic and this client address sent 10 wrong credentials within a minute. Retry-After says when the minute is over; other addresses are served. Wait, then use the right credentials.
501 Upgrade requests other than for a WebSocket are not supported The request has an Upgrade header that is not websocket. Only WebSocket upgrades pass through a public URL.
404 Not found The host is not <subdomain>.<public domain> of this edge, or the subdomain is malformed. On a local edge: the first path segment (or the Hopwire-Subdomain header) is not a subdomain. Use the URL of the Public URL line as printed.

A 502 without a body that starts with Hopwire: comes from your service, not from Hopwire.

A response body that breaks off can also come from the edge: when a client stops taking a response for 30 seconds, or when a tunnel holds 32 MB of response bodies that clients have not taken, the edge gives the request up and tells the CLI. The edge also drops the Domain attribute from every Set-Cookie of your service, so cookies stay with the host of the tunnel.

From the edge: the connect request of the CLI

You normally see these as the CLI sentences under "The edge refuses or cannot be reached". They are listed for whoever looks at the raw answer of /_hopwire/connect.

Status Body Cause
426 Expected a WebSocket upgrade The path was opened without Upgrade: websocket, for example in a browser.
400 The subdomain is missing or malformed No subdomain in the query, or not a valid name.
401 The token is missing or invalid No Authorization: Bearer token, or one the edge does not accept.
403 The token does not allow this subdomain A genuine token for another subdomain.
429 Your organisation already has <n> of <limit> tunnels online, the most its plan allows at once; stop one of them and start this one again. All tunnels the organisation's plan allows are online.
400 The Hopwire-Basic-Auth header is not Base64 of user:password Broken credentials. The tunnel is refused, so it never runs without the protection it asked for.
400 The Basic Auth hash is malformed Internal check of the same; not expected in normal use.

Plan limits at the edge

  • Each plan has a daily budget for public traffic, held by the organisation (your personal one, or a team's): requests, data, in-flight time (the sum of request durations; an open WebSocket counts for as long as it is open) and the number of tunnels online at once. Values per plan: Public mode, Limits per plan.
  • At a limit the public URL answers 429 until 00:00 UTC, with the one-sentence body from the table above and a Retry-After header. Then it works again by itself. There is never overage and never an automatic upgrade or charge. The CLI prints a Limit line once per limit and day.
  • When the in-flight time is used up, open WebSockets are closed with 1008 (see below).
  • A tunnel that connects when all tunnels the plan allows are online is refused with 429; the CLI prints the edge's sentence and does not retry.
  • On Free a tunnel is closed after 24 hours without a request. Start it again; the URL stays the same.
  • On the Free plan a browser that loads an HTML page through a public URL sees a warning page first. Webhooks, API calls and curl never get it.
  • The Usage page of the control plane shows where the organisation stands, and limit emails go to its owner and admins at 80% and 100% of a limit. Both work from the numbers the control plane fetches from the edge every 5 minutes.
  • Fix for a 429 from a plan limit: wait for 00:00 UTC, or move to a plan with higher limits on the Billing page. Private mode (--share, connect, watch), the local entry point and a tunnel with HOPWIRE_DEV_TOKEN on a local edge have no such limits.

Do not confuse this with the 429 for WebSocket connections or requests in flight above, which are per tunnel, do not count against the plan and clear as soon as a connection or request ends.

WebSocket close codes

A close code and reason from your service or from the client pass through unchanged. Hopwire itself closes a connection only in these cases:

Code Reason Cause Fix
1001 Hopwire stopped The CLI was stopped while the connection was open (entry point or hopwire connect). Start the tunnel and reconnect.
1001 Hopwire: tunnel connection lost The socket between CLI and edge was lost or replaced under the connection. Both the public client and the local service are told. Reconnect once the tunnel is back.
1009 Hopwire: the message is too large A message above 1 MiB. Larger ones are not passed through. Split the message.
1013 Hopwire: the local side does not keep up More than 4 MiB sent by the public client were waiting for the local service. Send slower, or read faster in the service.
1013 Hopwire: the client does not keep up More than 4 MiB from the service were waiting for a public client that does not read. Read faster in the client, or send less.
1011 Hopwire: malformed frame The edge got something it could not carry on. Make sure CLI and edge are the same version.
1007 Hopwire: the message could not be delivered A message could not be handed to the public client. Reconnect. If it repeats, report it.
1008 Hopwire: the daily in-flight time of the plan is used up The organisation used up its daily in-flight time while the connection was open. Both the public client and the local service are told. New upgrades get 429 until 00:00 UTC. Wait until 00:00 UTC, or move to a plan with more in-flight time.

On the socket between CLI and edge, which you only see in a network trace: 4000 Replaced by a newer connection, 4001 Token expired and 4002 Idle (Free plan, 24 hours without a request). The CLI turns them into the sentences under "While a public tunnel runs".

Messages of a WebSocket are not recorded. The log holds the handshake as an exchange with status 101.

The inspector

The inspector runs on http://127.0.0.1:4040/<key> unless you chose another port, and only on that address. <key> is the access key of the run, printed in the Inspector line; it is new at every start.

In the page

Message Cause Fix
The tunnel does not answer. Is it still running? The page cannot reach the CLI: it was stopped, or restarted on another port. Start the tunnel and open the URL of its Inspector line.
Not connected to the tunnel Same, before the first load came through. Same.
The connection to the tunnel is closed. Reload the page to connect again. The live stream ended for good. The indicator says Disconnected. Reload the page.
Reconnecting (stream indicator) The live stream dropped and the browser is trying again. Status and list are loaded anew when it is back, so nothing is missing. Wait, or check that the tunnel runs.
The traffic could not be loaded. / Older requests could not be loaded. A load failed without an answer the page could read. Reload the page.
The inspector answered <status>. An answer without a readable message. Reload. If it repeats, report it with the status.
Truncated: the log keeps only the first <size> of this body. The full body was forwarded. Not an error. The log captures up to 2 MB of each body; proxying is not limited. None.
Binary body; the log keeps its first <size>. It is not shown. / Binary body of <size>. It is not shown, but it is replayed as captured. Not an error. Binary bodies are not rendered. None.

Replay and Edit & Replay

Message Cause Fix
Replay is off because this watch has no replay target. Start hopwire watch with --replay-target <url>. hopwire watch runs without a target. The status bar says none: start hopwire watch with --replay-target <url>. Restart: hopwire watch <log-key> --replay-target http://127.0.0.1:3000.
The service "<name>" is not part of this tunnel, so there is nothing to replay to. The exchange was logged by an earlier run under another service name (--name, or a service since removed from hopwire.yaml). Start the tunnel with that service name again.
There is no replay target for this exchange The same two cases, answered by the API (409). As above.
The stored body was truncated. Use Edit & Replay to supply the body. The request body was above 2 MB, so the log does not hold all of it and Replay cannot send it as it was. Use Edit & Replay and paste the body.
The stored body was truncated; supply a body with Edit & Replay to send this request The same, answered by the API (422). Same.
The stored body is binary and was truncated, so this request cannot be replayed. A binary body above 2 MB: it cannot be sent as stored and cannot be typed. Send the request again from its source.
A WebSocket handshake cannot be replayed: the messages of the connection are not recorded. The exchange is a 101. Open a new WebSocket from your client.
Enter a method such as GET or POST. The method field is empty or not a valid method. Correct it.
The path must start with / and must not contain spaces. Bad path in the form. Start with /; encode spaces as %20.
"<name>" is not a valid header name. A header name with spaces or other characters a name cannot have. Correct or remove the row.
The value of <name> must be a single line. A line break in a header value. Remove it.
The method is not one that can be replayed CONNECT, or not a method (400). Choose another method.
A header has a name or value that cannot be sent A header the HTTP client refuses (400). Correct the row.
No exchange with this id is in the log The exchange is not in the log this tunnel has open (404), for example after a restart with another data directory. Reload the page.
The replay was sent but could not be written to the traffic log The local service got the request, but the result could not be stored (500). Check the disk and the data directory.
The replay could not be sent. The replay failed without an answer the page could read. Check that the tunnel runs, then try again.
The inspector is not connected to the tunnel. The status has not loaded, so the page does not know where a replay would go. Reload the page.

A replay that reaches a stopped service is not an inspector error: it is logged as a 502 with Hopwire: the local service did not answer (ECONNREFUSED).

The inspector API

If you call the API yourself, errors are JSON: { "error": "<code>", "message": "<sentence>" }.

Status error message Cause
403 forbidden_key Open the inspector at the address hopwire printed: it carries the access key of this run The path does not start with the access key of this run. Open the URL of the Inspector line of the current start output.
403 forbidden_host The inspector only answers on its loopback address The Host header is not 127.0.0.1:<port> or localhost:<port>, for example behind a proxy or under another host name. Open the URL of the Inspector line.
403 forbidden_origin The inspector does not accept requests from other sites A POST with an Origin of another site, or one the browser marks Sec-Fetch-Site: cross-site or same-site.
404 not_found The inspector API has no such route Routes are /<key>/api/status, /<key>/api/exchanges, /<key>/api/stream and /<key>/api/replay/<id>.
404 not_found No such file No such file of the UI.
405 method_not_allowed Only GET is allowed here / Only POST is allowed here Wrong method. The Allow header names the right one.
400 invalid_request origin must be own or remote Bad origin parameter of /api/exchanges.
400 invalid_request <name> must be a whole number between <min> and <max> Bad limit (at most 500) or before.
400 invalid_request The path is not valid A URL path that cannot be decoded.
400 invalid_json The replay request is not valid JSON The body of POST /api/replay/<id> does not parse.
400 invalid_request The replay request must be a JSON object A list or a plain value.
400 invalid_request Unknown replay field <name> Fields are method, path, headers and bodyBase64.
400 invalid_request Replay field method must be a non-empty string
400 invalid_request Replay field path must be a string that starts with /
400 invalid_request Replay field headers must be a list of [name, value] pairs
400 invalid_request Replay field bodyBase64 must be Base64
413 request_too_large The replay request is too large More than 16 MiB.
404 unknown_exchange No exchange with this id is in the log See above.
409 no_replay_target There is no replay target for this exchange See above.
422 body_truncated The stored body was truncated; supply a body with Edit & Replay to send this request Send bodyBase64 with the request.
422 websocket_handshake A WebSocket handshake cannot be replayed: the messages of the connection are not recorded See above.
500 log_failed The replay was sent but could not be written to the traffic log See above.
500 internal_error The inspector could not answer the request An unexpected failure. Report it.
503 ui_not_built The inspector UI is not built; run "npm run build:hopwire". The API under /api works without it You run the CLI from a source checkout without the built UI. Run the command in the repository root, or start with --no-inspect.

Not an error, but asked often

  • The key printed by hopwire id does not work with hopwire watch. watch takes the log key (the Traffic log line), connect takes the peer key (the Peer key line).
  • Old requests show up after a restart. The traffic log belongs to the data directory and is kept across runs. With --share the whole log is shared, earlier runs included; the Notice line says so.
  • Anyone can connect to my shared tunnel. Without --allow or p2p.allow, anyone with the log key can read the log and anyone with the peer key can reach the service. The peer key is not a secret. Restrict both with --allow <pubkey>.
  • The public URL changed. A logged-in tunnel without --subdomain or subdomain: is served under the fixed t- URL of its organisation, the same on every start. It differs when the API token acts in another organisation, or when the tunnel runs with HOPWIRE_DEV_TOKEN on a local edge, which makes up a new random t- name per start.
  • Nothing shows up in the inspector. Send requests to the entry point (Forwarding line, default http://127.0.0.1:4041), not to the service itself. Only what passes through Hopwire is recorded.