[COMPASS-5802] Windows installation of Compass generates node-forge error Created: 07/May/22  Updated: 29/Oct/23  Resolved: 22/Aug/22

Status: Closed
Project: Compass
Component/s: Embedded Shell, Installation, Windows Installer
Affects Version/s: 1.31.1, 1.31.2
Fix Version/s: 1.33.1

Type: Bug Priority: Major - P3
Reporter: Felicia Hsieh Assignee: Anna Henningsen
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Win10


Attachments: PNG File CompassNodeError.png     Text File compass_62757a972677d21b92810f09_log.txt    
Story Points: 2
Documentation Changes: Not Needed
Sprint: Iteration Dolphin, Iteration Fish, Iteration Grouper, Iteration Herring, Iteration Isopod

 Description   

Problem Statement/Rationale

What is going wrong? What action would you like the Engineering team to take?

Cannot install Compass 1.31.2 using any of the 3 versions (msi, exe, zip).

Please be sure to attach relevant logs with any sensitive data redacted.

Steps to Reproduce

How could an engineer replicate the issue you’re reporting?

Install using Win10 using zip.

Expected Results

What do you expect to happen?

Installation of Compass w/o errors

Actual Results

What do you observe is happening?

//When customer types in a command
Error: Cannot find module 'node-forge'
Require stack:
- C:\Program Files\MongoDB Compass\resources\app.asar.unpacked\node_modules\win-export-certificate-and-key\index.js
- C:\Program Files\MongoDB Compass\resources\app.asar.unpacked\node_modules\system-ca\lib\impl.js
- C:\Program Files\MongoDB Compass\resources\app.asar.unpacked\node_modules\system-ca\lib\index.js
- C:\Program Files\MongoDB Compass\resources\app.asar.unpacked\node_modules\@mongosh\node-runtime-worker-thread\dist\worker-runtime.js
Require stack:
- C:\Program Files\MongoDB Compass\resources\app.asar.unpacked\node_modules\win-export-certificate-and-key\index.js
- C:\Program Files\MongoDB Compass\resources\app.asar.unpacked\node_modules\system-ca\lib\impl.js
- C:\Program Files\MongoDB Compass\resources\app.asar.unpacked\node_modules\system-ca\lib\index.js
- C:\Program Files\MongoDB Compass\resources\app.asar.unpacked\node_modules\@mongosh\node-runtime-worker-thread\dist\worker-runtime.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:887:15)
    at Function.Module._load (internal/modules/cjs/loader.js:732:27)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Program Files\MongoDB Compass\resources\app.asar.unpacked\node_modules\win-export-certificate-and-key\index.js:7:15)
    at Module._compile (internal/modules/cjs/loader.js:1078:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)
    at Module.load (internal/modules/cjs/loader.js:935:32)
    at Function.Module._load (internal/modules/cjs/loader.js:776:14)
    at Module.require (internal/modules/cjs/loader.js:959:19) 

Log file shows:

{"t":\{"$date":"2022-05-06T19:44:37.136Z"},"s":"I","c":"DEVTOOLS-CONNECT","id":1000000049,"ctx":"compass-connect","msg":"Loaded system CA list","attr":{"caCount":88,"asyncFallbackError":"The V8 platform used by this instance of Node does not support creating Workers"}}

 

Additional Notes

Any additional information that may be useful to include.



 Comments   
Comment by Githook User [ 28/Sep/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix(compass): include node-forge in unpacked node_modules COMPASS-5802 (#3345)

Since it is a dependency of win-export-certificate-and-key,
node-forge should also be unpacked, like its dependent.

This adds an e2e test for verifying that the shell works
when connecting to Atlas using tlsUseSystemCA (since that
is an environment which always uses TLS and should always
match the system CA suite).
Branch: update-compass-shell-to-shared-config
https://github.com/mongodb-js/compass/commit/70f7f5f35f73c1b517f4af18e3554a14d2e98fa1

Comment by Githook User [ 31/Aug/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix(compass): include node-forge in unpacked node_modules COMPASS-5802 (#3345)

Since it is a dependency of win-export-certificate-and-key,
node-forge should also be unpacked, like its dependent.

This adds an e2e test for verifying that the shell works
when connecting to Atlas using tlsUseSystemCA (since that
is an environment which always uses TLS and should always
match the system CA suite).
Branch: 1.33-releases
https://github.com/mongodb-js/compass/commit/70f7f5f35f73c1b517f4af18e3554a14d2e98fa1

Comment by Githook User [ 30/Aug/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix(compass): include node-forge in unpacked node_modules COMPASS-5802 (#3345)

Since it is a dependency of win-export-certificate-and-key,
node-forge should also be unpacked, like its dependent.

This adds an e2e test for verifying that the shell works
when connecting to Atlas using tlsUseSystemCA (since that
is an environment which always uses TLS and should always
match the system CA suite).
Branch: compass-settings
https://github.com/mongodb-js/compass/commit/70f7f5f35f73c1b517f4af18e3554a14d2e98fa1

Comment by Githook User [ 26/Aug/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix(compass): include node-forge in unpacked node_modules COMPASS-5802 (#3345)

Since it is a dependency of win-export-certificate-and-key,
node-forge should also be unpacked, like its dependent.

This adds an e2e test for verifying that the shell works
when connecting to Atlas using tlsUseSystemCA (since that
is an environment which always uses TLS and should always
match the system CA suite).
Branch: connection-info-modal
https://github.com/mongodb-js/compass/commit/70f7f5f35f73c1b517f4af18e3554a14d2e98fa1

Comment by Dominic Sayers [ 03/Aug/22 ]

I worked around this issue by

  1. Installing NodeJS manually using the Windows package from the NodeJS website
  2. npm install node-forge

  1. Restart Compass
Generated at Wed Feb 07 22:40:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.