Troubleshooting

What a problem looks like, why it happens, and what to do.

What a problem looks like, why it happens, and what to do, for the people who run Pinax. Start with the log (journalctl -u pinax-web -u pinax-ingest, or PINAX_LOG_FILE): every failed request is a warning there with its request ID, which is also the X-Request-ID of the response a person saw (Logs). /api/health and pinax db status answer the first questions in a second.

Pinax does not start

What you seeWhyWhat to do
PINAX_AUTH_MODE=demo lets anyone sign in as anyone, so it is refused when PINAX_ENVIRONMENT=prodThe demo's sign-in on a production serverSet PINAX_AUTH_MODE to local (or leave it out: outside the demo, local is the default) or header (Signing in)
PINAX_METRICS_TOKEN must be at least 16 charactersA metrics token too short to guard /metricsopenssl rand -hex 32 makes one (Metrics)
The catalog (...) is at revision ..., and this Pinax needs revision ...A release with a migration, with PINAX_DB_AUTO_UPGRADE=falseBack the catalog up, then pinax db upgrade (or apply pinax db upgrade --sql) (Upgrading)
... which this Pinax does not know: a newer Pinax has upgraded itAn older release started on a catalog a newer one upgradedRun the newer release, or restore the backup made before the upgrade
The catalog's database needs a driver that is not installed (psycopg)PINAX_DATABASE_URL is PostgreSQL, without the driveruv sync --frozen --no-dev --extra postgres (PostgreSQL)
connection refused, password authentication failed, no password suppliedPostgreSQL unreachable, or no password for the roleCheck the host and port, and the pinax user's ~/.pgpass (mode 0600, or the driver ignores it)
Pinax cannot write its log file ...PINAX_LOG_FILE or PINAX_AUDIT_LOG in a folder the pinax user cannot writeUse /var/log/pinax/ (the units make it) or another writable folder
address already in useAnother program on the portpinax serve --port another, and point the proxy at it

Signing in

What you seeWhyWhat to do
Nobody can sign in, because Entra ID is failingThe provider is down, or a setting is wrong or has expired (such as the client secret)An emergency account signs in at /auth/emergency (When Entra ID fails); on the server, fix the settings, or switch to local sign-in for a while
The alert PinaxEmergencySignIn firesSomeone signed in, or tried to, with an emergency accountThe audit log's auth.emergency_* events name the account and address; ask who holds its password
You can't use Pinax yet, or another message after signing in with Entra IDPinax refused the sign-in, or could not finish it, and says whySigning in with Entra ID lists each message and what to do
Unknown user, after signing in through single sign-onThe username the proxy sends is not a person in Pinax, or differs from theirsAdd them, with the exact name the header carries (with Entra ID, usually the user principal name) (People and access)
Sign in through the single sign-on proxyA request with the sign-on header that did not come from a trusted proxyMake PINAX_TRUSTED_PROXIES the proxy's address; requests must not reach Pinax's port around the proxy
This account has been deactivatedThey were deactivatedReactivate them in People and access
Local sign-in fails for a correct passwordFive failures in a row lock the account for 15 minutes; the answer is the same whatever went wrongWait, or give a new temporary password, which unlocks it: their page in People and access, or pinax user password USERNAME
Signed in, but asked to choose a passwordThey signed in with a temporary passwordThey choose their own; nothing else works until then
Signed in on HTTP, then signed out at onceSession cookies are Secure in production, and a browser sends them only over HTTPSServe Pinax over HTTPS, or set PINAX_COOKIE_SECURE=false for a trial

Someone cannot see what they expect

What you seeWhyWhat to do
My data is emptyThey belong to no lab, or their labs own no foldersAdd them to their lab (their page in People and access), and map the lab's folders (Folders and labs)
A lab's folder is missingThe folder is mapped to no lab, or to another, or the lab is inactiveFolders and labs, with Unmapped only for folders no one owns
A new folder is missingIt was created after the newest scanIt appears after the next scan is ingested
A report says an older scanSomeone chose an earlier scan beside the date; links keep the choiceBack to the latest in the header
A report says the totals are lower boundsfs-inventory could not read a folder below (permissions), or the scan stalledStorage health lists folders not read completely; give the scanning account read access to metadata
A division head's My data is emptyNo active lab has their division as its Division, spelled the sameSet each lab's Division on its page in People and access; the site role follows it (Site roles)
Finance sees no folders; an auditor or a division head has no buttons to change thingsTheir roles read, and finance sees charges, not foldersAs designed. A lab's tags and cleanup plan are changed by its PI and delegates, and the site's settings by administrators

Scans and ingest

