sessions are not reaped

Open Beginner friendly
#2,340 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@alxndrsn is already working on this.

Since Nov 20, 2026.

  • #2341 by @alxndrsn — open

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker-compose, javascript, postgresql, shell

Research direction

Start by checking the executable permission on reap-sessions.sh and how the cron invocation runs it; the issue reproduces the failure with docker compose exec service. Confirm the script can be executed through that command and that expired sessions are reaped. The issue also points to #2339 as the reason this failure is silent.

Written by the indexing model from the issue text.

Description

reap-sessions.sh is not executable. This means when it's invoked by cron, it fails. This can be demoed with:

$ docker compose exec service /usr/bin/with-pgenvblock.pl /dev/shm/docker-envblock /usr/odk/reap-sessions.sh; echo "exit=$?"
Can't exec "/usr/odk/reap-sessions.sh": Permission denied at /usr/bin/with-pgenvblock.pl line 24.
Died at /usr/bin/with-pgenvblock.pl line 24.
exit=13

Due to https://github.com/getodk/central/issues/2339, this failure is silent.

Example from staging server:

> SELECT COUNT(*) AS total_sessions
       , COUNT(*) FILTER (WHERE "expiresAt" < now()) AS expired_sessions
       , MIN("expiresAt") AS earliest_expires_at
       , MAX("expiresAt") AS latest_expires_at
    FROM sessions;
 total_sessions | expired_sessions |    earliest_expires_at     |   latest_expires_at    
----------------+------------------+----------------------------+------------------------
           6234 |             5380 | 2022-10-07 08:29:04.632+00 | 9999-12-31 23:59:59+00

Dominant language
JavaScript
Stars
233
Forks
241
Avg merge
1d 22h
Merged PRs (30d)
13

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getodk/central

All issues in getodk/central

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.