Skip to content

Connect Timeout Error when parsing NMR data from URL #137

Open

Description

@NishaSharma14

Describe the bug
The /spectra/parse/url API endpoint fails with a Connect Timeout Error when attempting to fetch and parse NMR data from a URL.

To Reproduce
Steps to reproduce the behavior:

  1. Make a POST request to /spectra/parse/url
  2. Use the following request body:
{
  "auto_detection": true,
  "auto_processing": true,
  "capture_snapshot": true,
  "url": "https://s3.uni-jena.de/nmrxiv/production/archive/1368b8fd-3af7-48f7-8b6d-13de9c1ecf8b/492-62-6.zip"
}
  1. Observe the error response

Error Details
The API returns a detailed error message:

NMR CLI error: node:internal/deps/undici/undici:14902
      Error.captureStackTrace(err);
            ^

TypeError: fetch failed
    at node:internal/deps/undici/undici:14902:13
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Object.arrayBuffer (file:///app/node_modules/file-collection/lib/append/sourceItemToExtendedSourceItem.js:35:26)
    at async fileItemUnzip (file:///app/node_modules/file-collection/lib/utilities/expand/fileItemUnzip.js:26:20)
    at async expandAndFilter (file:///app/node_modules/file-collection/lib/utilities/expand/expandAndFilter.js:17:23)
    at async FileCollection.appendExtendedSource (file:///app/node_modules/file-collection/lib/FileCollection.js:62:23)
    at async Promise.all (index 0)
    at async appendSource (file:///app/node_modules/file-collection/lib/append/appendSource.js:23:5)
    at async FileCollection.appendSource (file:///app/node_modules/file-collection/lib/FileCollection.js:133:9)
    at async FileCollection.fromSource (file:///app/node_modules/file-collection/lib/FileCollection.js:229:9)

Root Cause:

ConnectTimeoutError: Connect Timeout Error (attempted address: s3.uni-jena.de:443, timeout: 10000ms)
    at onConnectTimeout (node:internal/deps/undici/undici:2718:28)
    at Immediate._onImmediate (node:internal/deps/undici/undici:2699:11)
    at process.processImmediate (node:internal/timers:485:21)

Activity

  1. hamed-musallam commented on Sep 1, 2026

    @hamed-musallam
    Collaborator

    The sample provided in the ticket contains 4 1D spectra (2 FID, 2 FT) and 8 2D spectra (half of which are FT). As you can imagine, automated range and zone detection across these datasets requires a significant amount of memory, which is leading to a memory leak.

    This is not an issue during standard auto-processing or snapshot capturing. The issue occurs during the auto-detection step, which is where we need to focus our performance improvements. To address this, we need to investigate further how the 2D zones are detected in the processed spectra by NMRium.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions