为何Jelastic清单可通过仪表盘导入安装但无法通过REST API安装?
The core issue here is a behavior difference between Jelastic Dashboard and the REST API in v6.0.2—specifically, the /1.0/marketplace/jps/REST/install endpoint requires your manifest to define at least one node configuration, even if you don't need actual compute resources.
Let's break down what's happening:
Dashboard's lenient handling:
The Jelastic Dashboard has a fallback mechanism that allows installing manifests without node definitions. It can create a "virtual" environment context just to run youronInstallscripts, which is why your minimal manifest works seamlessly there.API's strict requirement:
The REST API in v6.0.2 doesn't have this fallback. It needs explicit node configuration to initialize an environment entity (including generating the domain tied to yourenvName). Without nodes, the API can't create the necessary environment record, hence the error:Can't find environment by domain [jelasticclient-master-0954606]Why adding nodes fixes it:
When you include thenodesblock, the API can properly provision an environment instance, assign the expected domain linked to yourenvName, and then execute youronInstalllogic—everything works as intended.
Workaround for "node-less" installations:
If you don't need persistent compute nodes, you can add a minimal, low-resource node configuration (and even clean it up post-install if needed). For example:
type: install name: very simple manifest nodes: count: 1 cloudlets: 1 # Minimal cloudlet allocation to meet API requirements nodeGroup: cp image: alpine:latest skipNodeEmails: true onInstall: - log: installing manifest # Optional: Remove the node if you don't need it after setup - removeNodes: nodeGroup: cp count: 1
This satisfies the API's node configuration requirement while letting you run your intended scripts without leaving unnecessary resources running.
内容的提问来源于stack exchange,提问作者Laurent Michel

