Skip to content

Obscure error message when javascipt module path is not found. #16

@peekjef72

Description

@peekjef72

Unfortunately, encountering an error like this:

ts=2026-06-16T19:20:27.785Z level=error caller=httpapi_exporter.go(main.main):155 msg="Error creating exporter: NewMetricFamily(): value of 'values' for metric \"duration\": field js code  endtimestamp - starttimestamp is invalid: Invalid module"

This obscure message appears when executing JavaScript code that uses the Veeam module, which should have been loaded by the modules directive in the profile.
In practice, it means the module was not loaded... so there’s an access issue with the file funcs/veeam.js.
This is one of the points that needs improvement in the current version.

check the profiles/veeam_profiles.yml: (below the original value)

veeam:
  modules:
    # WARNING: ./ at start of the module path is mandatory; else registry looks for the module in 'node_js' directory!
    # so path is absolute or ./path
    veeam: './config/veeam/profiles/funcs/veeam.js'
  scripts:
...

Originally posted by @peekjef72 in #14

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions