Skip to content
HomeGitHub

Errors

Every error, warning and note Nearhost shows has a code, such as port.needs-permission. A code names one problem wherever it shows up, and it never changes once released, so you can search for it here or match on it in a script. Each entry below says what the code means. Where the fix is always the same, it gives the fix too; otherwise the message itself says what to do, as it names the path, port or server involved.

Where codes show up:

  • nearhost <command> --verbose prints the code under the title of an error, a warning or a note. See Errors, warnings and notes.
  • The core log has it in brackets, as in error [port.needs-permission] HTTPS port 443 needs permission to bind. See The core’s log.
  • nearhost doctor --verbose prints a code: line under each row that did not pass, and nearhost doctor --json gives each check and finding a code.
  • The APIs answer an error with its code, and a type that links to its entry on this page. See Agent API.

An entry is an error, a warning or a note, as Nearhost labels it. The status is the HTTP status the APIs answer with when the code is the error of a request; an entry without one is never an API error.

cli.usage

Error · status 400

A command was given arguments or flags it does not take.

crash

Error · status 500

Nearhost stopped unexpectedly; the details are in a crash file.

interrupted

Error · status 500

The command was interrupted before it finished.

unexpected

Error · status 500

Something failed that Nearhost has no explanation for; the message holds the error as it came.

See Port 443 or 80 already in use.

port.in-use

Error · status 409

Another program is already listening on a port Nearhost needs.

port.needs-permission

Error · status 403

Nearhost may not listen on a port below 1024, such as 443 or 80, without permission.

See Run Nearhost in the background.

core.already-running

Error · status 409

Nearhost is already running for this config.

core.api-mismatch

Error · status 409

The running Nearhost is a different version that this copy cannot talk to.

core.docker-missing

Note

docker is not on the PATH of Nearhost in the background; only Docker projects need it.

core.docker-unreachable

Warning

Docker does not answer Nearhost in the background.

core.in-terminal

Note

Nearhost is already running in a terminal, so nearhost -d leaves it there rather than start another in the background.

core.log-unavailable

Warning

The core could not send its standard error to its log, so a crash may not be logged.

core.lost

Error · status 503

The connection to the running Nearhost was lost.

core.no-desktop

Warning

Nearhost in the background runs outside the desktop session, so it cannot open links.

core.no-enabled-projects

Error · status 409

Every project in the config is disabled, and none was named to start.

core.no-projects

Error · status 404

The config has no projects, so there is nothing to start.

core.no-reload

Note

The running Nearhost serves the projects it was started with and does not reload the config.

core.not-running

Error · status 503

Nearhost is not running.

Start it in the background:

Terminal window
nearhost -d

Or open its interface:

Terminal window
nearhost

core.nothing-to-serve

Error · status 409

nearhost up found no project it can serve, and none still starting, so it stopped.

core.other-config

Error · status 409

The running Nearhost uses a different config file.

core.other-version

Warning

The running Nearhost is another release than this copy.

core.outdated

Note

The running Nearhost is an older release than this copy, and runs it once restarted.

core.run-dir-failed

Error · status 500

Nearhost could not create its run directory, which holds its sockets and its lock.

core.session-unchecked

Note

Nearhost in the background could not tell whether it runs in the sign-in session, so it may not open links.

core.ssh-agent-unreachable

Warning

The SSH agent Nearhost in the background was given does not answer.

core.ssh-agent-unset

Note

SSH_AUTH_SOCK is not set for Nearhost in the background, so ssh uses the agent in the SSH config, if any.

core.still-starting

Error · status 503

Nearhost is still starting in the background.

core.stop-timeout

Error · status 504

Nearhost was asked to stop and had not stopped in time.

core.stopped-while-starting

Error · status 503

Nearhost stopped while it was starting in the background.

core.unknown-project

Error · status 404

No project in the config has the name given.

See Start it at login.

service.as-root

Error · status 403

The service must be installed as the user who runs it, not as root.

service.cannot-bind

Error · status 409

The service cannot run this copy of nearhost, as it lacks permission to use ports 443 and 80.

service.copy

Error · status 409

This copy of nearhost cannot be run by a service later, such as a one-run copy.

service.log-folder-missing

Warning

The folder of the service’s log is missing, so the service cannot start again.

service.manager-failed

Error · status 502

The system’s service manager refused to install, start or remove the Nearhost service.

service.no-user-manager

Error · status 503

There is no user service manager to run the Nearhost service.

service.node-version

Note

The service runs nearhost from a Node version’s folder, so changing the default Node version needs a new install.

service.not-installed

Note

The Nearhost service is not installed, so Nearhost does not start at login.

To start Nearhost at login, install the service:

Terminal window
nearhost service install

service.not-running

Warning

The Nearhost service is installed but not running.

Start it:

Terminal window
nearhost -d

service.not-signed-in

Note

You are not signed in to Windows, so the service could not start Nearhost, and it was started directly.

service.other-copy

Warning

The installed service runs another copy of nearhost than this one.

service.own-settings

Note

A service is installed, but it runs with its own settings, so Nearhost was started directly with the ones given.

service.restarting

Warning

The service is starting Nearhost again after it stopped.

service.ssh-agent-changes

Warning

SSH_AUTH_SOCK points at an agent socket that changes at each login, so the service cannot use it.

service.ssh-agent-unset

Note

SSH_AUTH_SOCK is not set, so the service uses the agent the login session provides.

service.start-failed

Warning

Starting Nearhost through its service failed, so it was started directly.

service.takes-over

Note

Nearhost runs, started another way, and the installed service takes over at the next login.

service.unreadable

Warning

The installed service’s definition cannot be read, as one edited by hand, so it is removed as it is.

service.unsupported

Error · status 501

The Nearhost service is not supported on this system.

See config.yaml.

config.bad-alias

Error · status 400

A project’s main name is not a valid domain, so nearhost up does not start it.

config.invalid

Error · status 400

The config file has a value Nearhost cannot use.

config.loopback-own-port

Error · status 409

A project’s loopback route is on a port Nearhost itself listens on, so it is not forwarded.

config.missing

Warning

The config file named with –config does not exist yet.

config.no-home

Error · status 500

Nearhost cannot tell where its files are, as HOME (or XDG_CONFIG_HOME) is not set.

config.pattern-conflict

Warning

A project serves a host under another project’s pattern, and gets its requests.

config.unknown-keys

Error · status 400

The config file has keys Nearhost does not know, so saving it would lose them.

See The hosts file.

hosts.core-not-told

Warning

The hosts file is updated, but the running Nearhost could not be told.

hosts.dns-unchecked

Note

Nearhost could not ask DNS directly, so it did not check whether real-domain names resolve elsewhere.

hosts.helper-refused

Error · status 400

The elevated hosts helper refused its input or report file.

hosts.needs-update

Warning · status 409

The hosts file does not yet list the names Nearhost serves.

hosts.overlap

Warning

Two host patterns overlap; a name both match goes to the more specific.

hosts.public

Warning

A name the project is served at is a real name, so the real site is out of reach while the project is enabled.

hosts.read-only

Error · status 403

The hosts file is read-only, so Nearhost cannot update it.

hosts.unreadable

Error · status 500

The hosts file cannot be read.

hosts.unresolved

Error · status 409

A name the project is served at does not resolve to this machine and is not in the hosts file.

hosts.unresolved-pattern

Error · status 409

A pattern the project is served at does not resolve to this machine.

See The local CA.

ca.browsers-not-trusted

Warning

The browser trust stores (NSS) do not trust the local CA.

ca.firefox-roots-off

Warning

Firefox is set not to read Windows’ trusted roots, where the local CA is trusted.

ca.move-failed

Warning

Nearhost could not move its local CA to the data directory, or could not delete the old copy.

ca.not-created

Error · status 409

The local CA has not been created yet.

Create the local CA and trust it:

Terminal window
nearhost trust

