Troubleshooting¶
Why Paperless documents don't show, and how to fix it. Start where your problem starts:
- No Paperless documents in the search, or not the one you look for.
- The test of the connection fails when you save the settings.
- A warning about the API token shows below the token.
- Paperless Sync gives each user their own archive, of which the search shows the documents of each owner, but not the copies for those who may only view them.
- Search problems at the end of the settings lists failed searches.
- The search is slow.
The settings show no error to the users: a search that fails shows them no Paperless documents, as a search that finds none does. That is why the settings keep the history of these problems for the administrators, under Search problems, also where the hoster keeps the log of Nextcloud from them.
No Paperless documents in the search¶
Six questions, one after the other, find why a document doesn't show for a user, here document 412 for jamie:
- Search connected services. Nextcloud asks Paperless only while the user has switched it on in the search, and turns it off at every reload of the page (why). Always include Paperless in global search in the settings asks Paperless in every search instead.
- The archive account. Without one, no file stands for a document, and the search doesn't even ask Paperless. The settings take the account of Paperless Sync when the field is blank, and warn when the account of the field doesn't exist. When they say that the stored API token can't be decrypted, as after a move of Nextcloud with another
secretinconfig.php, enter it again. - Search problems. A search that failed shows up there with its error; below is what each line means, and the tables of the test of the connection say how to fix the errors, since a search fails for the same reasons as the test.
- What Paperless finds. Sign in to Paperless as the account of the API token and search for the same term. Paperless shows that account only the documents that it may view: give it the permission to view the others, or to a group that it is in, as Configure describes. When Paperless itself doesn't find a document whose text has the term, its index misses the document: rebuild it.
- The file with the marker. The file must belong to the archive account and carry the exact marker of the document,
[P412], in its name: a copy in another account, orP412without the brackets, stands for nothing. A file that the synchronization hasn't written yet, as for a document still in the inbox of Paperless, can't show either. Nextcloud finds only the files that its file cache knows: for an external storage, or files copied into the data folder of Nextcloud past it, letocc files:scan --path=/paperless/files/Paperlessscan the folder of the archive. - The share. The user needs to be able to open that file: the archive account itself, or a user or a group with whom it shared the file or a folder around it, read-only, as Configure shows. Sign in as the user and look for the file in Files: where the user can't open it, the search can't show it. A share that allows changes doesn't count, since the user could have named the file so: share it read-only.
Try a search at the end of the settings answers questions 4 to 6 without a shell: enter the term and the user ID, such as invoice and jamie, and it lists the first 20 documents that Paperless ranks for the term, each with its ID, its title, its tags and whether it shows to that user, or why not: Shared with write permission, Writable in a trusted folder, Not shared with the user, Not a file of the archive account, No file with its marker, such as [P412], or Not among the tags that the user may see, when Paperless Sync lets the user see only the documents with some tags. When document 412 isn't in the list, Paperless doesn't find it for the term among its first 20: question 4, or a more specific term. It asks the same questions as occ paperless_unified_search:search --explain and shows the titles and tags alone.
Still missing? Ask for help, with what each of these steps showed.
What you see, and why¶
| What you see | Why | What to do |
|---|---|---|
| No section Paperless documents at all | Nextcloud shows a section only when it has results, and asks Paperless only with Search connected services on | Switch it on, then follow the six questions above |
| The archive account finds the documents, other users don't | The archive isn't shared with them | Share it read-only with them or their group |
| A user with a share that allows changes finds none of its documents | A file that the user may change, or one in a folder where the user may add files, could carry any marker, so it stands for no document | Share it read-only; the settings warn about each such share |
| The archive lies in a Team folder, or in an external storage mounted for several users or groups, and the search shows none of its documents | Such a mount has no account of its own: Nextcloud names each user who sees a file there as its owner, so its files belong to no archive account | Trust the mount with occ paperless_unified_search:trusted-mounts team:3, for the Team folder with the ID 3; see decision 0019 |
| A user who may write a trusted Team folder or external storage finds none of its documents | A file that the user may change there, or one in a folder where the user may add files, could carry any marker | Let the user only read the folder there; Try a search names such a document Writable in a trusted folder |
| Some documents show, others don't | The account of the token may not view them, or they have no file with their marker yet | Questions 4 and 5 above |
| Users don't find the documents that others let them view in Paperless, and the settings warn about Paperless Sync | Paperless Sync also gives each user copies of the documents that they may view, in their own files, which the search doesn't count | Below |
| A user finds no documents, or only some, while others find them, and the settings list that user below the archive account | Paperless Sync lets the user see only the documents with some tags of Paperless, and the documents carry none of them; a tag whose name has a typo or was renamed in Paperless counts as none, and the user sees no document while Paperless doesn't name the tags | Give the documents one of the tags in Paperless, or correct the line of the user in the setting Tags that a user may see of Paperless Sync; Try a search names such a document Not among the tags that the user may see. See decision 0015 |
| Users find none of their own documents, only those without an owner in Paperless, and the settings warn that the account may not view users | Paperless Sync gives each user the documents that they own, and the search can't tell whose files stand for which document without the usernames of Paperless | Below |
| Results show no correspondent, no type or no tags, with or without a warning in the settings | The connection was last tested before an update of the app, so the settings don't know yet what the account may not view; or the account of the token may view correspondents, document types and tags, but not these ones, which another user of Paperless owns; the settings warn when the newest documents name one of them | Test the connection again: it warns if the account lacks View for Tag. Then let the account view the ones that another user owns, as Configure shows; the results show the names within ten minutes |
| Paperless documents vanished after a move or a restore of Nextcloud | The stored API token can't be decrypted with the new secret of config.php |
Enter the token again in the settings |
Paperless documents vanished after allow_local_remote_servers was removed from config.php |
Nextcloud refuses the address of Paperless in the local network | Select Paperless runs in my local network and save |
| A query in the syntax of Paperless finds nothing while you still type it | Paperless can't parse it yet, such as created:[2026 to |
Finish the query; Paperless 3 finds the words of it meanwhile |
| Only a few results, and no Load more results | The user can open the files of only a few of the documents that Paperless ranks first | Normal: the search goes through up to 4 pages of 25 documents of Paperless per page of results, or up to 20 while it has found no result yet, within 3 seconds, then ends. A more precise term or the date filter reaches later documents |
| No results at all, not even from Files, when you type right after opening the search on a slow server | Nextcloud 33 and 34 search only once they know their search providers, and don't try again | Change the term. Nextcloud 35 searches by itself |
Paperless Sync gives each user their own archive¶
Since its version 1.1.0, Paperless Sync can give each user of Nextcloud the documents that their user of Paperless owns, with Who gets the documents set to Each user, those they own in Paperless, and since its version 1.4.0 also those that it may view, with Each user, those they own or may view in Paperless. It writes them into the files of each user, below the same base folder, instead of the files of its target user.
Each user, those they own in Paperless works with the search, and so do the copies of the owners with Each user, those they own or may view in Paperless. A file of the user whom Paperless Sync gives the owner of a document in Paperless stands for that document, by the same rules as Paperless Sync: the table Paperless users with another Nextcloud ID, or else the user of Nextcloud with the same ID, whatever its case, only a member of the group of Only members of this group, and nobody for two users of Paperless with one user of Nextcloud. The user finds such a file in their own folders, and others find it through the shares of that user, read-only, as with the files of the archive account (decision 0013). A file renamed after a document of another owner stands for none: Try a search lists that document as Owned in Paperless by another user. The search learns the usernames of the owners from Paperless, so the account of the API token needs View for User; without it, the search shows only the files of the archive account, and the settings, occ paperless_unified_search:check and the overview say so after the next test of the connection. Once the account may view users, save the settings again, with the same token or another, or run occ paperless_unified_search:check: the files of the owners count at once, and otherwise within ten minutes. The check counts them as the search does, and fails when not one document has a file of the archive account or of the user of its owner.
With Each user, those they own or may view in Paperless, the search leaves out the copies that Paperless Sync gives the users who may only view a document: only the permissions of each document in Paperless tell who they are, and the search would have to read them for every result (decision 0013). Such a user finds the document through a file of its owner, or of the archive account, that is shared with them read-only; Try a search lists their own copy as Owned in Paperless by another user. What the search shows besides are the files of the archive account, the target user of Paperless Sync, which keeps the documents that Paperless Sync gives no user of their own: those without an owner in Paperless, those whose owner has no user in Nextcloud or isn't in its group. A document that Paperless Sync can't give to one user, such as one of two users of Paperless for one user of Nextcloud, stays where its copy is, and a new one gets no copy, so the search doesn't show it either.
For it, the settings warn below Archive account, also after each test of the connection, and so do Try a search, occ paperless_unified_search:check and occ paperless_unified_search:setup, and the overview of the administration settings, each with a link to this page. Three ways out:
- Search the documents of each owner. Set Who gets the documents in Paperless Sync to Each user, those they own in Paperless, and give the account of the API token View for User: each user finds their own documents, and those that others share with them.
- Search every document. Set Who gets the documents in Paperless Sync back to The target user, all of them: Paperless Sync then writes every document into the files of its target user again, and the search shows each user the documents whose files the archive account shares with them, as Configure shows. A dry-run of Paperless Sync lists each change first.
- Keep the copies for each user. Each user finds the documents that they may only view in Files, by the names of the files, and in Paperless, and the search shows them their own documents and those of the archive account. The warning stays for as long as Paperless Sync gives each user these copies.
Neither counts when the archive account in the settings is another account than the target user of Paperless Sync: the search then shows none of the files of Paperless Sync anyway, but those of the synchronization of that account, and nothing warns.
When the test of the connection fails¶
Test connection and save saves the connection only once Paperless answers with a list of documents, and when it doesn't, the message says what failed and what to correct, in the language of your account. While a connection is stored, the archive account and the three switches below it are saved all the same, and the URL, the API token and Paperless runs in my local network stay as they were: so you can turn off Always include Paperless in global search or the notifications exactly while Paperless is down, slow or being moved, and the message says so in the colour of a warning instead of the one of an error. The log of Nextcloud gets a warning with the error itself, such as cURL error 6: Could not resolve host, without the token and without the query of the URL.
| The message says | What failed | What to do |
|---|---|---|
| Paperless rejected the API token (HTTP 401 or 403) | Paperless doesn't know the token, or its account may not view documents. Or the URL redirects to another scheme, host or port, such as from http to https, and Nextcloud leaves the token out of the redirect |
Copy the token again from the profile of the Paperless account, and give the account the permission to view documents. Enter the address that the URL forwards to |
| This URL answers, but not with the API of Paperless (HTTP 404) | The path of the URL, or a proxy in front of Paperless | Enter the address that opens Paperless in the browser, with the path when Paperless runs under one, such as https://example.com/paperless |
| This URL forwards to another address | The URL redirects, and with Paperless runs in my local network Nextcloud follows no redirect | Enter the address that it forwards to, such as the one with https |
| Paperless is older than 2.16 | Paperless answered HTTP 406: it doesn't speak version 9 of its API, which the app asks for | Update Paperless-ngx to 2.16 or newer |
| Paperless no longer speaks version 10 of its API | Paperless answered HTTP 406 to version 10 of its API, which the app asks for since Paperless named it: this Paperless is newer than the app, or it was downgraded or restored from an older backup | Update Paperless Unified Search; after a downgrade or a restore, Test connection and save fixes it |
| Paperless answered with an error | Paperless itself failed, with a status of 5xx, or Paperless or a proxy in front of it answered another status that no row here names, such as HTTP 400 | Look into the log of Paperless and of the proxy, or try again later |
| Paperless does not accept the host name of its URL (HTTP 400) | Paperless doesn't answer the host name under which Nextcloud reaches it, such as paperless in http://paperless:8000. Since Paperless-ngx 3.5, Paperless answers only the host of PAPERLESS_URL and localhost once PAPERLESS_URL is set, and any version answers only the names of PAPERLESS_ALLOWED_HOSTS once that is set. The log of Paperless names the host: Invalid HTTP_HOST header |
Add that other host name to PAPERLESS_ALLOWED_HOSTS of Paperless, such as PAPERLESS_ALLOWED_HOSTS=paperless, and restart Paperless. Or enter the URL with the host name of PAPERLESS_URL, when Nextcloud reaches Paperless under it |
| This URL answers, but not like Paperless-ngx | Another service, or the login page of a proxy | Check the address and its path |
| Nextcloud does not connect to addresses of the local network | Paperless runs at an address of the local network | Select Paperless runs in my local network, as Paperless in your local network describes |
| Nextcloud does not trust the certificate of Paperless | A certificate of your own authority, a self-signed one, or one for another name | Import the certificate of the authority with occ security:certificates:import, or use the name that the certificate is for |
| Nextcloud could not set up an encrypted connection | Mostly https at a port that speaks plain HTTP |
Enter the URL with http, or the port of HTTPS |
| Nextcloud could not find the host of this URL | The name doesn't resolve, as a Docker service outside the network of Nextcloud doesn't | Check its spelling, and put Nextcloud and Paperless into one Docker network |
| Paperless did not answer in time | No connection within 3 seconds or no answer within 10 | Check that Paperless runs and isn't busy, and that no firewall drops the requests |
| Nextcloud could not reach Paperless at this URL | The connection was refused, as at a wrong port | Check the address and the port, and that Paperless runs |
| The settings could not be saved | Something after the test, such as the database | Look into the log of Nextcloud |
The answer of the settings route carries a code beside the message, such as unauthorized, not_found or unknown_host, for scripts that save the settings.
When Nextcloud itself can't take the request, the page says so in one sentence instead of showing the page of the error:
| The message says | What happened | What to do |
|---|---|---|
| Nextcloud is in maintenance mode | Nextcloud is being upgraded or maintained, and answers every request with HTTP 503 and a header that says so | Try again in a few minutes |
| Your session has expired | The session of your login ended, or its request token is no longer valid (HTTP 401 or 412) | Reload the page and try again |
| Nextcloud could not be reached | The browser lost its connection to Nextcloud | Check your connection and try again |
| The request failed (HTTP 502) | A proxy in front of Nextcloud answered with an error of its own, such as 502, 503 or 504, or Nextcloud found a problem with its own setup, such as a data folder it can't write to. Without a status, the page itself met an error | Check that Nextcloud runs, its log and the log of the proxy, and reload the page |
| Confirm your password to change the settings | The dialog that asks for your Nextcloud password was closed, or didn't confirm the password | Select Test connection and save or Disconnect again, and confirm with your Nextcloud password |
| Nextcloud gave an unexpected answer | Something in front of Nextcloud, such as the login page of a proxy, answered instead of the app | Reload the page and try again |
Before the test, the settings check what you entered. These messages name what to correct:
| The message says | What to do |
|---|---|
| Enter a valid Paperless URL | Enter the whole address, with http:// or https://, such as https://paperless.example.com |
| The Paperless URL must use HTTP or HTTPS | Start the URL with http:// or https:// |
| The Paperless URL must not contain credentials, a query, or a fragment | Leave out user:password@, a ? and a #: the token is the only credential |
| Enter the host of the Paperless URL in its ASCII form | Enter a name with letters such as ü as punycode, such as xn--bcher-kva.example for bücher.example |
| A Paperless API token is required | Enter the token: no token is stored yet |
| Enter the API token again: a stored token is only sent to the Paperless server it was saved for | Enter the token again: the URL names another scheme, host or port than the stored one |
| The archive account … does not exist | Enter the ID of an existing Nextcloud account, or leave the field blank for the account of Paperless Sync |
Reference lists the code that the settings route answers with each message, for scripts that save the settings.
Warnings about the API token¶
The test of the connection also asks Paperless what the account of the API token may do, as Test connection and save, occ paperless_unified_search:setup, test and check run it. The settings show a warning below the token, occ a line with Warning: or !, and the overview of the administration settings repeats it until the next test. None of them keeps the settings from being saved or the search from working. Change the account in Paperless, under Users & Groups, or enter the token of another one, then test the connection again.
| The warning says | What to do |
|---|---|
| The API token belongs to a Superuser of Paperless | Add an account of its own for the search, as Configure shows, and enter its token: whoever gets hold of the token of a superuser can change and delete every document |
| The API token belongs to an Admin of Paperless | Clear Admin of the account, or use the token of another one: an admin may also read the logs and the status of Paperless |
| The account of the API token may add, change or delete documents | Of the permissions for Document, leave the account only View, in its own permissions and in those of its groups, which count as well; it keeps View for Correspondent, DocumentType, Tag and UISettings. Add or Change for User and Change for Group count too, since Paperless lets such an account give itself the permission to change documents |
| The account of the API token may not view correspondents | Give the account View for Correspondent; until then the results and the dashboard show no correspondent. Once you save the settings again, with the same token or another, they show it at once, and otherwise within ten minutes |
| The account of the API token may not view document types | Give the account View for DocumentType; until then the results and the dashboard show no type. Once you save the settings again, with the same token or another, they show it at once, and otherwise within ten minutes |
| The account of the API token may not view tags | Give the account View for Tag; until then the results and the dashboard show no tags, and a user whom Paperless Sync lets see only the documents with some tags sees no document at all. Once you save the settings again, with the same token or another, they show them at once, and otherwise within ten minutes |
| The account of the API token may not view some correspondents, document types or tags | Let the account view those that another user owns, as Configure shows; the results show their names within ten minutes, and the next test of the connection no longer warns |
| The account of the API token may not view users | Give the account View for User: while Paperless Sync gives each user the documents that they own, the search needs the usernames of Paperless to tell whose files stand for a document, and until then it shows only the files of the archive account. Once you save the settings again, with the same token or another, or run occ paperless_unified_search:check, the files of the owners count at once, and otherwise within ten minutes |
Paperless doesn't say what the account of the API token may do (occ paperless_unified_search:check alone) |
Give the account View for UISettings: Paperless tells what an account may do only to one that may view its UI settings, and without it the settings warn about nothing. The overview forgets the warnings of an earlier test then, which belong to an account that has changed since |
Paperless didn't answer in time, or not as Paperless does, what the account of the API token may do (occ paperless_unified_search:check alone) |
Run the check again: a question without an answer says nothing about the account, so the overview keeps the warnings of the last test that Paperless answered. When it keeps failing, look into the log of Paperless and of a proxy in front of it |
Paperless in your local network¶
When Paperless runs at an address of your local network or by the name of its Docker service, such as http://192.168.1.20:8000 or http://paperless:8000, Nextcloud refuses to connect to it, and the test of the connection says so. Select Paperless runs in my local network in the settings, and save: Nextcloud then allows that address for the requests of this app to the URL of the settings, and for nothing else. Configure has the details, and why allow_local_remote_servers in config.php is the wrong fix.
With the switch, Nextcloud follows no redirect: a URL that forwards, as from http to https, fails the test with its own message. Enter the address that it forwards to.
Paperless itself may refuse such a name: since Paperless-ngx 3.5, a Paperless that sets PAPERLESS_URL answers only the host of that URL and localhost, and the test fails with Paperless does not accept the host name of its URL, as soon as Paperless is updated. Add the name under which Nextcloud reaches it to PAPERLESS_ALLOWED_HOSTS of Paperless, as its row says.
Certificates of your own¶
Nextcloud checks the certificate of every HTTPS server that it connects to. A Paperless with a certificate of an authority of your own, or with a self-signed one, fails the test with Nextcloud does not trust the certificate of Paperless. Import the certificate of the authority, or the self-signed certificate itself, into the certificates that Nextcloud trusts:
occ security:certificates:import /path/to/ca.crt
occ security:certificates
The second command lists the certificates that you imported. In Docker, the file has to be inside the container first:
docker compose cp ca.crt app:/tmp/ca.crt
docker compose exec --user www-data app php occ security:certificates:import /tmp/ca.crt
The name in the URL has to be one that the certificate is for: a certificate for paperless.example.com fails for https://192.168.1.20. Don't switch to http to get around a certificate when the connection leaves the computer, since the token would then travel unencrypted.
Behind a reverse proxy¶
A proxy in front of Paperless, such as nginx, Traefik, Caddy or the tunnel of Cloudflare, answers for Paperless, and some of its answers fail the test:
- A path. When Paperless runs under a path, such as
https://example.com/paperlesswithPAPERLESS_FORCE_SCRIPT_NAME=/paperless, the URL of the settings needs that path; the app adds/api/documents/to it. Without it, the test fails with HTTP 404. - A login in front of Paperless, such as the forward authentication of Authelia or Authentik, answers with its login page or a redirect to it: This URL answers, but not like Paperless-ngx, or, with Paperless runs in my local network, This URL forwards to another address. Let the proxy pass the path
/api/to Paperless without its login, since the token authenticates every request, or let Nextcloud reach Paperless behind the proxy, at its address in the local network, with Paperless runs in my local network. - Basic authentication in the proxy, such as
auth_basicof nginx, answers HTTP 401 to a request that carries the token in place of its own login: Paperless rejected the API token (HTTP 401), with a token that works. Let the proxy pass the path/api/to Paperless without it. - The header
Authorization. The token travels in it, asAuthorization: Token …. A proxy that drops the header, or replaces it with one of its own, makes Paperless refuse a correct token with HTTP 401. - A firewall or protection against bots, such as the challenge page of Cloudflare, answers HTTP 403 or a page of its own: Paperless rejected the API token (HTTP 403) with a token that works in the browser, or not like Paperless-ngx. Let the requests of the Nextcloud server through, whose
User-Agentstarts withNextcloud-Paperless-Unified-Search/. - A redirect to another scheme, host or port, such as from
httptohttpsor to another name: Nextcloud follows it, but leaves the token out, so that the token never reaches a server that it wasn't entered for, and Paperless refuses the request without it: Paperless rejected the API token. With Paperless runs in my local network, Nextcloud follows no redirect, and the test says This URL forwards to another address. Either way, enter the address that the proxy forwards to. A redirect within the same server, such as to the path with a slash at its end, keeps the token.
The log of the proxy shows each request of the app with that User-Agent and the version of the app.
The index of Paperless¶
Paperless finds documents in an index of their words, which it keeps next to its database. After a restore, a move or a crash of Paperless, the index can miss documents or still hold the words of their old text: the search of Paperless itself then misses them as well, and so does the search of Nextcloud. Rebuild it:
docker compose exec webserver document_index reindex
webserver is the service of Paperless in its compose.yaml; without Docker, run python3 manage.py document_index reindex in the folder src of Paperless. A large archive takes a while, and Paperless finds less until it is done.
Search problems¶
The end of the settings counts the problems of the search and lists the latest 20 of them, newest first. It shows No problem recorded until a search fails or a request needs its second try. Clear history and Disconnect forget the history; saving the settings keeps it.
| Line | What it shows |
|---|---|
| Recorded since | When the history began: the first problem after it was last cleared |
| Failed searches | How many searches showed no Paperless documents because a request failed, also those that the list no longer holds |
| Answered on the second try | How many requests to Paperless failed before they reached it and got their answer on a second try: the users saw the documents, a moment later |
| Last failed search | When a search last failed |
| Searches work again since | When the first search after the last failure worked, or No search has worked since while Paperless is still out of reach |
| Column | What it shows |
|---|---|
| Time | When the problem happened, in the time zone and the format of your account |
| Event | Search failed: the user saw no Paperless documents. Second try answered: the first try failed before it reached Paperless, the second got the answer |
| Step | Asking Paperless: the request to Paperless failed. Looking for the files in Nextcloud: Paperless answered, but finding the files of its documents in Nextcloud failed |
| Error | For a request to Paperless, what failed and what to do, in the words of the test of the connection and in the language of your account; below it, the kind of the error and its message as they are, for a bug report, such as ConnectException: cURL error 6: Could not resolve host, without the API token, the search term and the query of any URL. A problem of the files, and one that an older version of the app recorded, shows the error alone |
| Duration | For Search failed, how long the search took from its start until it failed: about 6,000 ms when neither of the two tries got a connection within 3 seconds, about 10,000 ms for a Paperless that took the connection but didn't answer, and the time of the pages before when a later page of Paperless failed. For Second try answered, how long the first try took: about 3,000 ms for a connection that wasn't set up in time, a few milliseconds for a name that didn't resolve |
A query that Paperless refuses while it is still being typed, and a page past the last result, are no problems and don't show up. During an outage, the problems of one kind are written at most once in 30 seconds, with those in between still counted. The errors of the column Error are the ones of the test of the connection; for example:
| The error says | What failed |
|---|---|
cURL error 6: Could not resolve host |
The name of the host of the URL doesn't resolve on the Nextcloud server |
cURL error 7: Failed to connect |
Nothing accepts connections at the address and the port |
cURL error 28: Connection timed out |
No connection within 3 seconds, on the second try as well |
cURL error 28: Operation timed out |
No answer within 10 seconds: Paperless is busy, as while it consumes documents or rebuilds its index |
cURL error 60: SSL certificate problem |
Nextcloud doesn't trust the certificate: import it |
Paperless returned HTTP 401 |
The token is no longer valid: create one and enter it |
The search is slow¶
A page of results waits for Paperless: the app connects within 3 seconds, waits up to 10 seconds for each answer, and goes through up to 4 pages of 25 documents of Paperless, or up to 20 while it has found no result yet, within 3 seconds to fill a page of results. Most of that time is Paperless searching its index; while it consumes many documents or rebuilds its index, it answers more slowly. A request that waited in vain for Paperless gets no second try, so a Paperless that hangs costs every search at most one wait. After a request that got no answer at all, a timeout, a refused connection or a name that doesn't resolve, the search rests for 30 seconds: it shows no Paperless documents and doesn't ask Paperless, so that a Paperless that is down doesn't hold the PHP workers of Nextcloud and slow down all of it. The failure that started the rest is in Search problems; once Paperless answers again, the first search after the 30 seconds finds its documents, and Test connection and save or occ paperless_unified_search:test ends the rest at once.
Search in Paperless itself to compare: when it is slow there too, give Paperless more memory or a faster disk. When it is fast there, look at the network between the two servers, and at Search problems.
Ask for help¶
When none of this helps, ask in the discussions, or report a bug with the template of the issues. Name the version of the app, of Nextcloud and of Paperless-ngx, whether the search runs with Search connected services or always, which step of the six questions failed, and the lines of Search problems and of the log of Nextcloud. Never post the API token, private addresses or the contents of documents.