Error: read ECONNRESET when trying to "strapi export" from EC2 instance with S3 as Upload Provider

System Information
  • Strapi Version: 4.20.4
  • Operating System: ubuntu
  • Database: MySQL
  • Node Version: v20.11.1
  • NPM Version: 10.2.4
  • Yarn Version: n/a

First time posting on a forum, apologies if this comes of unclear or amateurish.

I have a strapi project running on a t2.small EC2 instance, i didn’t use RDS the entire MySQL db is on the same EC2 instance along with all the strapi files.

nginx is setup on the instance too as a reverse proxy. S3 is setup as the upload provider for all media. Now i an error i cant figure out how to deal with and a couple questions on how my setup works.

My main problem is whenever i run:
npm run strapi export -- --file *file-name* --no-encrypt

I get this error

> soad-admin@0.1.0 strapi
> strapi export --file May-1-SoADBackup --no-encrypt

(node:140182) Warning: Credentials passed directly to s3Options is deprecated and will be removed in a future release. Please wrap them inside a credentials object.
(Use `node --trace-warnings ...` to show where the warning was created)
Starting export...
✔ schemas: 20 transfered (size: 25.4 KB) (elapsed: 39 ms) 
✔ entities: 689 transfered (size: 356.7 KB) (elapsed: 297 ms) 
⠴ assets: 232 transfered (size: 558.7 MB) (elapsed: 96308 ms) (5.8 MB/s)node:events:496
      throw er; // Unhandled 'error' event

Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)
Emitted 'error' event on PassThrough instance at:
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -104,
  code: 'ECONNRESET',
  syscall: 'read'

Node.js v20.11.1

From everything ive seen ECONNRESET is related to network timing out but the last time i ran the same command there were no issues and i changed no configs since. Similar threads pointed out the issue could be in my nginx.conf so i made these changes to that, still the same problem

# nginx.conf

server {
  sendfile off;
  proxy_buffering off;

Not sure what to do here and quite honestly don’t understand strapi’s architecture enough to debug it myself.

Secondly, i was curious how having S3 as an upload partner works:

  • When exporting, the size of assets is huge almost like it’s exporting all the media files rather than the connection to where they are hosted on my S3 bucket. Does that mean that though they are hosted on S3, when exporting the raw files are what are being transferred?
  • And say I want to, in the future, shift to RDS to manage the database. Will all the connections between each of my entries and their respective media on S3 still have a relation? Im not sure how to phrase this question properly and i think it stems from my lack of understanding of howmedia connected to files uploaded on my S3 are related to data in my actual strapi project.

Thank you in advance!