What you seeWhyWhat to do
A new scan does not appearAutomatic ingest is not running, or the scan is not finishedScans shows automatic ingest's state; systemctl status pinax-ingest. A scan is ingested once its manifest says it finished
Scans says skippedThe scan's status was incomplete (stalled directories are missing) or it failed verificationIts message says why. Fix the cause and scan again; or, accepting lower bounds, pinax ingest SCAN --allow-incomplete
Scans says failedThe index could not be built: usually the disk filled, or the scan is damagedIts message says why; pinax ingest the scan again once fixed
scan ... is already snapshot NThe scan was ingested beforeNothing to do; to build its index again, pinax rebuild N
no filesystem is registered for ...The scan's root matches no filesystempinax filesystem add with the root the scan records, or --fs SLUG
Automatic ingest not respondingThe watcher stopped or hangsjournalctl -u pinax-ingest; systemctl restart pinax-ingest
/api/health is degraded, indexes_missingA ready snapshot's index folder is gonepinax rebuild SNAPSHOT_ID rebuilds it from its scan
The disk under PINAX_VAR_ROOT fillsIndexes, and room for the one being builtLower PINAX_KEEP_SNAPSHOTS; delete scans of pruned snapshots (Pinax never deletes scans) (Sizing)

Numbers

What you seeWhyWhat to do
A total looks wrongpinax check SNAPSHOT_ID compares every directory with fs-inventory rollup and lists any difference (Checking a filesystem's numbers)
Size and space on disk differ a lotCompressed or sparse files use less space than their size; many small files use moreBoth are right; reports show both where they differ
A folder is smaller than du saysHard links are counted once, at their first link by pathThe age map's panel says what a folder's extra links hold
Access times look wrongMany filesystems do not record access times reliably (noatime, relatime)Rely on Last change; show access only where the filesystem records it
History has no forecastA forecast needs six scans over eight weeks, after any step (a project moved in or out)It appears as scans accumulate
Capacity has no fill dateAt its trend the filesystem does not fill within three years, or a larger capacity is scheduled before it wouldThe earliest date at the fast end of the trend's range is still shown
A past month's charge changedA price, a free tier, or a folder's owner was changed back to before that monthEach change is in the audit log; statements already sent are not changed by Pinax (Charges and statements)

Pages and queries

What you seeWhyWhat to do
Pinax stopped this after 180 secondsA search or comparison of a whole filesystem read for longer than PINAX_QUERY_TIMEOUTSearch within a folder or narrow it; an administrator can run it in the background (Searches); or raise the limit with the proxy's (Configuration)
Pinax is already running as many searches of whole filesystems as it allowsPINAX_WIDE_QUERIES turns were all in useTry again shortly, or raise it if the server has the cores and memory
Pages are slow while a search runsSearches of whole filesystems use every core, PINAX_WIDE_QUERIES (2) at a timeFewer at once leave the rest more of the cores, and searches wait longer for a turn (Many people at once)
Pinax is busy: more people are using it at once than it can serveNo catalog connection was free within 10 seconds (pinax_catalog_busy_total, and Turned away in the log)Usually a moment of heavy use: try again shortly. If it recurs, with PostgreSQL raise PINAX_DATABASE_POOL_SIZE within the database's max_connections (Many people at once)
Every page is slow at busy times, with only two or three cores busyOne web process does each page's Python work one thread at a time: about 250 to 300 people at once on a laptopA server with faster cores; see Many people at once, and PINAX_WEB_THREADS for when fewer threads serve more
Lines marked (slow) in the logRequests over PINAX_SLOW_REQUEST_SECONDSThe line names the route and the time in index queries; see Sizing
Something went wrong on a pageAn error on the serverThe log has it, with the request's ID

API tokens and scripts

What you seeWhyWhat to do
401, Send a live API token as Authorization: Bearer <token>No token, a mistyped one, or one that expired, was revoked, or belongs to someone deactivatedAPI tokens (or the person's page) shows each token's state; make a new one if it ended. On /script/api/ a token is the only way in
403 The token '...' only readsA change made with a token that reads onlyMake a token with Your access for a script that changes things (API tokens for scripts)
403 A search in the background is a person'sA service token starting a search in the backgroundStart it with a person's own token
403 Tokens are made and revoked, and passwords changed, in Pinax's pagesA token used on the token or password routesAs designed: a leaked token cannot make another
Through oauth2-proxy, a script gets a sign-in page or a redirectThe proxy's configuration does not let /script/api/ through, or the script calls /api/skip_auth_routes in deploy/oauth2-proxy/pinax.cfg includes ^/script/api/; scripts call https://pinax.example.org/script/api/... (Single sign-on with oauth2-proxy)
A token made with Your access no longer changes what it didIts person's access changed: a token is never more than its personAs designed; it follows their access as it is now

Monitoring

What you seeWhyWhat to do
/metrics answers 404Metrics are offSet PINAX_METRICS_TOKEN and restart pinax-web
/metrics answers 401The token is missing or differentPrometheus sends it as Authorization: Bearer ... from credentials_file
Through oauth2-proxy, Prometheus gets a sign-in pageThe proxy's configuration does not let /metrics throughskip_auth_routes in deploy/oauth2-proxy/pinax.cfg includes GET=^/metrics$
No process_* metricsThey exist on Linux only
The alert PinaxBusy firesRequests were turned away as busy in the last 15 minutesAs for Pinax is busy under Pages and queries