setup_token_invalid
HTTP status: 403 · Code: setup_token_invalid
The first console sign up on an install needs its setup token, and none or the wrong one was given.
Why it happens
Section titled “Why it happens”The first console account on an install needs the setup token, and the request had none or the wrong one. The token is in the setup link the installer printed.
How to fix
Section titled “How to fix”Open the full setup link, including the part after #. On a local install it is http://localhost:7700/setup# followed by ORVANO_SETUP_TOKEN from the .env file in your install folder. Run the installer again to print the link once more.
Catch it in your code
Section titled “Catch it in your code”Every SDK throws one error type for a failed call. Match on its code, which is always setup_token_invalid for this error, never on the message.
import { ErrorCode, OrvanoError } from '@orvano/js'
try { // your Orvano call} catch (error) { if (error instanceof OrvanoError && error.code === ErrorCode.setupTokenInvalid) { // handle setup_token_invalid } else { throw error }}import 'package:orvano_flutter/orvano_flutter.dart'; // or orvano_dart on a server
try { // your Orvano call} on OrvanoException catch (error) { if (error.code != ErrorCode.setupTokenInvalid) rethrow; // handle setup_token_invalid}using Orvano;
try{ // your Orvano call}catch (OrvanoException error) when (error.Code == ErrorCode.SetupTokenInvalid){ // handle setup_token_invalid}The error also carries the HTTP status (403), a message, and a request ID. Quote the request ID when you report a problem: the server logs it with the failure. See Errors for how errors work in every SDK, or every error code.