-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
Description
Summary
During course import, importCoursePlugins() installs plugins concurrently via Promise.all (line 665).
Each plugin install calls adapt-cli installPlugins, which after a successful install reads adapt.json to update the manifest.
When multiple installs run concurrently, they race on reading/writing this file, causing TypeError: Cannot read properties of undefined (reading 'dependencies').
Error
Error: FW_IMPORT_PLUGINS_FAILED
at AdaptFrameworkImport.importCoursePlugins (AdaptFrameworkImport.js:696)
With underlying per-plugin errors:
warn contentplugin PLUGIN_INSTALL_FAIL adapt-close TypeError: Cannot read properties of undefined (reading 'dependencies')
at Project.getManifestDependencies (adapt-cli/lib/integration/Project.js:65)
at install (adapt-cli/lib/integration/PluginManagement/install.js:46)
Root Cause
AdaptFrameworkImport.js:665runsPromise.all(plugins.map(...))— concurrent plugin installs- Each calls
adapt-cli installPlugins→install()ininstall.js - After install, line 46 of
install.jscallsproject.getManifestDependencies() getManifestDependencies()callsreadValidateJSON(adapt.json)which reads theadapt.jsonmanifestreadValidateJSONhas a bug: if the file read fails (e.g. concurrent write), thecatchblock returnsundefinedinstead of re-throwingmanifest.dependenciesonundefined→ TypeError
This is a pre-existing issue (observed on Feb 20 before the utility extraction work). The specific plugins that fail vary between runs due to the non-deterministic nature of the race condition.
Possible Fixes
In adaptframework (workaround):
- Serialize plugin installs: change
Promise.allto sequential execution at line 665
In adapt-cli (root cause):
- See adapt-security/adapt-cli issue (linked below) —
readValidateJSONshould re-throw on error, andgetManifestDependenciesshould handle missingdependenciesgracefully
Reactions are currently unavailable