ca.not-private

Warning

Nearhost could not make the folder that holds its local CA private to the user.

ca.not-trusted

Error · status 409

The system trust store does not trust the local CA.

Trust the local CA:

Terminal window
nearhost trust

ca.old-copy

Warning

An old folder still holds a copy of the local CA’s private key.

ca.unreadable

Error · status 500

The local CA’s certificate cannot be read.

trust.no-sudo

Error · status 500

sudo, which trusting or untrusting the local CA needs, is not installed.

trust.not-removed

Error · status 409

The local CA was not removed from a trust store, and running untrust again can finish it.

trust.remains

Error · status 409

Something Nearhost cannot change still trusts the local CA.

See SSH transport.

forward.failed

Error · status 500

A port could not be forwarded to or from a server.

forward.reconnecting

Warning

A forwarded port is being connected again, and serves nothing until it is.

passthrough.closed

Warning

Nearhost closed a port it had opened for a coding agent, as the server or the port went away.

ssh.agent-missing

Note

The OpenSSH Authentication Agent is not installed on Windows.

ssh.agent-stopped

Note

The OpenSSH Authentication Agent service on Windows is not running.

ssh.auth-failed

Error · status 403

SSH refused to log in to a server.

ssh.config-conflict

Error · status 409

The user’s SSH configuration for a server sets options Nearhost cannot keep out of its own connections.

ssh.not-found

Error · status 503

ssh cannot be run, from this shell’s PATH or that of Nearhost in the background, so Nearhost cannot reach servers.

ssh.other-vendor

Warning

The ssh Nearhost runs on Windows is not Microsoft’s OpenSSH.

ssh.socket-path-too-long

Error · status 400

The path of an SSH socket is longer than the system allows.

ssh.stale-master

Warning

An SSH connection left by an earlier run could not be ended.

ssh.too-old

Warning

The ssh on PATH is older than the one Nearhost needs.

ssh.unreachable

Error · status 503

A server cannot be reached over SSH.

ssh.version-unknown

Note

Nearhost could not read the version of the ssh on PATH.

See Callbacks from Docker containers.

docker.ca

Warning

A container calls a name Nearhost serves and does not trust Nearhost’s root certificate.

docker.clients

Warning

A container calls a name Nearhost serves, and Nearhost does not accept requests from Docker’s network.

docker.compose-depth

Warning

The Compose file nests or repeats merges too much to check.

docker.compose-file

Note

COMPOSE_FILE is set, and Nearhost checks only the Compose files Compose reads by default.

docker.compose-parse

Warning

The Compose file is not valid YAML, so its services were not checked.

docker.host-gateway

Warning

A container calls a name that resolves to itself or to the internet, not to Nearhost.

docker.networks-failed

Warning

Nearhost could not start accepting requests from new Docker networks.

docker.unreachable

Warning

Docker did not answer, so requests from containers are not accepted yet.

See nearhost update.

update.available

Note

A newer release of Nearhost is available.

Update it:

Terminal window
nearhost update

update.check-failed

Error · status 503

Nearhost could not find out whether a newer release exists.

update.failed

Error · status 500

The update ran, but the installed nearhost is not the new release.

update.next-homebrew

Error · status 409

Betas are not published to Homebrew.

interface.address-too-long

Warning

An address in the log is too long to show, so a click does not open it.

interface.answer-not-saved

Warning

The quit box’s answer could not be saved, so it asks again next time.

interface.change-ignored

Warning

A change to the config file could not be applied and was ignored.

interface.copy-failed

Warning

The system’s clipboard tool failed on a copy; the terminal may still have copied it.

interface.flags-ignored

Note

Serve flags given to the interface do nothing to the Nearhost already running, which keeps its settings.

interface.log-missed

Note

The interface fell behind the running Nearhost, so some log lines were missed.

interface.no-terminal

Error · status 400

The interface needs a terminal, and there is none.

Run it in the background:

Terminal window
nearhost -d

Or serve without the interface:

Terminal window
nearhost up

