Issue Description
On a fresh self-hosted deployment using local file storage (USE_LOCAL=true), the server container crash-loops at startup with Error: Region is missing.
The cause is in apps/OpenSignServer/cloud/customRoute/deleteAccount/deleteFileUrl.js. The S3 client is constructed at module scope, so it runs on every import regardless of the storage backend:
const s3 = createS3Client({
region: process.env.DO_REGION,
endpoint: process.env.DO_ENDPOINT,
accessKeyId: process.env.DO_ACCESS_KEY_ID,
secretAccessKey: process.env.DO_SECRET_ACCESS_KEY,
});
index.js correctly falls back to FSFilesAdapter when USE_LOCAL === 'true', but this module is imported through the custom routes anyway, and @aws-sdk/client-s3 throws when region is empty or undefined.
Expected Behavior
With USE_LOCAL=true and no S3 / DigitalOcean Spaces credentials configured, the server should start normally. The S3 client should only be created when it is actually needed.
Current Behavior
The container exits during boot and never binds port 8080:
> open_sign_server@2.37.0 start
> node index.js
/usr/src/app/node_modules/coherentpdf/coherentpdf.js:1007
throw a}function
^
Error: Region is missing
at resolveRegionConfig (/usr/src/app/node_modules/@smithy/core/dist-cjs/submodules/config/index.js:618:15)
at new S3Client (/usr/src/app/node_modules/@aws-sdk/client-s3/dist-cjs/index.js:4891:27)
at createS3Client (file:///usr/src/app/cloud/customRoute/deleteAccount/deleteFileUrl.js:26:10)
at file:///usr/src/app/cloud/customRoute/deleteAccount/deleteFileUrl.js:29:12
at ModuleJob.run (node:internal/modules/esm/module_job:271:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:578:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:116:5)
Node.js v22.14.0
Steps to reproduce
- Deploy
opensign/opensignserver:main following the documented docker setup.
- In the environment, set
USE_LOCAL=true and leave DO_REGION, DO_ENDPOINT, DO_SPACE, DO_ACCESS_KEY_ID and DO_SECRET_ACCESS_KEY empty or unset, since no object storage is used.
- Start the server. It crash-loops with the trace above and never serves
/app.
Note: the shipped .env.local_dev sets DO_REGION=us-west, which is why the default quickstart does not hit this. Any deployment that clears the S3 variables because it uses local storage does.
Workaround
Set DO_REGION to any non-empty value (for example us-east-1) even when storage is local. The client is then constructed but never used, and the server boots fine.
Suggested fix
Create the client lazily so nothing is built unless a request actually needs S3:
let s3;
function getS3Client() {
if (!s3) {
s3 = createS3Client({
region: process.env.DO_REGION,
endpoint: process.env.DO_ENDPOINT,
accessKeyId: process.env.DO_ACCESS_KEY_ID,
secretAccessKey: process.env.DO_SECRET_ACCESS_KEY,
});
}
return s3;
}
Alternatively, skip S3 deletion entirely when process.env.USE_LOCAL === 'true'.
Happy to send a PR if the lazy-init approach looks right to you.
Operating System
Ubuntu 24.04, Docker Swarm, self-hosted behind Caddy.
What browsers are you seeing the problem on?
Not browser related, the crash is server-side at boot.
What version of OpenSign™ are you seeing this issue on?
2.37.0 (image opensign/opensignserver:main)
What environment are you seeing the problem on?
Hosted (app.yourdomain.com)
Please check the boxes that apply to this issue report.
Code of Conduct
Issue Description
On a fresh self-hosted deployment using local file storage (
USE_LOCAL=true), the server container crash-loops at startup withError: Region is missing.The cause is in
apps/OpenSignServer/cloud/customRoute/deleteAccount/deleteFileUrl.js. The S3 client is constructed at module scope, so it runs on every import regardless of the storage backend:index.jscorrectly falls back toFSFilesAdapterwhenUSE_LOCAL === 'true', but this module is imported through the custom routes anyway, and@aws-sdk/client-s3throws whenregionis empty or undefined.Expected Behavior
With
USE_LOCAL=trueand no S3 / DigitalOcean Spaces credentials configured, the server should start normally. The S3 client should only be created when it is actually needed.Current Behavior
The container exits during boot and never binds port 8080:
Steps to reproduce
opensign/opensignserver:mainfollowing the documented docker setup.USE_LOCAL=trueand leaveDO_REGION,DO_ENDPOINT,DO_SPACE,DO_ACCESS_KEY_IDandDO_SECRET_ACCESS_KEYempty or unset, since no object storage is used./app.Note: the shipped
.env.local_devsetsDO_REGION=us-west, which is why the default quickstart does not hit this. Any deployment that clears the S3 variables because it uses local storage does.Workaround
Set
DO_REGIONto any non-empty value (for exampleus-east-1) even when storage is local. The client is then constructed but never used, and the server boots fine.Suggested fix
Create the client lazily so nothing is built unless a request actually needs S3:
Alternatively, skip S3 deletion entirely when
process.env.USE_LOCAL === 'true'.Happy to send a PR if the lazy-init approach looks right to you.
Operating System
Ubuntu 24.04, Docker Swarm, self-hosted behind Caddy.
What browsers are you seeing the problem on?
Not browser related, the crash is server-side at boot.
What version of OpenSign™ are you seeing this issue on?
2.37.0 (image
opensign/opensignserver:main)What environment are you seeing the problem on?
Hosted (app.yourdomain.com)
Please check the boxes that apply to this issue report.
Code of Conduct