# `call.production_refused`

A query or action was run with `jadpo call` against a database that isn't on this machine, which may be production.

Area 14, [Tools](/docs/tooling.md); not declinable; the next step is usually the human's.

## Why Jadpo refuses it

`jadpo call` runs a query or action as a caller you name, and an action may write. It is for trying things on your machine, so it reaches only a database on this machine, through a Unix socket, `localhost`, `127.0.0.1` or `::1`, and refuses any other before it runs anything, since one elsewhere may hold real people's data. `--rollback` doesn't change this, and no flag skips it.

Jadpo won't decide that a database elsewhere is safe to run against. Only you know whether it is a server you can throw away.

## What it looks like

A project whose action `add_note` writes a note:




```jadpo
use notes/entities { Note }
use notes/types { NoteBody }

/// Writes a note down.
action add_note(body: NoteBody) -> Note {
    return Note.create {
        set: {
            body: body
        }
    }
}
```

`--url` names a database on another server, as it might after copying a production address:

```sh
jadpo call add_note --input '{"body":"Buy milk"}' --url postgresql://app@db.example.com/notes
```

```text
error: The database `main` at db.example.com isn't on this machine
  reason: `jadpo call` runs a query or action on your machine only, so it reaches only a database on this machine: a Unix socket, `localhost`, `127.0.0.1` or `::1`. One anywhere else may be production. Nothing was run.
  next: Give the connection's setting a database on this machine with `jadpo config set`, or start `jadpo dev`, which starts one (human)
  rule: call.production_refused
  help: https://jadpo.dev/docs/errors/call.production_refused
```

`(human)` at the end of the `next:` line tells your coding agent to stop and ask you which fix you want, because the choice is yours to make: it decides which database the call reaches.

The address is shown by its host, never with a password, and an address the connection's setting gives is refused the same way.

## How to fix it

**If the call is for the database `jadpo dev` starts**, leave out `--url` and run it while `jadpo dev` is running in another terminal:

```sh
jadpo call add_note --input '{"body":"Buy milk"}'
```

The call finds the database `jadpo dev` started and writes the note there.

**If you keep a development database of your own**, name it:

```sh
jadpo call add_note --input '{"body":"Buy milk"}' --url postgresql://localhost/notes_dev
```

The call runs against that database, which is on this machine, and writes the note there.

## Related

- [Writes, on your machine only](/docs/running-a-query-or-action-jadpo-call.md#writes-on-your-machine-only)
- [`jadpo call`](/docs/commands-for-the-database-settings-and-translations.md#jadpo-call)
- [`seed.production_refused`](/docs/errors/seed.production_refused.md)
