loopbackio / loopbackio/loopback-datasource-juggler

shortid dependency uses cluster mode and hence loopback cannot run in Passenger

Open
#1,907 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
JavaScript
Stars
282
Forks
366
Avg merge
17h 4m
Merged PRs (30d)
10

Description

## Suggestion
shortid package uses nodes cluster mode. Passenger deployment environment does not support/allow for Nodes cluster mode. This becomes a blocker even when the shortid package feature not being used.

## Use Cases
loopback API to be deployed in Passenger environment.

## Examples
App 5797 output: Trace: You required the Node Cluster module, which is incompatible with Passenger, a non-functional shim was returned and your app may still work. However, please remove the related code as soon as possible.
App 5797 output: at Console.trace (internal/console/constructor.js:336:11)
App 5797 output: at Module.require (/opt/cpanel/ea-ruby27/root/usr/share/passenger/helper-scripts/node-loader.js:63:12)
App 5797 output: at require (internal/modules/cjs/helpers.js:14:16)
App 5797 output: at Object. (/home/bangal41/nodevenv/cms_api_prod/11/lib/node_modules/shortid/lib/util/cluster-worker-id.js:3:15)
App 5797 output: at Module._compile (internal/modules/cjs/loader.js:816:30)
App 5797 output: at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
App 5797 output: at Module.load (internal/modules/cjs/loader.js:685:32)
App 5797 output: at Function.Module._load (internal/modules/cjs/loader.js:620:12)
App 5797 output: at Module.require (internal/modules/cjs/loader.js:723:19)
App 5797 output: at Module.require (/opt/cpanel/ea-ruby27/root/usr/share/passenger/helper-scripts/node-loader.js:80:25)
App 5797 output: (node:5797) ExperimentalWarning: queueMicrotask() is experimental.

## Acceptance criteria

TBD - will be filled by the team.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the shortid dependency and the cluster-worker-id.js path shown in the Passenger stack trace. Check how the dependency is loaded during application startup and whether the repository has tests covering identifier generation or deployment compatibility. Done should be defined by the team: Passenger should start without requiring the incompatible Node cluster module, with identifier behavior preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.