interface.nothing-to-copy

Warning

What the interface was asked to copy has nothing it can copy.

interface.open-failed

Warning

The interface could not open a link in the browser.

interface.password-cancelled

Error · status 403

The password was cancelled, so what needed it was not done.

interface.prompt-declined

Error · status 403

The Windows prompt was declined, so what needed it was not done.

See Add a project.

add.alias-taken

Error · status 409

The name the project asks to be served at is already another project’s.

add.bad-alias

Error · status 400

The domain the project would be served at is not one Nearhost can serve, so nothing was saved.

add.bad-config

Error · status 400

The config file cannot be read, so nothing is added to it.

add.bad-name

Error · status 400

The project’s name is not one Nearhost can use.

add.host-taken

Note

A name the project would be served at is already another project’s, so it is left out.

add.lone-port

Warning

Discovery found one port only, so nearhost add made it the web route.

add.name-taken

Error · status 409

Another project already has the name the project would be added under.

add.needs-approval

Error · status 409

The project asks for things that need approval, and there is nobody to ask.

add.no-directory

Error · status 404

There is no directory at the path given to nearhost add.

add.no-web-port

Error · status 400

nearhost add could not tell which port serves the project, so nothing was saved.

add.relative-path

Error · status 400

A project on a server was given a relative path, which Nearhost cannot find there.

add.server-changed

Error · status 409

The server was added meanwhile and is reached another way, so nothing was saved.

add.unknown-server

Error · status 404

The server named is not in the config.

discovery.incomplete

Warning

Something discovery reads, such as a preset or a project file, could not be read, so it went on without it.

export.changed

Error · status 409

The project changed while it was exported, so the file written is not approved.

export.exists

Error · status 409

The project already has a .nearhostrc, and export does not replace one unasked.

export.no-project

Error · status 404

No Nearhost project contains the folder, or none has the name given.

export.replaced-pending

Note

The .nearhostrc change that waited for approval was replaced with what is served now.

See Presets and registries.

preset.local-file

Error · status 409

The preset is a local file, so there is no registry to update it from.

preset.not-enabled

Error · status 404

The preset named is not enabled.

preset.not-updated

Warning

A preset could not be updated from its registry.

preset.registry-in-use

Error · status 409

Presets from the registry are enabled, so it cannot be removed.

preset.registry-not-trusted

Error · status 502

A registry’s index could not be fetched or checked, so it was not trusted and nothing was saved.

preset.registry-unknown

Error · status 404

No registry is trusted under the name given.

preset.registry-unreadable

Warning

A trusted registry of presets cannot be read, so its presets are left out.

preset.unknown

Error · status 404

No preset or registry has the name given.

preset.updates-failed

Error · status 502

Some of the presets asked for could not be updated from their registries.

presets.note

Note

A note from the preset that matched the project.

See Project checks.

doctor.checks-failed

Error · status 409

One or more of nearhost doctor’s checks failed.

doctor.not-checked

Note

nearhost doctor could not run a check, and says what it did not check.

nearhostrc.gone

Warning

The project’s .nearhostrc is gone or cannot be read, and Nearhost still serves what it last said.

nearhostrc.invalid

Error · status 400

The project’s .nearhostrc cannot be read.

nearhostrc.not-applied

Warning

The project’s .nearhostrc has changed since Nearhost last read it.

nearhostrc.pending

Warning

The project’s .nearhostrc has changes that wait for approval.

nearhostrc.unset-variable

Error · status 400

The project’s .nearhostrc uses a variable that is not set.

nearhostrc.version

Error · status 409

The project’s .nearhostrc needs a newer Nearhost.

projects.none

Note

There are no projects to list or serve yet.

projects.unchecked

Note

Nearhost could not run the project’s checks, for example because its server is not reachable.

routes.not-listening

Warning

Nothing listens on a port Nearhost serves for the project.

routes.stale-port

Note

A web route’s port matches nothing in the project’s files any more.

routes.unserved-host

Warning

The project’s settings name a host that Nearhost does not serve.

routes.unserved-port

Warning

A port in the project’s files looks like a web server, but the project has no route for it.

advice.<id>

Warning

Advice from the preset that matched the project.

<id> is the advisory’s id, so advice.vite-default-port is the vite-default-port advisory. See Advisories for each one and its fix.

See How agents reach Nearhost.

agent.bad-path

Error · status 400

A path in an agent’s request is not one Nearhost takes, such as a relative or network path.

agent.bad-request

Error · status 400

An agent’s request, or a value in it, is not what the call takes.

agent.closed-while-opening

Error · status 409

The agent’s session closed while its passthrough opened, so the passthrough was closed again.

agent.doctor-busy

Error · status 429

A doctor run for the agent’s server is already going, or started moments ago.

agent.doctor-failed

Error · status 502

The doctor could not check what an agent asked about.

agent.document-failed

Error · status 502

Nearhost could not read or show the document an agent asked to show.

agent.document-not-there

Error · status 404

The document an agent asked to show is not there.

agent.grants-failed

Error · status 500

Nearhost could not read the grants that let an agent’s requests open without asking.

agent.local-passthrough

Error · status 400

A passthrough was asked for on the laptop’s own socket, and passthroughs forward a server’s port.

agent.nearhostrc-unread

Error · status 422

A project’s .nearhostrc could not be taken into account when an agent asked to reload it.

agent.no-page

Error · status 409

Nearhost’s page is not served, so it cannot show an agent’s document.

agent.no-project

Error · status 404

No project in Nearhost holds the path the agent asked about.

agent.no-reviewer

Error · status 409

An agent’s request needs the user’s answer, and Nearhost has no page or window open to ask in.

agent.no-such-call

Error · status 404

The agent API has no call at the path asked for, or this Nearhost does not have that call.

agent.no-token

Error · status 401

A request to the agent API’s loopback port came without its token, as from an older copy of the skill.

agent.not-a-directory

Error · status 404

The directory an agent asked the doctor about is not there.

agent.not-a-document

Error · status 400

What an agent asked to show is not a document Nearhost can show.

agent.not-connected

Error · status 409

Nearhost is not connected to the agent’s server.

agent.passthrough-failed

Error · status 502

A passthrough’s forward could not be opened or closed.

agent.port-held

Error · status 409

Another agent or session has the port passed through, or waiting for approval.

agent.refused

Error · status 429

The user said No to a request of the same kind from the agent’s machine moments ago, so this one is refused for now.

agent.reload-failed

Error · status 502

Nearhost could not read a project’s .nearhostrc again for an agent.

agent.request-gone

Error · status 404

The proposal, passthrough or document request an agent asked about is not known; it may have ended long ago.

agent.token-revoked

Error · status 401

The token an agent sent was revoked or never existed.

agent.too-many-passthroughs

Error · status 429

The agent’s server has as many passthroughs open as it may.

agent.too-many-waiting

Error · status 429

The agent’s machine has as many requests waiting for the user as it may.

agents.allow-not-saved

Error · status 500

A request was answered, but its Always allow could not be saved, so the agent is asked again next time.

agents.approval-waiting

Note

A coding agent asks for something that waits for approval in the interface.

agents.grants-off

Error · status 503

Grants cannot be read or changed, as the grants file cannot be read or Nearhost does not serve coding agents in this run.

agents.grants-pruned

Note

Grants of projects that are gone were removed.

agents.not-ready

Error · status 503

Coding agents on a server cannot reach Nearhost yet.

agents.path-too-long

Error · status 400

The socket coding agents use would have a path longer than the server allows.

agents.refused

Error · status 403

The server’s SSH daemon refused to forward the socket coding agents use.

agents.unavailable

Warning

Coding agents on a server cannot reach Nearhost.

See Documents.

documents.changing

Error · status 503

The document’s folder kept changing while Nearhost checked it.

documents.method-not-allowed

Error · status 405

The document server was asked with a method it does not take.

documents.missing

