overleaf / overleaf/toolkit

Exporting Projects Script Erroring

Open
#412 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
1.3k
Forks
310
Avg merge
3d 12h
Merged PRs (30d)
1

Description

Hi all,

I want to be able to access my files from another location on my server, as such I found this script online:
bin/docker-compose exec sharelatex /bin/bash -ce "cd /overleaf/services/web && node modules/server-ce-scripts/scripts/export-user-projects.mjs --export-all --output-dir=/var/lib/overleaf/data/exports"

from here: https://docs.overleaf.com/on-premises/maintenance/data-and-backups/exporting-projects

when I run this I get:
{"name":"default","hostname":"36cdbd5d3dbb","pid":480,"level":40,"msg":"graceful shutdown: started shutdown sequence","time":"2025-12-05T00:05:10.140Z","v":0}
{"name":"default","hostname":"36cdbd5d3dbb","pid":480,"level":30,"stage":"optionalBeforeStoppingTraffic","msg":"graceful shutdown: run handlers","time":"2025-12-05T00:05:10.140Z","v":0}
{"name":"default","hostname":"36cdbd5d3dbb","pid":480,"level":40,"msg":"graceful shutdown: closing http server","time":"2025-12-05T00:05:11.140Z","v":0}
{"name":"default","hostname":"36cdbd5d3dbb","pid":480,"level":30,"stage":"requiredBeforeDrainingConnections","msg":"graceful shutdown: run handlers","time":"2025-12-05T00:05:11.141Z","v":0}
{"name":"default","hostname":"36cdbd5d3dbb","pid":480,"level":30,"stage":"connectionDrainer","msg":"graceful shutdown: run handlers","time":"2025-12-05T00:05:11.141Z","v":0}
{"name":"default","hostname":"36cdbd5d3dbb","pid":480,"level":30,"stage":"optionalAfterDrainingConnections","msg":"graceful shutdown: run handlers","time":"2025-12-05T00:05:11.146Z","v":0}
{"name":"default","hostname":"36cdbd5d3dbb","pid":480,"level":30,"msg":"graceful shutdown: ready to exit","time":"2025-12-05T00:05:11.146Z","v":0}
{"name":"default","hostname":"36cdbd5d3dbb","pid":480,"level":50,"err":{"message":"request failed","name":"RequestFailedError","stack":"RequestFailedError: request failed\n at fetchNothing (/overleaf/libraries/fetch-utils/index.js:83:11)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.flushProjectToMongoAndDelete (file:///overleaf/services/web/app/src/Features/DocumentUpdater/DocumentUpdaterHandler.mjs:54:3)\n at async exportUserProjectsToZip (file:///overleaf/services/web/modules/server-ce-scripts/scripts/export-user-projects.mjs:90:5)\n at async exportAllUsersProjects (file:///overleaf/services/web/modules/server-ce-scripts/scripts/export-user-projects.mjs:157:5)\n at async main (file:///overleaf/services/web/modules/server-ce-scripts/scripts/export-user-projects.mjs:201:7)","info":{"url":"http://127.0.0.1:3003/project/6931f84cbbe21d24c8bad40f","method":"DELETE","status":500}},"msg":"Error in export-user-projects script","time":"2025-12-05T00:05:11.147Z","v":0}

I have just done a fresh install for unrelated reasons so the fix is not updating overleaf toolkit.
I have changed the overleaf port from default, and set listen ip to 0.0.0.0, other than that I have made no config changes.

Does anyone know why this script isn't working?

Or another way to export the files (.tex, .aux, etc.) from all projects from the host device.

Many thanks

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start with the documented docker-compose command and reproduce the failure in modules/server-ce-scripts/scripts/export-user-projects.mjs. Trace the DELETE request through services/web/app/src/Features/DocumentUpdater/DocumentUpdaterHandler.mjs and /overleaf/libraries/fetch-utils/index.js. Done means the script exports all projects without the request-failed error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose, node.js, shell
Domain
backend, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.