Error codes
Every message the CLI prints starts with what it was trying to do, like Couldn't create slice: … or Couldn't deploy atomic function: …, and ends with the reason. This page is the reasons: what produces each one, and what to do about it.
The CLI does not invent an error surface for the platform. It renders the status the platform returned plus whatever the platform said about it, so if you see a sentence that is not here, it came from the platform verbatim and means what it says. The messages about your Driftfile are the CLI's own, and they are on this page.
A message built from an HTTP status also carries a stable code on its own line beneath it, like DRIFT-1006 · drift doctor explain DRIFT-1006. drift doctor explain <code> expands any of them into the full meaning and the remedy, and drift doctor codes lists every one this binary knows. Both work offline and without a session, which is exactly when you are holding one. A code is minted once and never reused or renumbered, so one pasted from a chat log a year old still resolves to the same failure.
Before the request lands
These happen on your machine or on the wire. No slice was touched.
- What you see
couldn't reach the Drift API (timed out). Is the platform up?- What it means
- The request left and nothing came back inside the timeout.
- What to do
- Check your own connection first. If that is fine, the platform is likely mid-restart, so try again in a minute. A deploy that timed out may still have landed:
drift planshows what the slice holds before you apply again.
- What you see
couldn't reach the Drift API. Is the platform up?followed by the underlying error in parentheses- What it means
- DNS did not resolve, or the connection was refused outright.
- What to do
- Nothing reached Drift at all. A proxy or a firewall between you and
api.ondrift.euis the usual cause.
- What you see
Drift is temporarily unavailable — most likely brief maintenance. Your login is still valid; nothing to do but try again in a few minutes.- What it means
- The platform answered with a 502, 503 or 504. It is up but not serving.
- What to do
- Wait. Do not log out. Re-authenticating needs the same platform, so logging out here turns a short wait into a lockout.
- What you see
the platform is having trouble. That's on us; give it a moment and try again.- What it means
- A plain 500: the platform hit a fault handling the request. Not maintenance, and not caused by anything you did.
- What to do
- Retry once. If it keeps happening, check
status.ondrift.euand report it. This one is a bug, not a busy period.
- What you see
this machine has no copy of the Driftfile format yet, so it cannot be validated- What it means
drift file lint,drift plananddrift applyhave never fetched the schema, so they have nothing to validate against.drift doctor explain 1008describes it.- What to do
- Run any online command once, such as
drift account loginordrift slice list, and it caches permanently at~/.drift/driftfile.schema.json.
The registry also names three failures that are not HTTP statuses: DRIFT-1009 (the Driftfile is not valid; drift file lint reports every problem at once), DRIFT-1010 (a compiled function booked less memory than its language runtime needs; the fix is drift size) and DRIFT-1011 (you are not logged in, so the CLI has no credential to send, which differs from an expired session). drift doctor explain expands each.
"Unavailable" never names a component.
Your account and session
- Code
DRIFT-1001- What you see
your session expired. Run 'drift account login' to re-authenticate.- What it means
- Your token is no longer valid.
- What to do
drift account login.
- Code
- none
- What you see
invalid username or password.- What it means
- Only on
drift account loginitself. - What to do
- Check the credentials. Ten attempts a minute from one address are allowed; past that, the answer is
DRIFT-1014below.
- Code
DRIFT-1002- What you see
you don't have permission to do that.- What it means
- You are authenticated, and this is not yours.
- What to do
- Usually a slice belonging to another account.
drift slice listshows what you can reach.
- Code
DRIFT-1013- What you see
that conflicts with existing state.- What it means
- You asked for something that collides with what already exists.
- What to do
- The message names the conflicting thing when the platform supplied one, most often a second free slice (one Hacker grant per account; a second is allowed, but priced) or a name already taken.
drift slice listshows what you have.
- Code
DRIFT-1014- What you see
- the platform's reason, then
This clears by itself; try again in 60 seconds. - What it means
- A rate limit, not a quota: too many logins or signups from one address in a minute, too many control-plane calls from one account in a minute, a restart inside its cooldown, or too many transfer offers in a day.
- What to do
- Wait for the time it names, then run it again. Nothing needs freeing or buying, and resizing does not lift it. Retrying sooner is refused again.
- Code
DRIFT-1004- What you see
you're at your plan limit. Run 'drift slice resize' to add capacity.- What it means
- Some resource exceeds what the slice booked.
- What to do
- The message names the resource and, when the platform supplied them, how much of it is used. Raise that figure in the Driftfile (a booking, a size or a
limitsentry) anddrift apply, or for a slice without a file,drift slice resize.
Deploying a project
Most of these are found offline, before anything is built or uploaded. drift file lint reaches all of them without an account, and drift plan and drift apply run the same checks first.
A Driftfile error names the file and the position, Driftfile:12:5: <summary>: <detail>, and a file's errors are all printed at once, top to bottom, so one pass fixes them all. A failure to find the file at all reads no Driftfile in the current directory, followed by the path it looked in and a line naming drift file new, the command that writes one. Long messages are quoted here by their first sentence; the rest of each message explains the same thing at more length.
- What it means
- A
functionorworkerblock has nohandler. - What to do
- Add
handler = "GetItems". See Write a function.
- What it means
- Every function and worker states its own booking: it is the slot's pool and what it is billed at, so it has no default.
- What to do
- Add
memory = "32MiB". Once the function has served traffic,drift sizerewrites it from what the slice measured.
- What it means
- Sizes are a whole number of KiB, MiB or GiB.
64MBis refused rather than guessed at. - What to do
- Write
"64MiB".
- What it means
- A booking outside what a slot may hold.
- What to do
- Book between 8MiB and 256MiB (16MiB or more in a compiled language).
- What it means
- A compiled language (Go, Rust) carries a private runtime inside every invocation, and a Worker runs Go.
- What to do
- Raise the booking to
16MiBor more, or rundrift sizeagainst a deployed slice.
- What it means
- The handler is not in the backend's folder. The error lists the callables that are there.
- What to do
- Usually a spelling or case difference. The message says so explicitly when the only difference is case.
- What it means
- Two files in one backend declare the same handler. The generated entry point imports by name and cannot pick.
- What to do
- Rename one, or split them into separate backends.
- What it means
- Two
functionblocks have the same method and route. A booking key is unique across the whole slice, not per backend, so this collides wherever they live. - What to do
- Method is part of the identity, so
GET /itemsbesidePOST /itemsis fine; twoGET /itemsis not.
- What it means
- A backend has one dependency manifest and one runtime, so it cannot be two languages.
- What to do
- Move one language into its own folder under
atomic/and declare its functions in abackendblock of that name.
- What it means
- The file declares functions in a directory that holds no code.
- What to do
- Check the backend's name and
diragainst where the handlers actually live.
- What it means
- A
dirpoints somewhere that is not on this machine. - What to do
- A schema cannot check paths; only your laptop can. Fix the path.
- What it means
- A value reads
env("MEM")and nothing sets it here. - What to do
- Set it in the terminal, with
--var MEM=..., or in a.envfile beside the Driftfile, as the message says.
- What it means
- A secret's
value, a function'sauth.api_keyand a site password are write-only. A literal would be a credential committed with the file, so it is refused, and so arevar.xandfile(). The message never prints the value. - What to do
- Write
env("NAME")and supply the value at apply time.
- What it means
- A
sliceorenvironmentblock still has abillingline. The shape decides: one inside the free slice can take one of your free slices, any other is priced. - What to do
- Delete the line.
drift plansays whether the slice would be free or priced, and why.
- What it means
- The same limit is set in two places.
- What to do
- Write it in one place.
- What it means
drift plan qa,drift apply qaor--env qanames an environment the file does not declare.- What to do
- Use one the message lists, or add an
environmentblock.
- What it means
- A
variablewith nodefaultthat the environment'svarsdoes not set. - What to do
- Give it a
default, or set it in the environment'svars.
- What it means
- A function is labelled with a method and route,
"POST /rpc", or withQUEUEand the queue it drains,"QUEUE orders". - What to do
- Fix the label.
- What it means
- A key the block does not take.
- What to do
drift file explain <block>lists what it does.
- What it means
- A second
sliceblock. - What to do
- Declare one slice per file, and use
environmentblocks for the others.
Applying has questions of its own. They are all asked, or refused, before anything is sent:
- What it means
- There is no terminal to ask the price, removal or data-loss questions, and none was answered.
- What to do
- Read the plan, then re-run with the flags listed.
- What it means
- The figure you approved is not the figure the platform quotes now.
- What to do
- Run
drift planagain and approve the new figure.
- What it means
- A
secret, anauthkey or a site password reads a variable nothing sets. The plan marks it!. - What to do
- Set it in the terminal, with
--var, or in a.envfile beside the Driftfile.
- What it means
- The new slice fits the free slice, and every free slice you may hold is taken. Idle cooldown lowers what an idle free slice costs, but it does not free its slot.
- What to do
- Empty one first (delete it, or give it a shape that is priced), or make this slice a priced one with
--approve-price <cents>, asdrift planquotes it.
- What it means
- A new slice fits the free slice, you have a free slot, and there is no terminal to ask
You have 2 of 3 free slices — make this the 3rd? - What to do
- Re-run with
--use-free-slice, or with--approve-priceto make it a priced slice.
- What it means
- The file grew a free slice past what the free slice grants.
drift applydoes not move a slice off the free tier yet, so nothing was applied. - What to do
- Make the shape fit again, or move the slice with
drift slice resize.
- What it means
drift apply plan.jsonapplies exactly the plan it recorded, and refuses when anything moved. Nothing was applied.- What to do
- Run
drift plan --out plan.jsonagain.
- What it means
- The platform refused the resize because the answers you gave no longer match.
- What to do
- Run
drift planagain.
drift apply creates the slice and resizes it.
While your function runs
These reach the caller, not your terminal. Read them with drift atomic logs.
- What it means
- No function is registered at that method and path.
- What to do
- A function is identified by method and path, so
POST /api/itemsdoes not fall through to theGET /itemshandler. Check the label in your Driftfile.
- What it means
- The function has an
authblock (or a key set withdrift atomic auth set) and the request carried no valid key. - What to do
- See Authentication. Setting a key on a route protects it whatever the file says.
- What it means
- The slice lists the networks it accepts in
allowin itsedgeblock, and the caller is outside all of them. The response carriesX-Drift-Refused-By: edge.allow. - What to do
- Add the caller's range, or call from an admitted network. See The IP allowlist.
- What it means
- A Canvas path behind the site gate, and no valid username and password.
/api/and/trigger/are never asked for it. - What to do
- Sign in at the browser's prompt, or send the credential as HTTP Basic auth. A
503 site authentication is unavailablemeans the slice's Deed could not check it; retry.
- What it means
- The slice passed its requests per minute,
rate_limit, and the router shed the request with{"error":"rate limit exceeded"}. - What to do
- Raise the limit, or send less. A function whose memory pool has no room for another invocation is a different answer,
503withX-Drift-Reason: FUNCTION-MEMORY, never a 429: see Limits and alerts.
- What it means
- Your handler returned an error, panicked, or exceeded the slice's
timeout. - What to do
- An error or panic is caught and answered as 500 rather than crashing anything visibly. How far the damage is contained depends on the language: Go, Rust, Ruby and PHP each run a call in its own process, so a crash stays with that one invocation. Python and Node are different: one long-lived server per language holds every function written in it, so a crash severe enough to take that server down reaches every function sharing it, not only the one that failed.
- What it means
- The function was reached but produced no usable response, commonly a handler returning the wrong shape.
- What to do
- Return
(status, message, payload); Go adds a fourth headers value. See Write a function.
Secrets that are not there
A function receives only the secrets its own block names. If drift.Backbone.Secret.Get("X") comes back empty or errors:
- Check
secretsin that function's block. A secret the slice holds is still unreachable from a function that did not name it. - Check the file declares it with a
secret "X" { value = env("X") }block insidebackbone, and that the variable was set when you randrift apply. The plan marks a secret whose variable is missing with!. - Check the value exists, with
drift backbone secret list. A secret the slice holds and the file does not name is a removal indrift plan, deleted if you agree to it. - Read it through the SDK, not the environment.
DRIFT_SECRET_Xexists only on the per-invocation subprocess path; Python and Node functions served by the persistent language server get theirs in the request envelope and no environment variable is set.
Adding a name to secrets needs a redeploy. Changing a value does not, since the runner fetches on every call.
When none of this fits
drift file lint answers most questions without deploying anything or touching the network, and drift plan adds the live slice and still changes nothing. If the message carries a DRIFT- code, drift doctor explain may already answer it, also offline. Otherwise, if it is not on this page, it came from the platform unchanged. Quote it verbatim when reporting, because the wording identifies which check produced it.