search.reindex_failed
An entity's index couldn't be rebuilt in its engine, because nothing sets the engine's settings, the database or the engine can't be reached, or the engine refused a record.
Area 14, Tools; not declinable; the next step is usually the human's.
Why Jadpo refuses it
jadpo search reindex <Entity> sends each record's document to the
search engine through the app's own connection, with that connection's
address and credential, read as jadpo dev reads them. Without them,
the only thing it could send is a stand-in key to a guessed address, so
it sends nothing.
When the database can't be read, or the engine refuses a record or can't be reached, it stops there and says how many records it sent. Sending a record's document again changes nothing, so the reindex can always be run again from the start; it never empties the index.
Jadpo won't set a credential or pick a database for you: which engine and which database it reaches may be production's, and only you know which is right.
What it looks like
A shop whose product names are kept in an index at Acme Search, through the app's own package for it:
domains/shop/entities/product.jadpo:
use shop/types { ProductName }/// Something the shop sells, its name kept in Acme's index.entity Product { id: Uuid name: ProductName policy: { read: [Access.public] } search: { fields: [name] language: SearchLanguage.english store: products_index }}
Nothing sets the index's address or its key:
jadpo search reindex Product error products_index has nothing set for the engine
- reason
- A reindex sends
Product's records throughproducts_index, with its address and credential, and nothing setsSEARCH_HOSTandSEARCH_TOKEN. - next
- Set
SEARCH_HOSTandSEARCH_TOKENto the engine's, then run it again (human) - rule
- search.
reindex_ failed - help
- https://jadpo.
dev/docs/errors/search. reindex_ failed
(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: the
key decides which account at the provider is reached, and it is a secret
only you hold.
A database whose server isn't running gives the same error, saying it
can't be reached. Here DATABASE_URL names a port where no server is
listening:
SEARCH_HOST=https://search.example.com SEARCH_TOKEN=token DATABASE_URL=postgresql://localhost:5499/shop jadpo search reindex Product error The database main can't be reached
- reason
- Connecting to it failed, so no records of
Productcould be read. - next
- Check the database is running and its address is right, then run the command again (human)
- rule
- search.
reindex_ failed - help
- https://jadpo.
dev/docs/errors/search. reindex_ failed
An engine that refuses a record, or doesn't answer, stops the reindex the same way, saying how many records were sent before it did.
How to fix it
If nothing sets the engine's settings, set them to the engine the
app uses, in the environment or, at a prompt, in .env.local, then run
it again:
jadpo config set search_hostjadpo config set search_tokenjadpo search reindex Product
It sends each product's document to that index and says how many it sent.
If the database or the engine can't be reached, start it, or check its address and credential, then run the command again from the start:
jadpo search reindex ProductRecords already sent are sent again, which changes nothing.
If the address names another database than the one the records are
in, name that one with --url:
jadpo search reindex Product --url "$PRODUCTION_DATABASE_URL"The command reads that database's records instead.
Related
Markdown for agents: /docs/errors/search.reindex_failed.md.Built from Jadpo's main branch at commit f05ed31.