floci-io/floci · error · AwsException
InvalidRevisionException
InvalidRevisionException
Error message
Revision is required
What it means
Thrown by parseServerAppSpec (CodeDeployService.java:965) when createServerDeployment receives a null revision. For EC2/on-premises compute platforms the appSpec (and its revision container) is mandatory — unlike Lambda deployments, CodeDeploy cannot infer an application revision, so the emulator rejects the call with InvalidRevisionException before any deployment record is created.
Source
Thrown at src/main/java/io/github/hectorvent/floci/services/codedeploy/CodeDeployService.java:965
}
if (!"Success".equals(invocationStatus) && !"InProgress".equals(invocationStatus)) {
finishLifecycleEvent(event, "Failed");
return false;
}
} catch (Exception e) {
LOG.debugv("SSM execution failed for {0} on {1}: {2}", location, instanceId, e.getMessage());
// Graceful degradation: if SSM fails, treat as succeeded
}
}
finishLifecycleEvent(event, "Succeeded");
return true;
}
@SuppressWarnings("unchecked")
private ServerAppSpecInfo parseServerAppSpec(Map<String, Object> revision) {
if (revision == null) {
throw new AwsException("InvalidRevisionException", "Revision is required", 400);
}
String content = null;
Object appSpecContent = revision.get("appSpecContent");
if (appSpecContent instanceof Map<?, ?> asc) {
content = (String) ((Map<String, Object>) asc).get("content");
}
ServerAppSpecInfo info = new ServerAppSpecInfo();
info.os = "linux";
info.hooks = new java.util.LinkedHashMap<>();
if (content == null || content.isBlank()) {
return info;
}
try {
JsonNode root = yamlMapper.readTree(content);View on GitHub (pinned to 62ff490619)
Solutions
- Supply revision.appSpecContent.content with a valid AppSpec file for every server deployment.
- If you meant to deploy without a revision, switch computePlatform to Lambda where a revision from the deployment group may apply.
- Log/inspect the serialized request body right before the call to confirm the revision key is present at the top level.
Example fix
// before
client.create_deployment(
applicationName='my-app',
deploymentGroupName='my-dg',
# revision missing
)
// after
client.create_deployment(
applicationName='my-app',
deploymentGroupName='my-dg',
revision={
'appSpecContent': {'content': 'version: 0.0\nResources: []\nHooks: []'}
},
) Defensive patterns
Strategy: validation
Validate before calling
def build_server_revision(appspec_text: str) -> dict:
if not appspec_text or not appspec_text.strip():
raise ValueError('server AppSpec content is required')
return {'appSpecContent': {'content': appspec_text}}
client.create_deployment(
applicationName=app, deploymentGroupName=dg,
computePlatform='Server',
revision=build_server_revision(appspec_text)) Type guard
def has_valid_revision(request: dict) -> bool:
rev = request.get('revision')
return isinstance(rev, dict) and isinstance(rev.get('appSpecContent'), dict) Try / catch
try:
client.create_deployment(...)
except client.exceptions.InvalidRevisionException as e:
if 'Revision is required' in str(e):
raise RuntimeError('server deployments require revision.appSpecContent') from e
raise Prevention
- Centralize revision construction in one builder function per compute platform.
- Add a unit test asserting every deploy path emits a non-null revision.
- Never reuse a Lambda deploy script verbatim for server groups.
When it happens
Trigger: CreateDeployment with computePlatform=Server (EC2/on-premises) and no revision member in the request; passing a request where the revision key was serialized under a different name or dropped by a client-side struct.
Common situations: Copy-pasting a Lambda deployment script (where revision may be optional) for a server deployment; SDK request objects where revision is left None; JSON built by hand with a typo like 'Revision' or 'revison'.
Related errors
- InstanceNameRequiredException
- InvalidDeploymentConfigException
- TLS enabled but no certificate provided and self-signed gene
- ValidationException
- ValidationException
AI-assisted analysis of floci-io/floci@62ff490619 (2026-08-14).
Data as JSON: /api/errors/ed920242c0ff8542.
Report an issue: GitHub.