Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nango Pods Fail to Run with Default Helm Chart Install Due to *_PORT Environment Variable Being Set Incorrectly #8

Open
colinbjohnson opened this issue Jan 12, 2025 · 0 comments

Comments

@colinbjohnson
Copy link
Contributor

With a default install of nango's helm chart version 1.0 the following services (runner, persist, orchestrator, jobs) will not run properly due to an error Missing or invalid env vars: SERVER_PORT (invalid_type Expected number, received nan) error.

The full log entry is below:

file:///app/nango/packages/utils/dist/environment/parse.js:164
        throw new Error(`Missing or invalid env vars: ${zodErrorToString(res.error.issues)}`);
              ^

Error: Missing or invalid env vars: SERVER_PORT (invalid_type Expected number, received nan)
    at parseEnvs (file:///app/nango/packages/utils/dist/environment/parse.js:164:15)
    at file:///app/nango/packages/shared/dist/services/providers.js:10:14
    at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:122:5)

Node.js v20.18.1

The cause of this error is understood to be a combination of two things:

  1. Kubernetes' "Service" resources publish an environment variables to other pods based on the service's name - for instance, a "Kind: Service" resource:
  • named "service" publishes an environment variable to all other services as follows SERVER_PORT=tcp://172.20.109.125:80
  • named "nango-persist" publishes an environment variable to all other services as follows NANGO_PERSIST_PORT=tcp://172.20.176.3:80
  1. The nango applications read the variables SERVER_PORT or NANGO_PERSIST_PORT which, rather than being set to an expected value (example: 80) are the values published by other Nango Kubernetes Services.

I have a few ideas for resolution described below:

  1. Have all Nango service names append a -svc suffix
  2. Reconfigure the Nango applications to read environment variables that are not commonly set (prefixing with NANGO_ seemed like a good idea)
  3. Have the values.yaml file explicitly declare each of these values (this assumes that the explicit envvars would override the published envvars)
@colinbjohnson colinbjohnson changed the title Pods Fail to Run with Default Helm Chart Install Due to *_PORT Environment Variable Being Set Incorrectly Nango Pods Fail to Run with Default Helm Chart Install Due to *_PORT Environment Variable Being Set Incorrectly Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant