call.unavailable
The database jadpo call runs against couldn't be reached or has migrations not yet applied, so nothing was run.
Area 14, Tools; not declinable; the next step is usually the human's.
Why Jadpo refuses it
A call reads and writes the database as the app does, so it needs one that answers and holds every migration the project has. jadpo call changes nothing it wasn't asked to, so it never applies a migration itself, as jadpo seed and jadpo dev do: it stops and says which.
What it looks like
A project whose action add_note writes a note:
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 this machine whose server isn't running:
jadpo call add_note --input '{"body":"Buy milk"}' --url postgresql://localhost:5499/notes error The database main can't be reached
- reason
- Connecting to it failed, so nothing was run.
- next
- Check the database is running, then run
jadpo callagain (human) - rule
- call.
unavailable - help
- https://jadpo.
dev/docs/errors/call. unavailable
(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, and whether its migrations are applied.
How to fix it
If the server isn't running, start it, or run the call while jadpo dev is running and leave out --url:
jadpo call add_note --input '{"body":"Buy milk"}'The call finds the database jadpo dev started, which has every migration applied, and writes the note there.
If migrations are waiting, apply them, then call again:
jadpo migrate apply --url postgresql://localhost/notes_devThe database then holds every migration, and the same call runs against it.
Related
Markdown for agents: /docs/errors/call.unavailable.md.Built from Jadpo's main branch at commit ee389ee.