Error · status 404

The document asked for is not there any more.

documents.not-connected

Error · status 503

Nearhost is not connected to the server that holds the document.

documents.not-found

Error · status 404

The document server has nothing at the path asked for.

documents.open-failed

Warning

A document could not be opened in the browser; its address still works.

documents.unreadable

Error · status 502

The document could not be read.

See Nearhost’s page.

page.answer-failed

Error · status 502

The core could not take the answer given on the page.

page.answer-not-offered

Error · status 400

The answer sent is not one the request offers.

page.change-answer-invalid

Error · status 400

The answer sent for a .nearhostrc change is not approve or decline for the change shown.

page.change-changed

Error · status 409

The .nearhostrc change changed again, so the answer was not for the change now waiting.

page.not-opened

Error · status 502

The answer ended the request, as what it asked for could not be opened.

page.proposal-decline-only

Error · status 400

A proposal can only be declined on the page; reviewing it needs Nearhost on this machine.

page.render-failed

Error · status 500

Nearhost’s page could not be drawn.

page.request-ended

Warning · status 409

The request on the page has been answered or has ended.

proxy.app-not-answering

Error · status 502

Nothing answered on the port a project’s app listens on.

proxy.forbidden

Error · status 403

A request to Nearhost’s page was refused.

proxy.forward-reconnecting

Error · status 502

The forward to a project’s server is down while Nearhost reconnects it.

proxy.locked

Error · status 403

Nearhost’s page must be opened from this machine first, to get its cookie.

proxy.method-not-allowed

Error · status 405

A path of Nearhost’s page was asked with a method it does not take.

proxy.not-found

Error · status 404

Nearhost’s page at a project’s domain has nothing at the path asked for.

devices.unknown

Error · status 404

No paired device has the name asked for.

network.apply-failed

Error · status 500

Nearhost could not change how it serves to other devices on the network after the config changed.

network.cert

Error · status 503

The certificate for Nearhost’s page on the network is missing or not the one the config asks for.

network.devices-unavailable

Warning

Nearhost could not open its list of paired devices, so no other device can pair or sign in.

network.dns

Warning

The name of Nearhost’s page on the network does not point at this machine.

network.firewall

Error · status 503

The firewall does not let other devices reach Nearhost.

network.firewall-refused

Error · status 400

The elevated firewall helper refused a program other than the one running, or its input or report file.

network.no-page

Error · status 503

Networked mode needs Nearhost’s page, where devices pair, and the page is not served.

network.no-token

Error · status 503

Networked mode gets its certificate with a DNS token, and none is set.

network.not-listening

Error · status 503

Networked mode is on, but Nearhost does not serve to the network yet, so no device could reach it.

network.off

Error · status 409

Something was asked that needs networked mode, and the config does not turn it on.

pair.bad-target

Error · status 400

A device asked to be signed in to an address outside the network domain.

pair.code-invalid

Error · status 400

The pairing code typed on a device is wrong, has been used or has expired.

Get a new code on the machine Nearhost runs on:

Terminal window
nearhost pair

Error · status 403

The link that signs a paired device in to a site has been used or has expired.

pair.needed

Error · status 401

A site on the network domain was asked for by a device that is not paired.

pair.too-many-tries

Error · status 429

A device made too many wrong attempts to pair or sign in, so it must wait.

pair.unavailable

Error · status 503

A site on the network domain needs a paired device, and Nearhost’s page, where devices pair, is not served.

control.bad-request

Error · status 400

A request to the control API is not what the route takes.

control.method-not-allowed

Error · status 405

A route of the control API was asked with a method it does not take.

control.no-route

Error · status 404

The control API has no route at the path asked for; the running Nearhost may be an older release.

control.not-found

Error · status 404

The running Nearhost does not have what was asked for, such as a request it no longer keeps.

control.request-ended

Error · status 409

The request to answer has ended: the agent gave up on it, it expired, or someone answered it first.

control.unimplemented

Error · status 501

The running Nearhost cannot do what was asked yet.